-
Notifications
You must be signed in to change notification settings - Fork 4
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
[REF] Manually verify ID token using PyJWT instead of google_auth #386
Conversation
Reviewer's Guide by SourceryThis PR replaces Google's authentication library with PyJWT for ID token verification. The implementation involves manually verifying JWT tokens using PyJWT's JWKS client to fetch signing keys from Auth0's JWKS endpoint. The changes maintain the same security guarantees while switching the authentication provider from Google to Auth0. Sequence diagram for ID token verification processsequenceDiagram
participant Client
participant Server
participant Auth0
Client->>Server: Send ID token
Server->>Auth0: Fetch signing keys from JWKS endpoint
Auth0-->>Server: Return signing keys
Server->>Server: Verify token using PyJWT
Server-->>Client: Return verification result
Updated class diagram for security moduleclassDiagram
class Security {
+check_client_id()
+verify_token(token: str)
}
class PyJWKClient {
+get_signing_key_from_jwt(jwt: str)
}
class PyJWTError
Security --> PyJWKClient : uses
Security --> PyJWTError : handles exception
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @alyssadai - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- The Bearer scheme verification should be implemented rather than left as a TODO (link)
- Replace print statement with proper logging (link)
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 2 blocking issues
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #386 +/- ##
=======================================
Coverage ? 97.05%
=======================================
Files ? 24
Lines ? 850
Branches ? 0
=======================================
Hits ? 825
Misses ? 25
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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.
Nice, thanks @alyssadai !
🧑🍳
neurobagel/query-tool#380 is merged, @alyssadai you can merge this too |
🚀 PR was released in |
Changes proposed in this pull request:
Checklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
For new features:
For bug fixes:
Summary by Sourcery
Replace Google ID token verification with manual verification using PyJWT, updating the security module to use PyJWT for token decoding and verification. Update the OAuth2 authorization URL to use Auth0 instead of Google. Modify the requirements to remove google-auth and add necessary dependencies for PyJWT.
Enhancements:
Build: