Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-128192: support HTTP sha-256 digest authentication as per RFC-7617#128193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 15 commits intopython:mainfromcalvinbui:patch-1
Dec 28, 2024
Merged

gh-128192: support HTTP sha-256 digest authentication as per RFC-7617#128193

gpshead merged 15 commits intopython:mainfromcalvinbui:patch-1
Dec 28, 2024

Conversation

@calvinbui
Copy link
Contributor

@calvinbuicalvinbui commentedDec 23, 2024
edited by bedevere-appbot
Loading

as mentioned in the issue, other authentication exist, but i don't see them supported out of the box in hashlib.

this all depends if python wishes to support rfc7616

@ghost
Copy link

ghost commentedDec 23, 2024
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@ZeroIntensity
Copy link
Member

ZeroIntensity commentedDec 23, 2024
edited
Loading

cc@picnixz (cryptography expert)

…e-128192.02mEhD.rstCo-authored-by: Peter Bierma <zintensitydev@gmail.com>
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

A preliminary round of comments. You can also update "RFC 2617" to "RFC 2617/7616" in the AbstractDigestAuthHandler comment.

@gpsheadgpshead self-requested a reviewDecember 24, 2024 19:02
@picnixzpicnixz self-requested a reviewDecember 28, 2024 09:36
handler=AbstractDigestAuthHandler()
classTestDigestAlgorithms(unittest.TestCase):
defsetUp(self):
self.handler=AbstractDigestAuthHandler()
Copy link
Member

Choose a reason for hiding this comment

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

In a follow-up PR (or this one), if you want/can, we can add tests for a full communication round where we request HTTP digest authentication.

gpshead reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

yep, next time!

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixz
Copy link
Member

We are still missing the What's New entry and the modified NEWS entry.

calvinbuiand others added2 commitsDecember 28, 2024 21:12
…e-128192.02mEhD.rstCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@calvinbui
Copy link
ContributorAuthor

We are still missing the What's New entry and the modified NEWS entry.

my bad, fixed

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

We may also need an additional.. versionchanged:: next in the docs to mention SHA-256 inhttps://docs.python.org/3/library/urllib.request.html#urllib.request.AbstractDigestAuthHandler.

I think we'll also need a follow-up PR to update the docs because they are lacking IMO.

@calvinbui
Copy link
ContributorAuthor

We may also need an additional.. versionchanged:: next in the docs to mention SHA-256 inhttps://docs.python.org/3/library/urllib.request.html#urllib.request.AbstractDigestAuthHandler.

added

I think we'll also need a follow-up PR to update the docs because they are lacking IMO.

what docs were you thinking of? i can make a new gh issue for it, as well as the complete end-to-end http digest auth test

@picnixz
Copy link
Member

picnixz commentedDec 28, 2024
edited
Loading

what docs were you thinking of? i can make a new gh issue for it, as well as the complete end-to-end http digest auth test

None of the methods of AbstractDigestAuthHandler are actually documented so we may want to document them. If someone wants to subclass this interface, they need to know its usage.

For now, let's wait for Gregory's feedback.

@picnixzpicnixz changed the titlegh-128192: support sha-256 digest authenticationgh-128192: support HTTP sha-256 digest authentication as per RFC-7617Dec 28, 2024
@gpsheadgpshead self-assigned thisDec 28, 2024
@gpsheadgpshead added type-featureA feature request or enhancement 3.14bugs and security fixes labelsDec 28, 2024
@gpsheadgpsheadenabled auto-merge (squash)December 28, 2024 20:47
@gpsheadgpshead merged commitf9a5a3a intopython:mainDec 28, 2024
41 of 42 checks passed
@picnixz
Copy link
Member

picnixz commentedDec 28, 2024
edited
Loading

Thank you for your contribution Calvin and Gregory for the merge/2nd review.

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x has failed when building commitf9a5a3a.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/469/builds/9772) and take a look at the build logs.
  4. Check if the failure is related to this commit (f9a5a3a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/469/builds/9772

Failed tests:

  • test_urllib2

Failed subtests:

  • test_md5_algorithm - test.test_urllib2.TestDigestAlgorithms.test_md5_algorithm

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_urllib2.py", line1972, intest_md5_algorithmself.assertEqual(H("foo"),"acbd18db4cc2f85cedef654fccc4a4d8")~^^^^^^^  File"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/urllib/request.py", line1182, in<lambda>    H=lambdax: hashlib.md5(x.encode("ascii")).hexdigest()~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ValueError:[digital envelope routines: EVP_DigestInit_ex] disabled for FIPS

@gpshead
Copy link
Member

i'm not surprised at that buildbot error. it is running in an unrealistic config without critical hash functions. we'll ultimately just need to decorate the test to indicate that it requires md5, sha1, and sha256 - skipping it otherwise. (see test_hashlib)

@picnixz
Copy link
Member

I'll do it tomorrow (it's almost midnight here and I'm no more on my dev session) or someone else somewhere else can add the decorators. However, maybe we should revert the commit just to avoid other PRs to have the buildbot failure in the meantime?

@gpshead
Copy link
Member

No worries. That buildbot is an unstable unsupported configuration, no need to revert anything.

It's there solely so that we can use it to identify and clean up test dependency declaration issueseventually. It doesn't block anything.

picnixz reacted with thumbs up emoji

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull requestJan 8, 2025
…C-7617 (pythonGH-128193)support sha-256 digest authenticationCo-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@picnixzpicnixzpicnixz left review comments

@ZeroIntensityZeroIntensityZeroIntensity left review comments

@gpsheadgpsheadgpshead approved these changes

+1 more reviewer

@rruuaanngrruuaanngrruuaanng left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@gpsheadgpshead

Labels

3.14bugs and security fixestype-featureA feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@calvinbui@ZeroIntensity@picnixz@bedevere-bot@gpshead@rruuaanng

[8]ページ先頭

©2009-2025 Movatter.jp