[PM-39815] feat: Surface org name on invite-link status when links unavailable#7928
[PM-39815] feat: Surface org name on invite-link status when links unavailable#7928r-tome wants to merge 1 commit into
Conversation
…available Convert the UseInviteLinks=false case on the invite-link status endpoint from a 400 InviteLinkNotAvailable error into a 200 success carrying the org name and a new LinksEnabled flag, so the client can show an org-specific message. Also expose OrganizationId on the status and validate-email-domain responses.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the change converting the anonymous Code Review DetailsNo blocking findings. Notes considered and cleared during review:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7928 +/- ##
=======================================
Coverage 61.33% 61.33%
=======================================
Files 2242 2243 +1
Lines 98630 98645 +15
Branches 8911 8911
=======================================
+ Hits 60490 60506 +16
+ Misses 36004 36003 -1
Partials 2136 2136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
Resolves PM-39815
📔 Objective
The anonymous
POST /organizations/invite-link/statusendpoint (GetOrganizationInviteLinkStatusQuery) previously returned400 InviteLinkNotAvailablewhenorganization.UseInviteLinksis false. Because the v2 error pipeline only serializesErrorResponseModel.Message, the client couldn't display the organization's name in that case.This change:
UseInviteLinks == falsecase into a success200 OKcarryingOrganizationName, a newLinksEnabled: falseflag, andSeatsAvailable: false, so the client can render an org-specific message.OrganizationIdto the invite-link status and validate-email-domain responses ("expose orgId across the board"). The CRUD (OrganizationInviteLinkResponseModel) and policies (PolicyResponseModel) responses already exposed it.IGetOrganizationInviteLinkStatusQueryXML doc to match the new contract.Intentional divergence (re: keeping status/accept returns aligned):
statusnow representsUseInviteLinks == falseas a success (linksEnabled: false), while the authenticatedacceptendpoint continues to returnInviteLinkNotAvailable(400) for the same condition. This is deliberate —statusis a pre-flight read used to render a message, whereasacceptis a guarded mutation that must reject. The shared error records/messages otherwise remain aligned.Tests
AcceptOrganizationInviteLinkCommandTestsconfirm the accept endpoint's behavior is unchanged.