Skip to content

ATS-PFM-SEC-005Join through an invitation: Capability Test Specification

Markdown

ATS-PFM-SEC-005

Join through an invitation: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleSecurity, Customers and WorkspacesRevision2

Read atservices-platform ad3f6a65react-console baf6dae3

Coverage

  • Rule covered
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure gap: FND-PFM-SEC-062
  • Boundary covered
  • Concurrency gap: FND-PFM-SEC-062
  • Invariant covered
  • Interaction covered

Test Scenarios

20 scenarios proving CAP-PFM-SEC-005; 12 bound to an existing test.

01 Check hashed storage and seven-day expiryinvariantapinegativetest
Proves
BR-CAP-PFM-SEC-005-01 INV-DOM-PFM-SEC-003-04
Preconditions
Prepare a new invitation.
Steps
Inspect storage, accept it and attempt an expired invitation.
Expected
Storage holds the token hash, expiry is seven days after issuance and expired acceptance fails; activation is not repeated.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/invite-user.spec.js#expires the invitation 7 days after the execution's clock, on the invitation and on the user
Source
services-platform:modules/security/tests/unit/services/invitations/invite-user.spec.js#expires the invitation 7 days after the execution's clock, on the invitation and on the user
02 Check the public invitation summaryruleapitest
Proves
BR-CAP-PFM-SEC-005-02
Preconditions
Prepare a usable invitation.
Steps
Fetch its summary without signing in.
Expected
Only the listed presentation fields are returned, with the address masked.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/invitation-summary.spec.js#answers the first name, a masked e-mail, the expiry, the organization and the kind of account, and nothing else
services-platform:modules/security/tests/integration/lifecycle/invitation/invitation-arc.integration.spec.js#names the organization by its name and never by its id, which is what the page shows the person
services-platform:modules/security/tests/unit/services/invitations/invitation-summary.spec.js#keeps the first letter of each side and the top-level domain of an ordinary address
Source
services-platform:modules/security/tests/unit/services/invitations/invitation-summary.spec.js#answers the first name, a masked e-mail, the expiry, the organization and the kind of account, and nothing else
03 Check unusable-link refusals and accepted-link replayedgeapinegativetest
Proves
BR-CAP-PFM-SEC-005-03 INV-DOM-PFM-SEC-003-04
Preconditions
Prepare malformed, unknown, expired, revoked, superseded and accepted links.
Steps
Read summaries and attempt acceptance for each; include accepted links with active and inactive memberships.
Expected
Unusable links share the backend refusal text and expose no organization detail; reason codes select the appropriate screen. An accepted link succeeds again for an active membership and is refused after that membership becomes inactive.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#answers a malformed and an unknown token identically, without auditing a user nobody has identified
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#answers an expired, a revoked and a superseded token with the same sentence, and records which it was
services-platform:modules/security/tests/unit/services/invitations/invitation-summary.spec.js#reads no customer at all for a token it refuses, so a refusal discloses nothing
services-platform:modules/security/tests/e2e/invitations.e2e.spec.js#refuses a malformed, an unknown, a revoked and a superseded token with one sentence and nothing more
react-console:lib/auth/__tests__/invitations.test.ts#gives each of the design's problem codes its own refusal, so each gets its own screen
Source
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#answers a malformed and an unknown token identically, without auditing a user nobody has identified
04 Check activation after password validationtransitionapitest
Proves
BR-CAP-PFM-SEC-005-04
Preconditions
Prepare an invited membership with a pending assignment.
Steps
Submit an unacceptable password, then an acceptable password.
Expected
The refused password leaves the token unspent; the successful request activates membership and pending roles in one transaction.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#sets the chosen password in Cognito, then accepts, activates and makes the pending roles real in one transaction
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#passes Cognito's refusal of the password through, and leaves the invitation unspent
services-platform:modules/security/tests/e2e/invitations.e2e.spec.js#accepts the e-mailed token with a password and makes the account active (the invite created the account before it sent the link)
Source
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#sets the chosen password in Cognito, then accepts, activates and makes the pending roles real in one transaction
05 Check acceptance replay leaves credentials untouchededgeapitest
Proves
BR-CAP-PFM-SEC-005-05
Preconditions
Prepare an accepted invitation whose membership remains active.
Steps
Submit the accepted link again.
Expected
The result says already accepted, membership stays active and no additional notice is sent.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#answers a reused token as the success it already was, without touching Cognito again
react-console:e2e/security/invitations.spec.ts#tells them their account is already set up if the spent link is opened again
Source
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#answers a reused token as the success it already was, without touching Cognito again
06 Check present inviter authority at acceptancepermissionapinegativetest
Proves
BR-CAP-PFM-SEC-005-06
Preconditions
Prepare an invitation and remove the inviter’s authority over its role.
Steps
Attempt acceptance, restore the authority and attempt again.
Expected
The first attempt refuses neutrally and records its reason without activation or token use; the restored-authority attempt succeeds.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/services/invitations/inviter-authority.integration.spec.js#refuses the acceptance once the administrator has lost the right, in the one sentence every bad link gets
services-platform:modules/security/tests/integration/services/invitations/inviter-authority.integration.spec.js#activates nothing and spends no token, so the link still works if the authority comes back
services-platform:modules/security/tests/integration/services/invitations/inviter-authority.integration.spec.js#records the real reason in the trail, which the person pressing the button is not told
Source
services-platform:modules/security/tests/integration/services/invitations/inviter-authority.integration.spec.js#refuses the acceptance once the administrator has lost the right, in the one sentence every bad link gets
07 Check Google acceptance identity and replay protectionvalidationapinegativetest
Proves
BR-CAP-PFM-SEC-005-07
Preconditions
Prepare an invited person and Google-link session.
Steps
Complete with another user’s bearer token, complete with the correct token and replay completion.
Expected
The wrong identity and replay fail; the correct identity activates once.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/unit/services/invitations/google-acceptance.spec.js#proves the invitation by its token, writes a link session as the invited person and answers its nonce as the state
services-platform:modules/security/tests/unit/services/invitations/google-acceptance.spec.js#refuses a bearer token of another Cognito user, or one the pool does not verify (the nonce alone proves nothing)
services-platform:modules/security/tests/e2e/invitations.e2e.spec.js#begins with the token, refuses the completion of another Cognito user, completes once for the right one and refuses a replay
Source
services-platform:modules/security/tests/unit/services/invitations/google-acceptance.spec.js#proves the invitation by its token, writes a link session as the invited person and answers its nonce as the state
08 Check ordinary Google users cannot bypass invitationboundaryunitnegativeproposed
Proves
BR-CAP-PFM-SEC-005-08
Preconditions
Prepare a password account and an unknown person, neither eligible for founding-staff linking nor holding an acceptance session.
Steps
Attempt Google sign-in for each.
Expected
The sign-up trigger refuses account creation for both without revealing whether a membership exists.
Data
Use the records described in the setup.
Source
services-platform:modules/security/services/provisioning/pre-sign-up.ts:authorizeSignUp
09 Check public self-registration is unavailableboundarybrowsernegativetest
Proves
BR-CAP-PFM-SEC-005-09
Preconditions
Use the deployed console and its sign-in pool.
Steps
Inspect sign-in links, request retired sign-up pages and attempt pool registration.
Expected
No registration link exists, retired pages return 404 and pool registration is denied.
Data
Use the records described in the setup.
Bound to
react-console:e2e/dev/sign-in.dev.spec.ts#offers no sign-up link, and the retired routes answer 404
react-console:e2e/dev/sign-in.dev.spec.ts#refuses Cognito's own SignUp on the console client
Source
react-console:e2e/dev/sign-in.dev.spec.ts#offers no sign-up link, and the retired routes answer 404
10 Check acceptance in another user’s browser sessionboundarybrowsernegativetest
Proves
BR-CAP-PFM-SEC-005-10
Preconditions
Sign in as an administrator and prepare an invitation for someone else.
Steps
Open the invitation in that browser.
Expected
The page blocks acceptance and offers to sign out the current user.
Data
Use the records described in the setup.
Bound to
react-console:e2e/dev/invitations.dev.spec.ts#refuses to accept an invitation while somebody else's console is on the screen
react-console:lib/auth/__tests__/invitation-flow.test.ts#refuses to accept while another account is on screen, and offers to sign out
Source
react-console:e2e/dev/invitations.dev.spec.ts#refuses to accept an invitation while somebody else's console is on the screen
11 Check acceptance audit identity and secret exclusioninvariantapinegativetest
Proves
BR-CAP-PFM-SEC-005-11
Preconditions
Prepare a complete invitation lifecycle.
Steps
Inspect recorded events and captured log output.
Expected
Successful acceptance uses the joining person as actor; recorded material contains no raw token, token hash or password.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/lifecycle/invitation/invitation-arc.integration.spec.js#carries neither the raw token nor its hash anywhere in what it recorded
Source
services-platform:modules/security/tests/integration/lifecycle/invitation/invitation-arc.integration.spec.js#records the person themselves as the actor of their own acceptance
12 Check reinvitation retains membership and pool identitytransitionapitest
Proves
BR-CAP-PFM-SEC-005-12
Preconditions
Prepare a revoked member.
Steps
Invite the person again and accept that invitation.
Expected
The existing membership and pool account become enabled and active.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/lifecycle/invitation/invitation-arc.integration.spec.js#leaves the pool account enabled and the person active, so they can sign in
Source
services-platform:modules/security/tests/integration/lifecycle/invitation/invitation-arc.integration.spec.js#is invited back on the same row
13 Check invitation acceptance and console arrivalinteractionbrowsertest
Proves
AS-JNY-PFM-SEC-002-01 AS-JNY-PFM-SEC-002-02
Preconditions
Send an invitation through the Security screens.
Steps
Set a password through acceptance and sign in.
Expected
The new member reaches the console and no longer appears in the Invited filter.
Data
Use the records described in the setup.
Bound to
react-console:e2e/security/invitations.spec.ts#lets them set a password and sign in, and clears them off the Invited filter
react-console:e2e/dev/invitations.dev.spec.ts#shows who invited them, then sets their password and opens the console
Source
react-console:e2e/security/invitations.spec.ts#lets them set a password and sign in, and clears them off the Invited filter
14 Membership status: invited to activetransitionapiproposed
Proves
BR-CAP-PFM-SEC-005-04
Preconditions
Use an isolated membership status in invited state, with the required authority and guard fixtures.
Steps
[ { "do": "Accept with a valid password; repeat in a separate fixture through Google linking.", "expect": "Read the resulting membership status as active; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/invitations/accept-invitation.ts", "services-platform at ad3f6a65: modules/security/db/users.table.ts; services/invitations/accept-invitation.ts, activate-user.ts, invite-user.ts, revoke-user.ts, suspend-user.ts, resend-invitation.ts, user-deletion.ts; services/membership/lockout.ts, last-administrator.ts." ] } ]
Expected
Read the resulting membership status as active; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/invitations/accept-invitation.ts,services-platform at ad3f6a65: modules/security/db/users.table.ts; services/invitations/accept-invitation.ts, activate-user.ts, invite-user.ts, revoke-user.ts, suspend-user.ts, resend-invitation.ts, user-deletion.ts; services/membership/lockout.ts, last-administrator.ts.
15 Invitation: live to acceptedtransitionapiproposed
Proves
BR-CAP-PFM-SEC-005-04
Preconditions
Use an isolated invitation in live state, with the required authority and guard fixtures.
Steps
[ { "do": "Accept the usable invitation and inspect membership and assignment activation together.", "expect": "Read the resulting invitation as accepted; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/persistence/invitations.ts:acceptInvitation", "services-platform at ad3f6a65: modules/security/db/user-invitations.table.ts; services/persistence/invitations.ts; services/invitations/invitation-lifetime.ts, resend-invitation.ts, accept-invitation.ts; services/provisioning/provision-user.ts." ] } ]
Expected
Read the resulting invitation as accepted; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/persistence/invitations.ts:acceptInvitation,services-platform at ad3f6a65: modules/security/db/user-invitations.table.ts; services/persistence/invitations.ts; services/invitations/invitation-lifetime.ts, resend-invitation.ts, accept-invitation.ts; services/provisioning/provision-user.ts.
16 Invitation: live to expiredtransitionapiproposed
Proves
BR-CAP-PFM-SEC-005-01
Preconditions
Use an isolated invitation in live state, with the required authority and guard fixtures.
Steps
[ { "do": "Advance a controllable clock to the seven-day deadline and attempt acceptance.", "expect": "Read the resulting invitation as expired; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/invitations/invitation-lifetime.ts", "services-platform at ad3f6a65: modules/security/db/user-invitations.table.ts; services/persistence/invitations.ts; services/invitations/invitation-lifetime.ts, resend-invitation.ts, accept-invitation.ts; services/provisioning/provision-user.ts." ] } ]
Expected
Read the resulting invitation as expired; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/invitations/invitation-lifetime.ts,services-platform at ad3f6a65: modules/security/db/user-invitations.table.ts; services/persistence/invitations.ts; services/invitations/invitation-lifetime.ts, resend-invitation.ts, accept-invitation.ts; services/provisioning/provision-user.ts.
17 Role assignment: pending to livetransitionapiproposed
Proves
BR-CAP-PFM-SEC-005-04
Preconditions
Use an isolated role assignment in pending state, with the required authority and guard fixtures.
Steps
[ { "do": "Accept an invitation offering a current-window role and inspect effective access.", "expect": "Read the resulting role assignment as live; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/persistence/assignments.ts:activatePendingAssignments", "services-platform at ad3f6a65: modules/security/db/security-assignments.table.ts; services/persistence/assignments.ts; services/membership/manage-assignments.ts; services/invitations/widening.ts." ] } ]
Expected
Read the resulting role assignment as live; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/persistence/assignments.ts:activatePendingAssignments,services-platform at ad3f6a65: modules/security/db/security-assignments.table.ts; services/persistence/assignments.ts; services/membership/manage-assignments.ts; services/invitations/widening.ts.
18 Role assignment: pending to scheduledtransitionapiproposed
Proves
BR-CAP-PFM-SEC-010-05
Preconditions
Use an isolated role assignment in pending state, with the required authority and guard fixtures.
Steps
[ { "do": "Accept an invitation offering a role that begins tomorrow and inspect current access.", "expect": "Read the resulting role assignment as scheduled; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/persistence/assignments.ts:activatePendingAssignments", "services-platform at ad3f6a65: modules/security/db/security-assignments.table.ts; services/persistence/assignments.ts; services/membership/manage-assignments.ts; services/invitations/widening.ts." ] } ]
Expected
Read the resulting role assignment as scheduled; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/persistence/assignments.ts:activatePendingAssignments,services-platform at ad3f6a65: modules/security/db/security-assignments.table.ts; services/persistence/assignments.ts; services/membership/manage-assignments.ts; services/invitations/widening.ts.
19 Join through an invitation with use and recover a console sign-ininteractionapiproposed
Proves
BR-CAP-PFM-SEC-005-04 BR-CAP-PFM-SEC-006-02
Preconditions
An invited person has no console session.
Steps
Accept the invitation with a valid password and sign in to the protected destination.
Expected
The active account reaches the destination through a new session without another acceptance write.
Data
An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
Source
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#sets the chosen password in Cognito, then accepts, activates and makes the pending roles real in one transaction,react-console:e2e/dev/session.dev.spec.ts#sends a signed-out visitor to the login screen and back to the page they wanted
20 Join through an invitation with assign roles within a controlled scopeinteractionapiproposed
Proves
BR-CAP-PFM-SEC-005-04 BR-CAP-PFM-SEC-010-05
Preconditions
An invitation offers one current and one future role assignment.
Steps
Accept the invitation and inspect the assignments and current effective permission explanation.
Expected
The current assignment is effective; the future assignment stays scheduled and supplies no current permission.
Data
An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
Source
services-platform:modules/security/tests/unit/services/invitations/accept-invitation.spec.js#sets the chosen password in Cognito, then accepts, activates and makes the pending roles real in one transaction,services-platform:modules/security/tests/e2e/console-users.e2e.spec.js#answers a grant whose window opens tomorrow as scheduled, in the grant and in the list

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.