GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-128192: support HTTP sha-256 digest authentication as per RFC-7617 by calvinbui · Pull Request #128193 · python/cpython

Conversation

@calvinbui

@calvinbui calvinbui commented Dec 23, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  • Issue: Support HTTP digest authentication algorithm SHA-256 as per RFC-7617 #128192

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@calvinbui
support sha-256 digest authentication
eb7fe23
@ghost

ghost commented Dec 23, 2024 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request Dec 23, 2024
Support HTTP digest authentication algorithm SHA-256 as per RFC-7617 #128192
Closed
@bedevere-app

bedevere-app Bot commented Dec 23, 2024

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Dec 23, 2024
@blurb-it
📜🤖 Added by blurb_it.
06cd409
ZeroIntensity
ZeroIntensity reviewed Dec 23, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2024-12-23-11-14-07.gh-issue-128192.02mEhD.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity

ZeroIntensity commented Dec 23, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

cc @picnixz (cryptography expert)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@calvinbui @ZeroIntensity
Update Misc/NEWS.d/next/Core_and_Builtins/2024-12-23-11-14-07.gh-issu…
1d9d1af
…e-128192.02mEhD.rst

Co-authored-by: Peter Bierma <[email protected]>
rruuaanng
rruuaanng reviewed Dec 24, 2024
View reviewed changes
Comment thread Lib/urllib/request.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Dec 24, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/urllib/request.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/urllib/request.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Core_and_Builtins/2024-12-23-11-14-07.gh-issue-128192.02mEhD.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gpshead
gpshead self-requested a review December 24, 2024 19:02
calvinbui added 5 commits December 28, 2024 02:30
@calvinbui
comments regarding rfc7616
aea1b4e
@calvinbui
move md5-sess comment
5c21402
@calvinbui
tests
10b25ad
@calvinbui
fix lint
fa80be1
@calvinbui
Add name in ACKS
3c2ac12
@picnixz
picnixz self-requested a review December 28, 2024 09:36
picnixz
picnixz reviewed Dec 28, 2024
View reviewed changes
Comment thread Lib/test/test_urllib2.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_urllib2.py
handler = AbstractDigestAuthHandler()
class TestDigestAlgorithms(unittest.TestCase):
def setUp(self):
self.handler = AbstractDigestAuthHandler()

@picnixz picnixz Dec 28, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@calvinbui calvinbui Dec 28, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

yep, next time!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@calvinbui @picnixz
Update Lib/test/test_urllib2.py
d9e3c44
Co-authored-by: Bénédikt Tran <[email protected]>
@picnixz

picnixz commented Dec 28, 2024

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

calvinbui and others added 2 commits December 28, 2024 21:12
@calvinbui @picnixz
Update Misc/NEWS.d/next/Core_and_Builtins/2024-12-23-11-14-07.gh-issu…
47c0148
…e-128192.02mEhD.rst

Co-authored-by: Bénédikt Tran <[email protected]>
@calvinbui
update what's new
28866f9
@calvinbui

calvinbui commented Dec 28, 2024

Copy link
Copy Markdown
Contributor Author

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

my bad, fixed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Dec 28, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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 in https://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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

calvinbui and others added 3 commits December 29, 2024 02:39
@calvinbui
update docs
7f9dc2f
@calvinbui @picnixz
Update Doc/whatsnew/3.14.rst
9292180
Co-authored-by: Bénédikt Tran <[email protected]>
@calvinbui
Merge branch 'patch-1' of github.com:calvinbui/cpython into patch-1
2e2367d
@calvinbui

calvinbui commented Dec 28, 2024

Copy link
Copy Markdown
Contributor Author

We may also need an additional .. versionchanged:: next in the docs to mention SHA-256 in https://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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Dec 28, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz changed the title gh-128192: support sha-256 digest authentication gh-128192: support HTTP sha-256 digest authentication as per RFC-7617 Dec 28, 2024
gpshead
gpshead approved these changes Dec 28, 2024
View reviewed changes
Comment thread Lib/urllib/request.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Dec 28, 2024
@gpshead
mention
5381ff4
@gpshead gpshead self-assigned this Dec 28, 2024
@gpshead gpshead added type-feature A feature request or enhancement 3.14 bugs and security fixes labels Dec 28, 2024
@gpshead
gpshead enabled auto-merge (squash) December 28, 2024 20:47
@gpshead
gpshead merged commit f9a5a3a into python:main Dec 28, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 28, 2024
@picnixz

picnixz commented Dec 28, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Dec 28, 2024

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x has failed when building commit f9a5a3a.

What do you need to do:

  1. Don't panic.
  2. Check the 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", line 1972, in test_md5_algorithm
    self.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", line 1182, in <lambda>
    H = lambda x: hashlib.md5(x.encode("ascii")).hexdigest()
                  ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead

gpshead commented Dec 28, 2024

Copy link
Copy Markdown
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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Dec 28, 2024

Copy link
Copy Markdown
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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead

gpshead commented Dec 28, 2024

Copy link
Copy Markdown
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 issues eventually. It doesn't block anything.

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@calvinbui @ZeroIntensity
@picnixz @gpshead @srinivasreddy
pythongh-128192: support HTTP sha-256 digest authentication as per RF…
0abd6f0
…C-7617 (pythonGH-128193)

support sha-256 digest authentication

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Gregory P. Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@gpshead gpshead gpshead approved these changes
+1 more reviewer
@rruuaanng rruuaanng rruuaanng left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

3.14 bugs and security fixes type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@calvinbui @ZeroIntensity @picnixz @bedevere-bot @gpshead @rruuaanng
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.