Repository navigation
[PM-45362] Store the SCIM userName as ExternalName - #8943
sven-bitwarden wants to merge 1 commit into
Conversation
SCIM discarded the submitted userName and returned the member's email instead, so identity providers that send a userName different from the email (Entra sends the UPN) could never find the member again. - Create stores userName as ExternalName on all three paths (staged, invite, and the vNext invite command), and returns 409 when another member already has that userName. - PATCH replaces it by path or value object. It returns 400 for an empty, blank or over-300-character userName, and 409 for a duplicate. - GET returns ExternalName, falling back to the email for members provisioned before it was stored, and `userName eq` filters on the same value, ignoring case.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR stores the SCIM |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ac/pm-45362/add-external-name-column #8943 +/- ##
========================================================================
- Coverage 75.12% 68.84% -6.28%
========================================================================
Files 2756 2757 +1
Lines 118250 118297 +47
Branches 10863 10870 +7
========================================================================
- Hits 88830 81445 -7385
- Misses 26755 34299 +7544
+ Partials 2665 2553 -112 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
PM-45362
Part 2 of 2, stacked on the column PR (base branch
ac/pm-45362/add-external-name-column). Together they replace #8901.📔 Objective
SCIM discarded the submitted
userNameand returned the member's email in its place, so identity providers whoseuserNamediffers from the email (Entra sends the UPN) could never find the member again: Finding A from the Entra validation report. This stores it inOrganizationUser.ExternalName.userNameasExternalNameon all three create paths (staged, invite, and the vNext invite command), and returns 409 when another member already has thatuserName.userNameby path or by value object. It returns 400 for an empty, blank or over-300-character value (userNameis required by RFC 7643, and saving NULL keeps the stored value), and 409 for a duplicate.userNameisExternalName, falling back to the email for members provisioned before it was stored, andfilter=userName eq "x"matches the same value, ignoring case. One helper (OrganizationUserUserDetailsExtensions) defines it for the response, the filter and the duplicate checks.active, as before.Members provisioned before this change keep answering to their email, and identity providers that send their email as
userNamesee no difference.Tests: unit tests for create, PATCH (including the 300/301-character limits) and the filter, plus an integration test that creates a member whose
userNamediffers from their email on each create path, then finds them byuserName.🤖 AI-assisted review
Standard local review (
code-review-local), diffed against the column branch: approved, no findings.