Consume partner invitations once under concurrent acceptance
Two acceptance requests use the same invitation token at nearly the same time. The portal creates duplicate memberships and occasionally accepts a token after its role was revoked.
- Focused work estimate
- 3h 30m + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Single-use tokens · Atomic authorization · Identity binding
Estimated field mix
- Security50%
- Database engineering30%
- Backend20%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional manufacturing company shares purchase-order documents with partner organizations. Buyers, partner administrators, and read-only agents use the same API. Recent support reports suggest list filters and background downloads disagree about who may see an order.
Setup prerequisites
- HTTP APIs
- Session authentication
- Tenant-scoped data access
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Bind an invitation to partner, intended recipient, role, expiry, and current invitation state.
- Consume it and create membership in one transaction.
- Concurrent acceptance yields one membership with a documented replay or conflict response.
Implementation constraints
- Persist token hashes only; synthetic invitation secrets must not enter logs.
Verification to include
- Accept a valid invitation once and inspect its membership.
- Race acceptance and try expired, revoked, and wrong-recipient tokens; assert denial or one winner.
Deliverables
- Invitation consumption command and concurrency cases
Rollout and recovery
Issue the new token format for future synthetic invitations; retain a documented expiry window for legacy links.
Value of the work
For the engineer: Practice authorization as a service-level invariant, including revocation timing, concurrent membership changes, and asynchronous data delivery.
For the team: Inspect a concrete record of cross-organization denial, least-privilege decisions, and access-recovery behavior using fictional partner records.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.