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
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -978,13 +978,23 @@ jobs:
account-service

- name: 🔎 Verify Account committed connect source readback proof
if: ${{ matrix.module == 'account-service' }}
if: ${{ !cancelled() && matrix.module == 'account-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#readsExactCommittedOriginalSourceAndLostResultWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#doesNotReturnWhenAccountFenceWaitOutlivesTheUnchangedGatewayDeadline()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#readsExpiredCommittedSourceOnlyThroughHistoricalEvidenceWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#historicalReadRejectsRequestTargetHashAndTokenIdentityMismatches()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#historicalReadRequiresCommittedSuccess()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#historicalReadRequiresRegisteredGatewayAndAccountSigningKeys()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#readsCommittedStoredFrameAndOriginalSourceAfterGatewayContextExpiryWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#storedHistoryRejectsChangedDigestSourceContextResultHashAndKey()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#correlatesExpiredOriginalFrameWithSeparateFreshCommittedSourceWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#correlationRejectsExpiredFreshContextAndReissuedContextForOriginalSource()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#correlationRequiresExactAccountTenantAndCompleteSelectedTarget()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#correlationRechecksFreshDeadlineAfterStoredFrameReadWait()' \
account-service

- name: Verify Account fresh tenant association PostgreSQL proof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The hosted Creator Party, terms catalog, acceptance/currentness evidence, and ch

The current credential-granting `Authenticate`, `RequestEmailLoginOtp`, and `VerifyEmailLoginOtp` gRPC handlers require the exact authenticated Game Session mTLS peer before credential or challenge work; the shared public-method list still bypasses bearer validation for these methods, so the peer guard is required and is not a JWT fallback. Legacy profile GET/PUT now require the exact Social Groups peer and a non-internal caller subject matching the requested account; presence-policy batch reads require the exact Social Groups peer and read only tenant-scoped profiles. The account-ID export, external-link, and verification gRPC handlers deny before data access or mutation because no authorized caller contract exists. Runtime membership, grant, and entitlement methods deny before Account reads until typed player/target binding is available; these local guards are not complete admission proof. `GetBalance`, `AddCurrency`, and `SpendCurrency` now return `FAILED_PRECONDITION` before balance access or mutation because virtual currency is a deferred substrate, not a supported v1 API.

Fresh-tenant identity adds no public Account endpoint or membership shortcut. The selected #2915 consumer uses Account's authenticated normal workload to read exact Game Design creation evidence, then commits an immutable canonical-UUID association and shared UUID conflict claim before using the existing no-reset tenant-generation initialization; it neither infers a retained numeric key nor admits a player. This local implementation is in progress, with no exact Account-consumer proof. In [CI run 36791561008](https://github.com/benhook1013/FireMUD/actions/runs/36791561008), the strict seven-case Game Design producer/readback database suite executed and all seven failed because the migrated test schema did not expose the expected relations; the proposed schema-selection correction has not been rerun. The Game Design wire and digest remain owned by its [API contract](../game-design-service/api-contracts.md#fresh-tenant-creation-operation-and-account-readback), and Account's local storage/readback consequence is described in [Runtime & Data](./runtime-and-data.md). The membership RPC remains denied.
Fresh-tenant identity adds no public Account endpoint or membership shortcut. The #2915 consumer uses Account's authenticated normal workload to read exact Game Design creation evidence, then commits an immutable canonical-UUID association and shared UUID conflict claim before using the existing no-reset tenant-generation initialization; it neither infers a retained numeric key nor admits a player. Exact #2915 head `910d0a6f41d60ee7214b610d56f89c51db260413` [CI 36796087279](https://github.com/benhook1013/FireMUD/actions/runs/36796087279) executed and passed all six Account fresh-association and seven Game Design creation PostgreSQL cases without skips, including retry, concurrency and rollback. This corrected component proof supersedes the earlier schema-fixture failure; it does not prove deployed workload identity, a live cross-owner handoff or activation. Detailed proof and remaining gates belong to [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md). The Game Design wire and digest remain owned by its [API contract](../game-design-service/api-contracts.md#fresh-tenant-creation-operation-and-account-readback), and Account's local storage/readback consequence is described in [Runtime & Data](./runtime-and-data.md). The membership RPC remains denied.

`CommitTenantCapacityAdmission` is target-only. Its canonical request contract requires the stable identity, expected complete applicable `authorityTuple`, separate expected `entitlementVersion`, exact expected billing stream/checkpoint evidence, capacity delta, and versioned `mutationDigest`, but no proto RPC, durable authority/usage ledger, caller integration, or reservation-finalization path is implemented. The target replay rule is exact identity-and-payload replay with any changed tuple, entitlement, checkpoint, delta, or digest producing an idempotency conflict; implementation and focused proof remain future capability work rather than a nonfunctional service seam.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ The `player-bootstrap` token profile is distinct from both `control-ui` and priv
- It establishes account identity for first-party gameplay bootstrap only. Target behavior is that public-game membership is created only by explicit `/auth/bootstrap/join`; character discovery, character creation, and `POST /auth/connect-token` later require that membership and recheck applicable grants, entitlements, and the discovery-selected runtime target. The current Account REST runtime requires existing caller-bound membership for character discovery and connect-token issuance and uses only `membershipExists`, `gameplayAdmissionAllowed`, `membershipVersion`, and `evaluatedAt`; world and realm discovery remain available before membership. Non-public REST realm discovery, character listing, and connect-token issuance fail closed even when a legacy four-field grant row exists, because it cannot prove the current lifecycle and state generation; public-production behavior remains unchanged. The separate Game Session text `PLAY` path is currently blocked earlier by Account runtime membership/grant/entitlement gRPC methods returning `FAILED_PRECONDITION` before reads, producing `AUTH_UNAVAILABLE`; its downstream membership outcomes require successful mocked Account responses. For a publicly visible public-production target whose joining policy permits entry, the Account connect-token issuance branch may return `JOIN_REQUIRED` without creating or restoring membership; the latter existing-membership case is not lifecycle-aware while explicit `JOIN` is a separate local action. The target lifecycle-qualified grant authority is not implemented.
- It is stored in memory only by first-party gameplay UIs and is accepted only on gameplay-bootstrap surfaces such as bootstrap discovery and `POST /auth/connect-token`.
- For first-party `/ws/game/**`, subsequent gameplay `LOGIN` must complete from the bootstrap/connect context already established for that socket; browser clients must not be required to replay account credentials after bootstrap.
- Account issues the private `game-session-account-delegation` JWT for bare first-party `LOGIN` only through the one-use, idempotent exchange defined in [Authentication and Authorization](../../system-architecture-authentication.md). Its own committed connect issuance and bootstrap subject, independently verified Gateway-signed context, exact Game Session mTLS identity, target binding, current authority, and issuance fence must all agree before issuance. The V37 storage candidate binds an exchange to a committed V35 connect operation and stores an immutable purpose-bound terminal envelope, but neither operation is wired to credential issuance or recovery. The current Redis-only connect replay/session records and Gateway context verifier configuration do not establish the complete proof, so no current bare-`LOGIN` exchange or live runtime-read authorization is claimed.
- Account issues the private `game-session-account-delegation` JWT for bare first-party `LOGIN` only through the one-use, idempotent exchange defined in [Authentication and Authorization](../../system-architecture-authentication.md). Its own committed connect issuance and bootstrap subject, independently verified Gateway-signed context, exact Game Session mTLS identity, target binding, current authority, and issuance fence must all agree before issuance. The V37 storage candidate binds an exchange to a committed V35 connect operation and stores an immutable purpose-bound terminal envelope, but neither operation is wired to credential issuance or recovery. The selected expired-context terminal-recovery contract is owned by [Authentication](../../system-architecture-authentication.md#terminal-bare-login-result-recovery-normative); it is unimplemented and unproved. The current Redis-only connect replay/session records and Gateway context verifier configuration do not establish the complete proof, so no current bare-`LOGIN` exchange or live runtime-read authorization is claimed.
- If the token is lost because the page/app process is restarted, the client must restart bootstrap from `POST /auth/player-bootstrap`; the current architecture does not define a hidden silent-bootstrap refresh mechanism.
- It is backed by one `session:auth:token:<tokenHash>` record so per-token logout and account-level revocation semantics remain consistent.
- `POST /auth/logout` and `POST /auth/logout-all` must accept this profile so first-party gameplay UIs can explicitly revoke bootstrap capability on sign-out rather than waiting for expiry.
Expand Down Expand Up @@ -243,6 +243,10 @@ Account owns one versioned, mounted-secret key ring and rotation procedure for b

The operation identity is claimed by a serializable transaction or equivalent Account-owned CAS: one matching digest wins, a concurrent matching request waits for and reads the same operation, and any changed digest returns `IDEMPOTENCY_CONFLICT` without minting or mutating. Account records the durable operation before exposing a result, accepts and reads back the required registry/admission postconditions before `COMMITTED`, and exact retries revalidate current authority and all applicable registry/admission postconditions before decrypting and returning a successful credential envelope. If that revalidation fails, the retry returns the applicable canonical denial and leaves the committed operation and envelope unchanged; it does not remint or replace the credential. A deterministic `FAILED` result, such as `JOIN_REQUIRED`, replays its stored failure envelope directly after the exact operation identity and digest match, without rerunning authority or membership checks, while that failure envelope remains retained. If the matching compact receipt remains after its response envelope has been removed at the declared response-recovery horizon, an exact digest match returns `RESPONSE_RECOVERY_EXPIRED`; a changed digest still returns `IDEMPOTENCY_CONFLICT`. That outcome is terminal for the original issuance attempt and callers must use a new `requestId` for a fresh authorized request. Missing, ambiguous, or unreconciled durable state fails closed; no retry reconstructs or silently remints a JWT. The response envelope must not be removed while the operation is pending, ambiguous, or otherwise blocked on reconciliation. This target persistence/CAS/readback path is unimplemented and must not be inferred from the current Redis map.

For the Authentication-owned [terminal bare-`LOGIN` result-recovery exception](../../system-architecture-authentication.md#terminal-bare-login-result-recovery-normative), Account retains the original signed Gateway context bytes encrypted with the exact original result under the existing `BARE_LOGIN_RESPONSE` purpose and unchanged operation binding. The operation row stores no raw JWT or context bytes. Its local `BareLoginRecoveryPayload` uses one closed versioned, byte-length-framed representation within the existing envelope plaintext bound; it preserves context and opaque result bytes without normalization and introduces no additional key purpose. Envelope reads must verify the exact committed operation, request/source/context evidence, purpose and key before decoding. The shared history-only Gateway evidence type is distinct from current authorization and never substitutes into a current-context API. Original result expiry and a separately declared recovery horizon remain mandatory Account checks; neither is inferred from `created_at` or extended. The complete fresh-proof, authority and postcondition requirements remain at Authentication's owner. The unwired Account source reader has separate strict-current and history-only methods: the latter checks an exact committed V35 source against the supplied signed historical Gateway assertion and returns immutable, non-authorizing evidence. It does not establish that V37 retained that assertion or that Gateway accepted it. The actual V37 producer does not yet persist the frame, and current-authority/registry/recovery composition and complete canonical-UUID request wiring remain open in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md). No fixed TTL, new public route or runtime enablement is selected.

The unwired `AccountStoredBareLoginRecoveryReader` reads an exact committed V37 operation and purpose-bound encrypted frame under the Account fence, verifies the opaque result hash and stored signed context against its exact committed V35 source, and returns only immutable, redacted provenance facts. Its separate correlation read first verifies a distinct strict-current committed connect source and signed Gateway context, then exact-compares the original and fresh canonical player, tenant and complete selected target, including conditional lifecycle/generation. A final unchanged strict-source read rechecks deadlines after historical work; original/fresh operation identities, requests, scope hashes and timestamps remain separate evidence rather than being rewritten. Stored historical Gateway expiry is the signed context's `expiresAt`, not the source token's potentially later `exp`. This is non-authorizing correspondence only: it does not return the context or result, establish past Gateway acceptance, verify the original result JWT/expiry or recovery horizon, compare the producer's complete context/authority/postcondition evidence, or authorize recovery. Detailed component proof and the remaining producer/composition gates are recorded in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md).

The target projection is physically isolated from the legacy map: `session:connect-token:v1:tenant:<tenantId>:account:<accountId>:scope:<scopeHash>:request:<requestHash>` is target-only, while the unversioned family remains legacy-only. Because the legacy writer has no issuance fence, cutover requires closing issuance for the full Account cohort, stopping legacy writers, draining in-flight requests, waiting the configured maximum legacy TTL/retry horizon, and verifying that no legacy writer remains before enabling target issuance. A mixed-version rollout is not permitted unless every writer first honors a shared owner fence. Legacy entries are retained read-only through the TTL/retry horizon, then Account performs owner cleanup from an exact inventory with readback; they are not migrated, promoted, or interpreted as target envelopes. Region/tenant reset preservation follows the reset matrix for both families; after a cluster/cold-start loss, exact durable target repair/readback is required and otherwise the handshake fails closed.

Under [ADR 0163](../../decisions/adr-0163-service-owned-retention-classes-with-cross-service-safety.md), the operation is an Account-owned **retry and idempotency receipt** class. `PENDING`, `ABORTED` with unresolved reconciliation, and any row with a live registry/admission/postcondition blocker are nonterminal and retained; `COMMITTED` and deterministic `FAILED` become eligible only after the complete supported client, producer, duplicate-delivery, reconnect, reset-recovery, and audit-read window ends. The minimum horizon is the greatest applicable connect-scope, response-envelope, client/internal retry, recovery, and legal/governance horizon, with no universal duration assumed. Account-owned bounded cleanup records holds and blocker reason, never deletes held or nonterminal rows, and removes the encrypted credential-bearing response envelope only after its declared response-recovery horizon while retaining the compact receipt through the deduplication horizon. A matching duplicate after envelope removal but before receipt expiry returns `RESPONSE_RECOVERY_EXPIRED`; exact digest comparison remains mandatory, changed input remains `IDEMPOTENCY_CONFLICT`, and no replacement credential is minted. A retained deterministic `FAILED` envelope continues to replay its exact failure; after that envelope is removed, the same recovery-expired outcome applies. Callers treat `RESPONSE_RECOVERY_EXPIRED` as terminal for the original issuance attempt and start a fresh authorized request under a new `requestId`. Cleanup never removes an envelope while the operation is pending, ambiguous, or blocked on unresolved reconciliation. Account exposes oldest-blocking-row and cleanup-lag metrics. Partition/drop or row deletion requires the same terminal, reference, hold, and safe-watermark checks as the shared retention contract.
Expand Down
Loading
Loading