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
fix(auth): port the v2 response parsing fixes - #2058
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
OTP verification now handles secure email-change confirmations, including pending confirmations and responses containing user or session details.
MFA factor listings preserve phone numbers for phone factors.
OAuth clients can be listed and retrieved when a client name is not provided.
Bug Fixes
Retryable authentication errors retain the original status and, when available, the response message.
The OTP verification parser now handles pending secure email-change responses and continues to use the general parser for other responses. Factor includes an optional phone number, and OAuthClient.client_name is optional. Sync and async tests cover these response and model cases. Helper tests also cover retryable responses with empty, HTML, and parseable JSON bodies.
Sequence Diagram(s)
sequenceDiagram
participant AuthClient
participant VerifyOtpParser as _parse_verify_otp_response
participant AuthResponseParser as parse_auth_response
AuthClient->>VerifyOtpParser: response and OTP parameters
alt pending secure email-change response
VerifyOtpParser-->>AuthClient: empty AuthResponse
else other response
VerifyOtpParser->>AuthResponseParser: response
AuthResponseParser-->>VerifyOtpParser: parsed AuthResponse
VerifyOtpParser-->>AuthClient: parsed AuthResponse
end
Loading
Possibly related PRs
supabase/supabase-py#1933: Changes session handling in verify_otp() for responses without a session, adjacent to this PR’s response parsing changes.
supabase/supabase-py#1845: Changes verify_otp() to accept the pending secure email-change response marker, the same parsing behavior covered here.
Change: Bug fix
Merge Risk: Minimal · up to 60b0f
This change ports small auth parsing fixes: a pending secure email-change confirmation returns an empty response, phone factors carry a phone number, and OAuth clients may lack a name. The changes are narrow and backward compatible, and they come with tests. No merge-blocking risk was identified.
- [ ] 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: 023004a0-a183-4eb8-9d1a-6e261dd5f6b8
Commits
Reviewing files that changed from the base of the PR and between 7e1a0005b3a460e300cfc2bfb774e6641a70ef7f and 60b0fca.
Files selected for processing: 8
src/auth/src/supabase_auth/client.py
src/auth/src/supabase_auth/helpers.py
src/auth/src/supabase_auth/types.py
src/auth/tests/_async/test_oauth_client_list.py
src/auth/tests/_async/test_verify_otp.py
src/auth/tests/_sync/test_oauth_client_list.py
src/auth/tests/_sync/test_verify_otp.py
src/auth/tests/test_helpers.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 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.
Ports the four v2 auth parsing fixes to v3. SDK-2822
verify_otpreturns an emptyAuthResponsefor the first confirmation of a secure email change instead of raisingValidationError(v2 fix(auth): accept pending secure email confirmations #1845).Factorgains thephonefield of phone factors (v2 fix(auth): preserve phone numbers in MFA factor responses #1837).OAuthClient.client_nameis optional, so clients without a name parse (v2 fix(auth): accept oauth clients without a name #1830).AuthRetryableErroron main; this adds tests for the empty body, 429 and the preserved message (v2 fix(auth): preserve the server error message on retryable 5xx responses #1833).