Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,7 @@ jobs:
--require-suite crossservice.net.firedevops.firemud.gamesession.AccountMembershipAuthorityGrpcPostgresMtlsCrossServiceTest \
--require-case 'crossservice.net.firedevops.firemud.gamesession.AccountMembershipAuthorityGrpcPostgresMtlsCrossServiceTest#realMembershipSnapshotAndSequenceZeroBaselineCrossPostgresAndAuthenticatedSocket()' \
--require-case 'crossservice.net.firedevops.firemud.gamesession.AccountMembershipAuthorityGrpcPostgresMtlsCrossServiceTest#retainedInactiveLeftAndReactivationSnapshotsCrossPostgresAndAuthenticatedSocket()' \
--require-case 'crossservice.net.firedevops.firemud.gamesession.AccountMembershipAuthorityGrpcPostgresMtlsCrossServiceTest#committedFreshUuidCanonicalJoinSnapshotRoundTripsThroughGameSessionClientOverPostgresMtls()' \
game-session-service

- name: Upload Account membership PostgreSQL readback socket mTLS proof results
Expand Down Expand Up @@ -1811,6 +1812,13 @@ jobs:
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#eventReadbackRejectsStalePendingDtoAfterJournalHasTerminalized()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#absentOrContradictoryOwnerEvidenceRemainsPendingWithoutReconciliationSideEffects()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#concurrentExactTerminalRetryAndReconcilerRetainOneHistoricalWriteSet()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#committedFreshUuidJoinReturnsExactPositiveSnapshotAndCaptureWithoutChangingSources()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#existingOnlyFreshUuidReadPreservesProvedAbsenceAndPendingOperation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#pendingCanonicalJoinCannotAuthorizePositiveReadbackOrCauseMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#freshUuidReadRejectsContradictoryReceiptEventRolesPairAndAuditWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#existingOnlyFreshUuidReadRejectsWrongAccountAndTenantSources()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#committedFreshUuidJoinRoundTripsExactSnapshotOverPhysicalMtls()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCanonicalJoinReconciliationIntegrationTest#physicalMembershipTransportRejectsWrongPeersBeforeProducerAccess()' \
account-service

- name: Upload Account canonical JOIN scope and intent PostgreSQL proof results
Expand Down Expand Up @@ -2057,6 +2065,40 @@ jobs:
fi
echo "::endgroup::"

