This repository was archived by the owner on Sep 1, 2026. It is now read-only.
feat: add Saml and Oidc to AuthProvider enum - #1617
Open
giutrec wants to merge 8 commits into
Open
Conversation
- Added Saml and Oidc variants to AuthProvider enum in libs/gotrue-entity/src/dto.rs. - Updated as_str() mapping to return 'saml' and 'oidc' strings for GoTrue. - Updated from_str deserialization: 'sso' and 'oidc' both map to AuthProvider::Oidc.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExtends the AuthProvider enum with new SAML and OIDC providers and wires them into string serialization/deserialization, including backward-compatible handling of existing 'sso' values. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider adding a short comment around the "sso" -> AuthProvider::Oidc mapping in from_str to make it clear why SSO is being treated as OIDC specifically, as this behavior may not be obvious to future maintainers.
- To reduce the risk of AuthProvider variants getting out of sync with as_str/from_str, you might centralize the string mappings (e.g., via a single lookup table or helper) so that adding new providers in the future only requires updating one place.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a short comment around the "sso" -> AuthProvider::Oidc mapping in from_str to make it clear why SSO is being treated as OIDC specifically, as this behavior may not be obvious to future maintainers.
- To reduce the risk of AuthProvider variants getting out of sync with as_str/from_str, you might centralize the string mappings (e.g., via a single lookup table or helper) so that adding new providers in the future only requires updating one place.
## Individual Comments
### Comment 1
<location path="libs/gotrue-entity/src/dto.rs" line_range="187-188" />
<code_context>
AuthProvider::Email => "email",
AuthProvider::Phone => "phone",
AuthProvider::Zoom => "zoom",
+ AuthProvider::Saml => "saml",
+ AuthProvider::Oidc => "oidc",
}
}
</code_context>
<issue_to_address>
**issue (bug_risk):** Consider whether `to_string` should round-trip `"sso"` inputs consistently.
Currently `from_str` treats both `"sso"` and `"oidc"` as `AuthProvider::Oidc`, but `to_string` always emits `"oidc"`. If any persisted data or external APIs store `"sso"`, this asymmetry will change what they see on round-trip. If that’s a concern, consider either removing the `"sso"` alias or adding a separate variant/flag so that round-tripping preserves the original label.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary by Sourcery
New Features: