FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: Add thread safety to overcome race condition during 401 client certificate rotation in transports by agrawalradhika-cell · Pull Request #18168 · googleapis/google-cloud-python · GitHub

chore: Add thread safety to overcome race condition during 401 client certificate rotation in transports - #18168

Open
agrawalradhika-cell wants to merge 8 commits into
mainfrom
http-cert-thread-lock
Open

chore: Add thread safety to overcome race condition during 401 client certificate rotation in transports#18168
agrawalradhika-cell wants to merge 8 commits into
mainfrom
http-cert-thread-lock

Conversation

Copy link
Copy Markdown
Contributor

chore: Add thread safety to overcome race condition during 401 client certificate rotation in transports

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #17756 🦕

Introduce a lock for thread-safe reauthentication when mTLS parameters change.
Added a reauthentication lock to prevent concurrent reconfiguration of mTLS channel when client certificate changes.
Added a test to ensure reauthentication lock is acquired on unauthorized response for MTLS sessions.
Added a test to verify reauthentication lock acquisition on unauthorized responses in AuthorizedHttp.
agrawalradhika-cell requested review from a team as code owners August 19, 2026 20:39

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request introduces thread safety during mutual TLS (mTLS) re-authentication in both the requests and urllib3 transport adapters by utilizing a threading lock. This prevents race conditions when checking and reconfiguring the mTLS channel upon receiving an unauthorized response. Unit tests have been added to verify that the lock is correctly acquired. The review feedback points out redundant duplicate imports of the http.client module in both test files, which should be cleaned up.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

google-auth: Thread safety race condition during 401 client certificate rotation in transports

2 participants


Back | FazBrowse Home | New Git URL