[PM-39815] feat: Surface org name on invite-link status when links unavailable#7928
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 findings. Notes considered 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.57% +0.24%
==========================================
Files 2242 2256 +14
Lines 98630 99397 +767
Branches 8911 8984 +73
==========================================
+ Hits 60490 61200 +710
- Misses 36004 36045 +41
- Partials 2136 2152 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jrmccannon
left a comment
There was a problem hiding this comment.
This makes sense to me. Returning a 200 on the status endpoint works with the addition of the links enabled property. 👍
…-email-domain responses OrganizationId is now part of the invite link URL and sent by the client on every request, so returning it in the response is redundant.
…ail integration test
JaredSnider-Bitwarden
left a comment
There was a problem hiding this comment.
src/Api/AdminConsole/Models/Response/Organizations/OrganizationInviteLinkStatusResponseModel.cs LGTM!
#21820) Mirrors the server's new LinksEnabled flag (bitwarden/server#7928) so the client can distinguish an org with invite links disabled from one with no seats available, both surfaced as a success response rather than an error.
🎟️ Tracking
Resolves PM-39815
Clients PR: bitwarden/clients#21820
📔 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.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.