Server: authenticated join-by-code is structurally unusable — /code lookup omits id, accept requires it #234
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit#234
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while making the iOS suite honest (#233, dual-pass review finding).
The gap: the join flow for users who enter a short code is:
GET /api/invitations/code/{code}(INV-06, PII-free preview) returns{tenant_name, role, short_code, expires_at}— no invitationid(deliberate: GetInvitationByToken.cs comment).POST /api/invitations/{id:guid}/accept(AcceptInvitation.cs) requires the GUID id.So a short-code user can look up a preview but can never accept: the client cannot know the id. The iOS client now fails loudly (clear error, no garbage URL — JoinTenantViewModel guard) instead of hitting a malformed route, but the flow itself has no server-side path.
Also affected:
AuthRepositoryImpl.acceptInvitationAsExistingUserposts/invitations/token/{token}/accept— no such server route exists (server has/{id:guid}/acceptand/token/{token}/accept-with-wallet). Same contract-drift class.Possible resolutions (server-side decision needed):
/code/{code}when the caller is authenticated (id is not PII for an already-authed member), orPOST /api/invitations/code/{code}/accept(server resolves code → id internally, taking the token proof from the body like AcceptInvitation already does), or/token/{token}/accept-with-walletpattern) after registration.Related drift of the same class (separate ticket-worthy):
GET /api/invitations+/sentresponse envelopes (itemspaged shape, missingtenant_name) vsReceivedInvitationsResponse/SentInvitationsResponseclient models — the received-list decode would fail against the real server today.Relates to #233, #223.
RESOLVED via PR #238 (merged
ef58f83) — authenticated join-by-code works end-to-end.POST /api/invitations/code/{code}/accept(authenticated, "auth" rate-limit partition) delegating to InvitationAcceptanceService withtoken: code— the service's existing ShortCode matching. 7 integration tests (targeted email-match accept, open-invite accept, wrong-email 403, already-member 409, expired 410, unknown 404, unauthenticated 401, Guid-as-code 404 non-interference).dotnet testrunner has a broken testhost cache).Follow-up #236 remains open (dual-signature blob order + /invitations list envelope drift — same contract-drift class, separate work).