Phase 4b: Invite SSO enforcement + SSO routing#2797
Open
GregorShear wants to merge 1 commit intomasterfrom
Open
Phase 4b: Invite SSO enforcement + SSO routing#2797GregorShear wants to merge 1 commit intomasterfrom
GregorShear wants to merge 1 commit intomasterfrom
Conversation
825b209 to
c470810
Compare
GregorShear
commented
Mar 21, 2026
Comment on lines
+301
to
+306
| .split_at( | ||
| invite | ||
| .catalog_prefix | ||
| .find('/') | ||
| .expect("prefix must contain '/'") | ||
| + 1, |
Contributor
Author
There was a problem hiding this comment.
Is there a util function somewhere to extract tenant from prefix? not that it's complicated, but...
Member
There was a problem hiding this comment.
There's this, though nothing I can recall that's in a shared module. Seems like it might be worth it, though
aa6dbf2 to
6544467
Compare
psFried
approved these changes
Mar 23, 2026
crates/control-plane-api/src/server/public/graphql/invite_links.rs
Outdated
Show resolved
Hide resolved
Comment on lines
+301
to
+306
| .split_at( | ||
| invite | ||
| .catalog_prefix | ||
| .find('/') | ||
| .expect("prefix must contain '/'") | ||
| + 1, |
Member
There was a problem hiding this comment.
There's this, though nothing I can recall that's in a shared module. Seems like it might be worth it, though
bb22086 to
7cb615f
Compare
|
7cb615f to
6b4fe9d
Compare
GregorShear
commented
Mar 23, 2026
Comment on lines
+238
to
+243
| pub fn tenant_from(prefix: &str) -> &str { | ||
| let idx = prefix | ||
| .find('/') | ||
| .expect("prefix must contain at least one /"); | ||
| &prefix[..idx + 1] | ||
| } |
Contributor
Author
There was a problem hiding this comment.
okay for this to live here?
c9ecd92 to
8e55746
Compare
8e55746 to
15109f7
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
sso_provider_id IS NOT NULLand the redeeming user lacks a matching SSO identity (auth.identities.provider_id = tenants.sso_provider_id).sso_provider_id IS NOT NULL.Additionally, route invite links directly into the SSO flow:
createInviteLinklooks up the tenant'ssso_provider_idand includes it in the returned link/metadatassoProviderID to the invite link URL (e.g.?grantToken=...&ssoProvider=...)ssoProviderfrom query params and calls GoTruePOST /auth/v1/ssodirectlyThese ship together because rejecting non-SSO invite redemption without routing users to the correct SSO flow would be a dead end.
Verify:
sso_provider_id) → rejected with clear errorsso_provider_id→ unaffectedsso_provider_id→ unaffected (no restriction)ssoProviderparam → user routed directly into SSO flow