-
Notifications
You must be signed in to change notification settings - Fork 22
feat(auth): oidc auth support #45
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Greptile Summary
This PR adds OIDC (OpenID Connect) authentication support to the Python SDK, expanding the available authentication methods alongside existing AWS and Universal authentication options. The implementation follows the established architectural pattern used throughout the codebase.
The changes include:
- New OIDC Authentication Class: Creates
infisical_sdk/resources/auth_methods/oidc_auth.pywith anOidcAuthclass that accepts anidentity_idand JWT token, makes a POST request to/api/v1/auth/oidc-auth/login, and sets the access token upon successful authentication - Module Integration: Updates
auth_methods/__init__.pyto export the newOidcAuthclass - Main Auth Interface: Modifies
auth.pyto instantiateOidcAuthasself.oidc_auth, making it accessible through the centralized Auth class
The implementation maintains consistency with existing authentication methods by using the same constructor pattern (requests and setToken callback), following identical login method signatures, and integrating seamlessly with the Auth class factory pattern. Users can now authenticate using auth.oidc_auth.login(identity_id, jwt) alongside existing methods like auth.universal_auth.login() and auth.aws_auth.login().
The code structure mirrors the existing auth implementations, ensuring the SDK's API design remains consistent and predictable for developers already familiar with other authentication methods in the SDK.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it follows established patterns and adds functionality without breaking existing features
- Score reflects consistent implementation patterns and straightforward additive changes, though minor formatting improvements could be made
- Pay attention to the missing newline at end of
auth_methods/__init__.pyfile
Context used:
Context - For event handlers, separate logic for different events (e.g., onClick and onKeyDown) into distinct functions for clarity. (link)
3 files reviewed, 2 comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…on-sdk-official into daniel/token-auth
sidwebworks
left a comment
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.
LGTM
This PR adds OIDC auth support to the Python SDK
No docs are added, as we are moving docs to on-site documentation.