WPB-26291 prevent SCIM user change name on registration#5268
Open
battermann wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enforces that SCIM-managed invited users cannot change their display name during registration (server-side), while maintaining backwards compatibility by introducing a version-gated /register behavior split (v16 vs v17+). It also enriches the team invitation info response to optionally expose managed_by, and updates golden + integration tests and changelog accordingly.
Changes:
- Add a v17+ registration guard that rejects SCIM display-name changes during
POST /register(new403 managed-by-scimcase), while keeping pre-v17 behavior viaregister@v16. - Extend
GET /teams/invitations/info?code=...response with optionalmanaged_byand wire it through Brig. - Update golden fixtures and integration tests to cover SCIM invitation info and registration behavior.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| services/brig/src/Brig/Team/API.hs | Adds managedBy to invitation info responses by looking up a pending user derived from invitation id. |
| services/brig/src/Brig/Data/User.hs | Introduces invitationIdToUserId helper for SCIM/pending-invitation user id derivation. |
| services/brig/src/Brig/API/User.hs | Adds SCIM display-name guard and splits registration into v16 vs v17+ implementations. |
| services/brig/src/Brig/API/Public.hs | Wires register@v16 and register handlers to the new Brig registration functions. |
| libs/wire-api/src/Wire/API/User.hs | Extends RegisterError union with the new SCIM display-name mismatch case. |
| libs/wire-api/src/Wire/API/Team/Invitation.hs | Adds optional managed_by field to InvitationUserView schema/JSON. |
| libs/wire-api/src/Wire/API/Routes/Public/Brig.hs | Adds version-gated register@v16 endpoint and gates register from v17. |
| libs/wire-api/test/golden/testObject_InvitationUserView_team_1.json | Updates golden JSON to include managed_by. |
| libs/wire-api/test/golden/testObject_InvitationUserView_team_2.json | Updates golden JSON to include managed_by. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/InvitationUserView.hs | Updates golden Haskell objects to populate managedBy. |
| integration/test/Test/Teams.hs | Adds assertion that non-SCIM invitation info omits managed_by. |
| integration/test/Test/Spar.hs | Adds SCIM registration test asserting name change is rejected with managed-by-scim. |
| integration/test/SetupHelpers.hs | Adjusts invited-user registration helper to reuse invitation-provided name (SCIM-safe). |
| integration/test/API/Brig.hs | Adds registerUserWith to support name-parametrized registration in tests. |
| changelog.d/3-bug-fixes/WPB-26291 | Documents bug fix for SCIM name changes on registration. |
| changelog.d/1-api-changes/WPB-26291 | Documents API change (new error for v17+, optional managed_by on invitation info). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
blackheaven
approved these changes
Jun 15, 2026
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.
It is debatable if we need a new API version. I don't like it but it was agreed upon in the scope's chat because the change is not backwards compatible.
https://wearezeta.atlassian.net/browse/WPB-26291
Checklist
changelog.d