You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(auth): verify ES384 and ES512 jwts locally in get_claims - #2190
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
JWTs signed with ES384 or ES512 can now be verified locally when their EC keys use the matching curves.
Bug Fixes
Tokens with mismatched algorithms, key curves, or signatures are handled correctly, including falling back to user lookup when local verification is not supported.
Local JWT verification now supports ES384 with P-384 keys and ES512 with P-521 keys when the JWK algorithm is absent or matches the curve. Sync and async tests cover successful verification, invalid signatures, algorithm mismatches, and fallback to /user for unsupported or conflicting JWK declarations.
supabase/supabase-py#2081: It changes how get_claims binds token algorithms to JWKs and handles mismatches and fallback.
Change: Feature
Merge Risk: Minimal · up to 97258
This change adds local verification of ES384 and ES512 tokens in get_claims, with fallback to /user when a JWK declaration is unsupported or conflicting. No concrete merge-blocking risk was identified in the supplied change.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 7de3d5e3-757a-4e73-ae10-caa3f242b682
Commits
Reviewing files that changed from the base of the PR and between 5ec655e and 972584e.
Files selected for processing: 3
src/auth/src/supabase_auth/helpers.py
src/auth/tests/_async/test_get_claims.py
src/auth/tests/_sync/test_get_claims.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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.
get_claimsnow verifiesES384(P-384) andES512(P-521) tokens against the JWK Set instead of calling/user, following the spec in supabase/sdk#418.kty: ECkeys withcrv: P-384andcrv: P-521. A JWK whosealgandcrvdisagree still takes the fallback.alg/crvmismatches.SDK-3345