Skip to content

bpo-23033: consider wildcard in left most segment only for domain names#937

Merged
Mariatta merged 10 commits into
python:masterfrom
daxlab:bpo-23033
Nov 26, 2017
Merged

bpo-23033: consider wildcard in left most segment only for domain names#937
Mariatta merged 10 commits into
python:masterfrom
daxlab:bpo-23033

Conversation

@daxlab

@daxlab daxlab commented Apr 1, 2017

Copy link
Copy Markdown
Contributor

@mention-bot

Copy link
Copy Markdown

@daxlab, thanks for your PR! By analyzing the history of the files in this pull request, we identified @janssen, @Yhg1s and @tiran to be potential reviewers.

@alex

alex commented Apr 1, 2017

Copy link
Copy Markdown
Member

Looks like there is a relevant failing ssl test.

@daxlab

daxlab commented Apr 2, 2017

Copy link
Copy Markdown
Contributor Author

@alex review now.

@alex alex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few small comments.

Thanks for working on this! This is a great improvement to making match_hostname behave more like the rest of the PKI infrastructure.

Comment thread Lib/ssl.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please use a # style comment. """ is for docstrings.

Comment thread Lib/test/test_ssl.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment still doesn't fell right, there is a wildcard in the left-most segment. I think it should say something like "only match wildcards when they are the only thing in the left-most segment". What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds much better, pushing the changes.

@alex

alex commented Apr 2, 2017

Copy link
Copy Markdown
Member

Doc failures are not your fault, sphinx-doc/sphinx#3597 is the cause.

@daxlab

daxlab commented Apr 2, 2017

Copy link
Copy Markdown
Contributor Author

@alex anything else needed from my side ?

@alex

alex commented Apr 2, 2017

Copy link
Copy Markdown
Member

This looks good to me. I'll probably ask for another review before landing. Thanks so much!

@reaperhulk reaperhulk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Wildcards should be honored iff they are the leftmost fragment and are the only character in that fragment.

@tiran

tiran commented Apr 2, 2017

Copy link
Copy Markdown
Member

You are almost there! Please add a versionchanged:: 3.7 to match_hostname documentation in Doc/library/ssl.rst.

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versionchanged in documentation is missing.

@daxlab

daxlab commented Apr 2, 2017

Copy link
Copy Markdown
Contributor Author

@tiran version changed docs added. Should that go in Doc/whatsnew/3.7.rst also ?

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution, @daxlab. Your work is an excellent base to clean up and simplify the host matching code even further.

@alex the change is backwards incompatible. I've asked Ben and Ned if they are fine with backports to 2.7 and 3.6.

@daxlab daxlab force-pushed the bpo-23033 branch 2 times, most recently from 31c911b to 2416d6a Compare April 2, 2017 18:53
@daxlab

daxlab commented Apr 3, 2017

Copy link
Copy Markdown
Contributor Author

@tiran @alex can we merge this ?

@tiran

tiran commented Apr 4, 2017

Copy link
Copy Markdown
Member

@daxlab @alex I'm waiting for confirmation regarding backport to 3.6 and 2.7.

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to add an entry to Misc/NEWS.

Comment thread Doc/whatsnew/3.7.rst Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change :meth:`match_hostname` to :meth:`ssl.match_hostname`. This would create a link to the ssl.match_hostname() documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@berkerpeksag thanks for review. I have pushed a fix.

Comment thread Misc/NEWS Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add "Patch by Mandeep Singh."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@Mariatta

Copy link
Copy Markdown
Member

Please add yourself to Misc/ACKS, resolve the conflict and update Misc/NEWS.
Thanks.

@daxlab

daxlab commented Jul 2, 2017

Copy link
Copy Markdown
Contributor Author

@Mariatta changes pushed.

@daxlab daxlab requested a review from a team October 1, 2017 07:19
@daxlab daxlab requested a review from a team as a code owner October 1, 2017 07:19
@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@brettcannon brettcannon changed the title bpo-23033: consider wildcard in left most segment only bpo-23033: consider wildcard in left most segment only for domain names Oct 2, 2017
@Mariatta

Copy link
Copy Markdown
Member

Thanks @daxlab for your patience with this PR, sorry it's taking a while.
I think this can go to 3.7.
Could you rebase this to make it up to date? We need the news entry in Misc/NEWS.d/, it can be generated using blurb.

@daxlab

daxlab commented Nov 24, 2017

Copy link
Copy Markdown
Contributor Author

@Mariatta will update the PR tonight.

@daxlab

daxlab commented Nov 26, 2017

Copy link
Copy Markdown
Contributor Author

@Mariatta I have rebased the PR and added news entry in Misc/NEWS.d/

@Mariatta

Copy link
Copy Markdown
Member

Thanks. I made minor changes and added you to Misc/ACKs. Waiting until CI is done.

@Mariatta Mariatta merged commit ede2ac9 into python:master Nov 26, 2017
@Mariatta

Copy link
Copy Markdown
Member

Thanks again @daxlab and congrats on your first contribution to CPython 🌮

@daxlab daxlab deleted the bpo-23033 branch November 27, 2017 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants