Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ce9a9fe
feat(account): stage atomic bare-login exchange storage
benhook1013 Sep 27, 2026
bcdf800
Merge updated membership snapshot parent into bare-login storage
benhook1013 Sep 27, 2026
b11764f
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 27, 2026
a3f9319
Fail closed bare first-party login and require Account database proof
benhook1013 Sep 27, 2026
2562621
Make strict JUnit contract leak assertions ShellCheck-safe
benhook1013 Sep 27, 2026
e0a09df
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 27, 2026
aa5d73c
Record bare LOGIN proof and CI activation gap
benhook1013 Sep 27, 2026
81955a0
Prove first-party bare LOGIN denial before gameplay admission
benhook1013 Sep 27, 2026
46887e6
Merge corrected membership snapshot into bare LOGIN child
benhook1013 Sep 27, 2026
e39c31b
Record composed bare LOGIN proof and remaining activation gate
benhook1013 Sep 27, 2026
93bc4a4
Prove concurrent bare LOGIN exchange first writer
benhook1013 Sep 27, 2026
3272a1f
Prove stored bare LOGIN envelope recovery across retry
benhook1013 Sep 27, 2026
d4cc665
fix(game-session): clear stale subject on failed bare login
benhook1013 Sep 29, 2026
5c67ca4
Merge membership snapshot parent into bare login child
benhook1013 Sep 29, 2026
2ebe150
Merge corrected membership snapshot parent into bare LOGIN child
benhook1013 Sep 29, 2026
9c21470
test(game-session): prove bare first-party login stays denied
benhook1013 Sep 29, 2026
8399ddb
docs(auth): state bare LOGIN fail-closed proof accurately
benhook1013 Sep 30, 2026
e13c59f
Merge commit '48680d89f1298867c9f5b7653d1781aeb0aa8dbc' into codex/un…
benhook1013 Sep 30, 2026
982ebca
Merge commit 'ebffef6d8' into codex/unit-1b-bare-login-exchange
benhook1013 Sep 30, 2026
61ca37f
test(auth): align WebSocket login expectations with guarded path
benhook1013 Sep 30, 2026
2f66c9d
Merge commit 'a9a7c0dc1' into codex/unit-1b-bare-login-exchange
benhook1013 Sep 30, 2026
c6fa3ea
Require executed Script Pin PostgreSQL retry proof in CI
benhook1013 Sep 30, 2026
1f0577b
Require executed connect issuance recovery proof in Account CI
benhook1013 Sep 30, 2026
7ff97cd
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 30, 2026
29e96ef
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 30, 2026
0d2a965
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 30, 2026
b2a2f31
Merge branch 'codex/unit-1b-membership-snapshot' into codex/unit-1b-b…
benhook1013 Sep 30, 2026
dd170e7
Propagate Account counter-exhaustion proof into bare LOGIN storage
benhook1013 Sep 30, 2026
8a037e4
Propagate complete snapshot and first-JOIN race proof
benhook1013 Sep 30, 2026
5937097
Propagate corrected Account proof fixtures into bare LOGIN storage
benhook1013 Sep 30, 2026
1d4a42c
Merge commit 'ddd1bb7de' into codex/unit-1b-bare-login-exchange
benhook1013 Sep 30, 2026
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
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ jobs:
bash ./dev-tools/tests/secret-compliance-contract.sh
bash ./dev-tools/tests/ensure-local-compose-env-contract.sh
bash ./dev-tools/tests/smoke-image-env-contract.sh
bash ./dev-tools/tests/gradle-proof-tooling-contract.sh
bash ./dev-tools/tests/minio-pr-smoke-bootstrap-contract.sh
bash ./dev-tools/tests/architecture-doc-contracts.sh
bash ./dev-tools/tests/lint-yaml-contract.sh
Expand Down Expand Up @@ -942,9 +943,37 @@ jobs:
id: checks
run: |
echo "::group::Run Module Validation"
./gradlew :${{ matrix.module }}:check -PfullCheck
if [[ "${{ matrix.module }}" == "account-service" || "${{ matrix.module }}" == "game-session-service" ]]; then
./gradlew :${{ matrix.module }}:check -PfullCheck --no-build-cache
else
./gradlew :${{ matrix.module }}:check -PfullCheck
fi
echo "::endgroup::"

- name: 🔎 Verify Account PostgreSQL proof cases
if: ${{ matrix.module == 'account-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.AccountBareLoginExchangeRepositoryIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#positiveMembershipSnapshotRejectsScalarAndWrongTenantVersionMaps()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountBareLoginExchangeRepositoryIntegrationTest#claimOnlyTransactionRollsBackPendingExchange()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest#concurrentExactIssuanceClaimsHaveOneTerminalFirstWriter()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest#lostIssuanceResponseRecoversExactEncryptedResultFromDurableReadback(Path)' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest#directDeletionOfIssuanceOperationOrResponseEnvelopeIsRejected()' \
account-service

- name: 🔎 Verify Game Session PostgreSQL proof case
if: ${{ matrix.module == 'game-session-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite net.firedevops.firemud.gamesession.repository.ScriptPinOperationRepositoryIntegrationTest \
--require-case 'net.firedevops.firemud.gamesession.repository.ScriptPinOperationRepositoryIntegrationTest#pinAdmissionBaseMustStillMatchTheRowLockedRuntimeAndIsBoundToTheReceipt()' \
game-session-service

- name: 📦 Build Runtime JAR
if: ${{ contains(fromJSON(needs.changes.outputs.bootable_modules), matrix.module) }}
run: ./gradlew :${{ matrix.module }}:bootJar -PfullCheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,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 current Redis-only connect replay/session records and Gateway context verifier configuration do not establish that 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 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ For bootstrap-backed direct-text `LOGIN` and first-party `/ws/game/**`, the [Gat

Unless explicitly described as current behavior, this document defines the target protocol. The target direct-text flow is public `WORLDS` discovery -> credential-bearing `LOGIN` -> authenticated `REALMS` -> conditional `JOIN` -> conditional `CHARS`/character creation -> `PLAY`. Current credential and email-code `LOGIN` authenticate global Account identity without sending a tenant or requiring membership; the bootstrap instance tenant remains local transport context only and is not Account authentication authority. The target flow requires explicit `JOIN`/`Join & Play` for first public-production entry, while an existing durable `membershipLifecycleState=ACTIVE` membership permits direct `PLAY` and a grant-backed non-public path may proceed only when that same `ACTIVE` membership already exists. A grant never creates or substitutes membership. The local Account `JoinPublicProductionMembership` operation and Game Session translation/scope seam now exist, but complete direct-text and first-party end-to-end proof, PostgreSQL execution, pending-operation recovery/reconciliation, and the Account lifecycle/authority-generation snapshot needed by final admission remain incomplete. Current Account gRPC membership, grant, and entitlement reads used by Game Session fail with `FAILED_PRECONDITION` before data access, including for the Game Session workload. Accordingly, a valid-route text `PLAY` reaching runtime admission returns `AUTH_UNAVAILABLE` before membership, grant, or roster evaluation, and direct-text `CHARS` returns `CHARACTER_LIST_UNAVAILABLE` before Entity is called; neither is currently an actionable JOIN, roster, or PLAY path. The status and target admission contract are canonical in [Authentication](../../system-architecture-authentication.md#implementation-status). The local JOIN operation does not alter the target `JOIN` -> `CHARS`/character creation -> `PLAY` sequence.

The #2881 candidate now fails an otherwise valid first-party bare `LOGIN` with retryable `AUTH_UNAVAILABLE` before enqueue or authenticated session promotion because Game Session cannot yet obtain the required one-use Account delegation exchange. Existing invalid-context and mismatched-pointer checks retain their own denials; the unauthenticated bootstrap shell is not consumed merely by this unavailable result. Credential-bearing and email-code `LOGIN` keep their existing paths. This is containment, not proof that the current context verifier meets the complete target or that first-party login works end to end.

Target communication framing uses terminated sender `OK <COMMAND>` response frames and recipient `EVENT <TYPE>` event frames, with structured-client `PlayerOutput` schema-version negotiation and `unsupported_schema_version` rejection. Telnet and generic text WebSocket clients consume the deterministic text projection without schema negotiation. These framing and compatibility behaviors are target behavior and remain unimplemented or unproved in full; current generic and first-party projections are narrower. The owner contract is [Input, Output, and Presentation](../../system-architecture-input-output-and-presentation.md#output-model).

The current Unit 1B safety correction removes `PLAY`'s account/name/hash-derived actor fallback and performs account-scoped persisted Entity roster selection only after Account admission checks. That narrower roster is not yet namespace- and policy-qualified, and Account's current gRPC membership, grant, and entitlement reads fail with `FAILED_PRECONDITION` before data access even for the Game Session workload. Current text `PLAY` therefore fails closed with `AUTH_UNAVAILABLE` before Entity roster selection; direct-text `CHARS` returns `CHARACTER_LIST_UNAVAILABLE` before Entity is called. These statuses do not establish whether a membership, grant, or character exists. Fresh first-party `PLAY` no longer treats a connect-context token alone as retained-context replay authority, and focused post-`LOGOUT` replay suppression is present; it still requests a fresh `LOOK`. Durable logout episode/generation fencing, delayed-race proof, effective resume-window enforcement, and namespace-scoped controller takeover remain open.
Expand Down Expand Up @@ -100,10 +102,10 @@ Current local `JOIN` availability and the membership-authority-generation gap ar
Telnet and WebSocket clients share the line-based syntax, but transport context determines which `LOGIN` form is valid:

- For Telnet and other non-WebSocket text clients, fresh public `WORLDS` discovery precedes `LOGIN`; `LOGIN <email>` requests a verified-email code and `LOGIN <email> <secret>` performs an immediate password-or-code authentication attempt. Bare `LOGIN` does not start an interactive prompt.
- For sessions on the Gateway-routed first-party WebSocket route `/ws/game/**` that already carry a validated Gateway connect context, bare `LOGIN` completes gameplay authentication from the pre-established bootstrap identity instead of prompting for credentials. First-party browser, mobile-browser, native-mobile, and other first-party non-browser clients use the protected connect-token cookie; only the target-only, explicitly classified `non_first_party_public` route variant may use the dedicated connect-token handshake header after its proof is complete. This bootstrap identity must not quietly reintroduce gameplay binding into `LOGIN`; `PLAY` remains the sole gameplay-admission and gameplay-scope binding step. Reauthentication as a different account clears every retained character, runtime-route, playable-scope, and connect-scope field before `PLAY`; only an exact same-account reconnect may retain its candidate gameplay context for fresh admission validation.
- For sessions on the Gateway-routed first-party WebSocket route `/ws/game/**` that already carry a validated Gateway connect context, target bare `LOGIN` completes gameplay authentication through Account's one-use, caller-bound delegation exchange instead of prompting for credentials. The current candidate returns `AUTH_UNAVAILABLE` before promotion because that exchange is not implemented; Gateway context alone is not Account authorization. First-party browser, mobile-browser, native-mobile, and other first-party non-browser clients use the protected connect-token cookie; only the target-only, explicitly classified `non_first_party_public` route variant may use the dedicated connect-token handshake header after its proof is complete. This bootstrap identity must not quietly reintroduce gameplay binding into `LOGIN`; `PLAY` remains the sole gameplay-admission and gameplay-scope binding step. Reauthentication as a different account clears every retained character, runtime-route, playable-scope, and connect-scope field before `PLAY`; only an exact same-account reconnect may retain its candidate gameplay context for fresh admission validation.
- The same `OK <COMMAND>` and `ERROR <CODE> <message>` response format applies to all transports so clients can react consistently.

Multi-line prompt exchanges are planned but not implemented for Telnet and non-bootstrap clients. On those transports, bare `LOGIN` currently returns `ERROR PROMPT_LOGIN_UNSUPPORTED Prompt-based login is not implemented yet; send LOGIN <email> [secret].` First-party `/ws/game/**` sessions with a validated connect context are the exception: bare `LOGIN` consumes the bootstrap-backed context and must not ask the browser to resend credentials.
Multi-line prompt exchanges are planned but not implemented for Telnet and non-bootstrap clients. On those transports, bare `LOGIN` currently returns `ERROR PROMPT_LOGIN_UNSUPPORTED Prompt-based login is not implemented yet; send LOGIN <email> [secret].` First-party `/ws/game/**` sessions with a validated connect context are the target exception: bare `LOGIN` must use the Account exchange without asking the browser to resend credentials, but currently returns `AUTH_UNAVAILABLE` without promoting an authenticated session.

After `LOGIN` succeeds, an existing member normally issues `PLAY <world> [realm] [character]`; a first-time public-production player must issue `JOIN <world>` once before `PLAY`. `REALMS` and `CHARS` remain available as lobby helper commands when the player's choice is ambiguous or when they want to browse. `PLAY` is the gameplay-admission and gameplay-binding step; it is not merely a continuation of authentication. This step binds the authenticated connection to a world-scoped gameplay session and enforces tenant authorization, realm routing, public-admission rules, and entitlements.

Expand Down
Loading
Loading