Remove single IdP special-case for /sso/get-by-email#5291
Draft
supersven wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the IdP selection logic for /sso/get-by-email so that a single configured IdP is no longer automatically returned; instead, the IdP must match the requested domain (including the Nothing/unset case).
Changes:
- Removed the “single IdP always matches” branch in
getSsoCodeByEmailImpl, delegating all non-empty cases to domain-based matching. - Updated the unit property test to assert
Just idpIdonly when the IdP’s configured domain matches the requested domain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/wire-subsystems/src/Wire/IdPSubsystem/Interpreter.hs | Removes the singleton-IdP shortcut and always performs domain-based IdP selection for non-empty IdP lists. |
| libs/wire-subsystems/test/unit/Wire/IdPSubsystem/InterpreterSpec.hs | Adjusts the property test expectations to align with the updated domain-matching behavior. |
| [idp] -> (pure . pure) (idp ^. SAML.idpId) | ||
| pure Nothing | ||
| selectIdP idps = | ||
| -- Multiple IdPs: find by domain if host provided |
…ress mode When multi-ingress is active, each IdP has a domain field that ties it to a specific ingress point. Reject initiate-login requests where the incoming Z-Host header does not match the IdP's configured domain (404 idp-not-for-this-domain). Single-ingress deployments unaffected. Changes: - services/spar/src/Spar/Error.hs: add SparIdPNotForThisDomain error - services/spar/src/Spar/API.hs: pass samlConfig to authreq, add domain validation
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.
Ticket: https://wearezeta.atlassian.net/browse/WPB-26244
Checklist
changelog.d