- name: Capture Account retained tenant-role PostgreSQL raw proof
if: ${{ always() && matrix.module == 'account-service' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: account-retained-tenant-role-postgresql-proof-${{ github.sha }}-${{ github.run_attempt }}
path: |
services/account-service/build/test-results/integrationTest/TEST-*AccountJoinPostgresIntegrationTest.xml
services/account-service/build/test-results/integrationTest/TEST-*AccountTenantRoleOperationRepositoryPostgresIntegrationTest.xml
if-no-files-found: error
retention-days: 7

- name: Verify Account retained tenant-role PostgreSQL proof cases
if: ${{ !cancelled() && matrix.module == 'account-service' }}
run: |
# These prove the unwired writer against stipulated retained owner state, not actor authentication.
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.repository.AccountTenantRoleOperationRepositoryPostgresIntegrationTest \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationDeniesNonAdminWithoutChangingAnyAccountSource()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRejectsStaleMembershipWithoutChangingAnyAccountSource()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRejectsMissingCurrentMembershipWithoutCreatingEvidence()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationCommitsGrantRevokeTransferAndReplaysOriginalGrantAfterLaterChange()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRollsBackAllSourcesWhenEventAppendFailsAfterWriting()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRollsBackAllSourcesWhenAuditAppendFailsAfterWriting()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRollsBackAllSourcesWhenFinalCurrentReadbackFails()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRejectsWrongTenantWithoutChangingAnyAccountSource()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#tenantRoleMutationRejectsNonExplicitMembershipWithoutChangingAnyAccountSource()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#invalidatingTenantRoleMutationDeniesFenceOverflowWithoutChangingAnyAccountSource()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#concurrentOpposingTenantAdminTransfersLeaveOneCurrentAdministrator()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountTenantRoleOperationRepositoryPostgresIntegrationTest#immutableJournalRetriesOriginalBytesAfterLaterRoleOperationAndRejectsChangedIntent()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountTenantRoleOperationRepositoryPostgresIntegrationTest#operationJournalAndMemberEvidenceRollBackTogether()' \
account-service

- name: Verify Account tenant-generation source PostgreSQL proof cases
if: ${{ !cancelled() && matrix.module == 'account-service' }}
run: |
Expand Down
14 changes: 14 additions & 0 deletions design/architecture/microservices/account-service/api-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ The initial `platformAdmin` is established only by a separate one-time protected

Role mutation remains target-only: no route, RPC, published action-family schema, or current runtime writer is selected here. Before enablement, Account must own the source mutation, an independent positive role-source version, immutable event/audit evidence, and exact same-snapshot authorization readback. The role-source version is distinct from Account authority generations, issuance fences, event-stream checkpoints, and other source versions. Exact event fields, mutation identity/digest grammar, bootstrap artifact, retained-account enrollment, and retry/recovery protocol remain open owner-contract work under [ADR 0185](../../decisions/adr-0185-account-owned-global-role-administration-and-bootstrap.md).

### Account-Owned Tenant Role Administration

Account is the sole authority for current tenant-role assignments. The accepted policy permits a current `tenantAdmin` to grant or revoke only `designer` for an explicitly identified canonical Account UUID in the same verified tenant. It does not authorize generic delegation or `tenantAdmin` management of `player`, `moderator`, or other tenant roles. The mutation actor and target are canonical Account identities, and `tenantId` is explicit; the UI's selected tenant and any global role, billing owner, payment instrument, or Game Design service identity is not authority for this operation.

The verified initiator of an exact owner-issued tenant-creation operation receives the first `tenantAdmin` assignment through a distinct Account-owned membership bootstrap, not through public `JOIN`. Account may perform this bootstrap only after authenticated Game Design creation evidence binds the committed tenant identity and exact creation source to the initiator's canonical Account UUID and authorization, and a same-fence Account readback proves the exact pair has no membership row, no committed membership event, and no contradictory retained history. The bootstrap's first Account membership-stream event is sequence `1` and records an `ACTIVE` control-only membership with exactly the `tenantAdmin` role, no `player`, and `gameplayAdmissionAllowed=false`. Account advances `membershipVersion` once from the actual current positive pair baseline; it never synthesizes or resets retained state. If source readback finds prior positive event history, ambiguous creator provenance, or contradictory retained state, Account preserves that state and denies bootstrap rather than renumbering it. A later actual explicit public `JOIN` may add `player` and enable gameplay admission only from this exact current creator state and only after the ordinary fresh JOIN gates pass; it consumes the next stream sequence (`2` for this newly bootstrapped pair). The creation operation itself, `PLAY`, and selector state never imply that later JOIN. Account must not infer the initiator from an Account-to-tenant identity association, numeric key, selector, UI state, billing/payment ownership, or `platformAdmin` authority. Retained or otherwise unproven role rows are not backfilled or admitted by this policy.

A tenant-admin transfer is one atomic Account mutation from an existing same-tenant `tenantAdmin` to an explicit Account target in that tenant. Its commit predicate must preserve at least one current `tenantAdmin`; separate revoke and grant operations cannot be composed into a transfer or leave the tenant without an administrator.

For each committed role or creator-bootstrap change, Account revalidates the exact actor, target, tenant, operation kind, and expected current source state at the owner commit. The stable operation/request identity and mutation digest bind those values, including the exact source-bound creation operation for bootstrap. An atomic administrator transfer updates both affected memberships under their existing current source states and appends each matching membership event/checkpoint in the same owner transaction. Each affected membership advances its independent `membershipVersion` once from its actual current positive baseline and appends evidence under the existing [membership evidence contract](../../system-architecture-authentication.md#membership-event-continuity). The commit's authoritative role and authority readback binds the complete applicable `authorityTuple`, `issuanceFence`, membership version, event, and checkpoint to one Account snapshot. `membershipAuthorityGeneration` advances independently for each affected membership only when the committed change records `callerBoundAuthorityInvalidated=true`; a role grant does not imply a universal generation bump.

An exact retry may return only the immutable result of the original operation after its identity, digest, expected source, and committed owner readback match. It does not reauthorize a new mutation or create reusable authority. Changed actor, target, tenant, operation kind, or expected source conflicts; stale or contradictory source state and unavailable or incomplete authorization/readback fail closed. Concrete route, request, and event details proceed under this approved authority boundary and must be specified and proved before mutation is enabled; this contract adds no public Account route or wire encoding.

### Account-Owned Hosted Terms and Creator Party

Account is the sole target authority for the identified hosted Creator Party, operator/legal-party and terms-version catalog, and acceptance/currentness evidence under [ADR 0180](../../decisions/adr-0180-account-owned-hosted-terms-acceptance-gate.md). Acceptance is an explicit party-level decision for an identified operator and hosted-terms scope; tenant roles, billing ownership, payment, caller-supplied fields, or a copied Game Design flag do not establish party, signer, or acceptance authority. Organization and other unsupported party/signer paths remain disabled until their target contract is implemented and reviewed.
Expand Down Expand Up @@ -64,6 +76,8 @@ This target contract is not complete in the current service. The existing `secur

## Implementation Status

Authenticated tenant-role mutation and creator bootstrap remain unavailable; no role-mutation route or RPC is enabled. The unwired existing-member storage candidate does not authenticate its actor or provide the complete Account authorization-evidence bundle. Its journal and digest consequences are owned by [Runtime & Data](./runtime-and-data.md#tenant-role-mutation-storage-candidate); source, implementation, and proof gaps are recorded in the [Player Access and Session tracker](../../../project-management/implementation-tracking/player-access-and-session.md#current-status).

`ProfileDto.accountId` and the explicit profile-update Account selector carry the proved canonical Account UUID, never the private Account row key; REST body/path mismatch is rejected. Profile's own `id` and the current numeric tenant selector remain distinct. This correction does not complete tenant-qualified/delegated routes or Social Groups' numeric callers; current proof and activation limits are recorded in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md).

The local `/auth/bootstrap/join` controller and operation are implemented, but the Gateway route guard blocks external exposure and the route is absent from `publicOpenAPI`; first-party `Join & Play` remains unavailable. Local policy-digest revalidation does not prove the exact target remains valid through Account commit, so the strict ADR 0025 commit gate remains incomplete. The bounded JOIN worker is readback-only: only exact positive operation, scope, membership, role, transition receipt, authority event, and version-1 `COMMITTED` audit receipt/projection evidence can terminalize; absent, minimized, unsupported, or uncertain evidence remains pending, and expiry/attempt limits never resubmit or terminalize. See [Runtime & Data](./runtime-and-data.md#current-join-readback-behavior) for the owner-local details.
Expand Down
Loading
Loading