Skip to content

PYTHON-6030 Consolidate _OIDCAuthenticator classes into shared base class - #3136

Open
NoahStapp wants to merge 1 commit into
mongodb:mainfrom
NoahStapp:PYTHON-6030
Open

NoahStapp wants to merge 1 commit into
mongodb:mainfrom
NoahStapp:PYTHON-6030

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

PYTHON-6030

Changes in this PR

Consolidate existing sync and async _OIDCAuthenticator non-IO code into a shared base class.

Test Plan

Existing test suite.

Checklist

Checklist for Author

  • [ ] Did you update the changelog (if necessary)?
  • Is there test coverage?
  • [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@NoahStapp
NoahStapp marked this pull request as ready for review October 19, 2026 18:58
@NoahStapp
NoahStapp requested a review from a team as a code owner October 19, 2026 18:58
@NoahStapp
NoahStapp requested review from sleepyStick and a balanced review from Copilot October 19, 2026 18:58

Copilot AI 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.

🟢 Approval recommended

Static review supports a behavior-preserving refactor with no blocking issues; tests were not run.

No open issues 🎉

What changed in this PR

Consolidates shared, non-I/O OIDC authentication logic into a base class while keeping I/O in the synchronous and asynchronous implementations.

Changes:

  • Moves common state and command-building helpers into _OIDCAuthenticatorBase.
  • Updates subclasses to inherit shared behavior and pass token generation IDs to invalidation.
File Description
pymongo/​synchronous/​auth_oidc.py Uses the shared base in the generated synchronous implementation.
pymongo/​auth_oidc_shared.py Defines the shared authenticator state and non-I/O helpers.
pymongo/​asynchronous/​auth_oidc.py Uses the shared base while retaining asynchronous I/O.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants