ADR-0131: Keycloak sign-in in the Windows engineering client
Foundation / checks (ecs) (push) Successful in 2m21s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 7m21s
Foundation / checks (network) (push) Canceled after 9m43s
Foundation / checks (checks) (push) Canceled after 9m49s
Foundation / checks (postgres) (push) Canceled after 9m43s
Foundation / checks (client) (push) Canceled after 9m48s
Foundation / checks (ecs) (push) Successful in 2m21s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 7m21s
Foundation / checks (network) (push) Canceled after 9m43s
Foundation / checks (checks) (push) Canceled after 9m49s
Foundation / checks (postgres) (push) Canceled after 9m43s
Foundation / checks (client) (push) Canceled after 9m48s
Sign In / Register opens the system browser (PKCE S256, loopback 127.0.0.1:47600) and keeps the refresh token in Windows Credential Manager. The client then fetches a 10-minute grant from grants.aeternalisgames.com and connects to the cellular DEV region. It renews the grant about a minute before expiry through SessionRefresh, and again after a lost connection. Sign Out closes the session and revokes the login at the broker and at Keycloak. Grant replies are cross-checked against the grant record before use. The manual grant-bundle path stays for developers. The bounded JSON reader moves to evo_json (evo::serialization), shared by the broker and the client. Adds the client-auth tests. Completes work started in another session: main.cpp wiring, refresh expiry tracking, no requests for a superseded session, and clang-tidy and Windows header-order fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,30 @@ never be minted on a client.
|
||||
4. On logout: `POST /logout`, then revoke the refresh token at Keycloak's revocation
|
||||
endpoint.
|
||||
|
||||
### Client implementation (Windows engineering client)
|
||||
|
||||
- `evo_client_auth`: the protocol parsers (`protocol.cpp`), one worker thread
|
||||
(`AuthClient`, `client.cpp`) and the Windows platform (`windows.cpp`). On other
|
||||
systems sign-in is unavailable, and the manual grant-bundle path remains.
|
||||
- Sign-in opens the system browser with PKCE S256 and a random state. A loopback
|
||||
listener on `127.0.0.1:47600` accepts exactly one `/callback` with that state and an
|
||||
`iss` of the realm, if present. The password never reaches the client.
|
||||
- The refresh token is stored only in Windows Credential Manager
|
||||
(`AeternalisEvolution/DEV/refresh-token/v1`). Rotation removes the stored token
|
||||
before it is sent, so a lost reply ends the login instead of replaying a consumed
|
||||
token. Access tokens and grants stay in memory and are zeroed when dropped.
|
||||
- A grant reply is accepted only if its JSON agrees with the grant record: marker,
|
||||
version, dev environment, account, region, expiry (at most 15 minutes ahead) and a
|
||||
nonzero serial. The region still verifies the signature.
|
||||
- The region CA file is still required from the launcher. Endpoint and TLS name come
|
||||
from the broker's route.
|
||||
- The session asks for a new grant about 60 s before its expiry, extended by each
|
||||
accepted `SessionRefresh`, and after a lost connection. It never asks for a session
|
||||
that was superseded or cancelled. Requests are at least 5 s apart.
|
||||
- Sign-out closes the session, then calls `/logout` (broker revocation) and Keycloak
|
||||
revocation, and clears the stored token. If revocation cannot be confirmed, the
|
||||
client says so: issued grants may live until they expire.
|
||||
|
||||
### Deployment (DEV)
|
||||
|
||||
- `deploy/kubernetes/grant-broker-dev`, a component of `region/dev` so it runs the
|
||||
|
||||
@@ -27,6 +27,14 @@ watermark, grants left, the snapshot, interest and snapshot bytes, and the last
|
||||
intentions with their outcome (sent, admitted, rejected, simulated, unknown; M10.5c). That list is the record;
|
||||
short notifications expire and can be dismissed.
|
||||
|
||||
**Sign in / Register** (Windows, ADR-0131) opens the system browser for Keycloak.
|
||||
After sign-in the client fetches a 10-minute grant from `grants.aeternalisgames.com`
|
||||
and connects to the cellular DEV region. It renews the grant before expiry and after a
|
||||
lost connection. **Play in DEV** reconnects while signed in. **Sign out** closes the
|
||||
session and revokes the login. Only the region CA file is still read from the form.
|
||||
The manual endpoint and grant-bundle fields stay under "Manual connection
|
||||
(developer grants)".
|
||||
|
||||
## Build and run
|
||||
|
||||
### Cellular v10
|
||||
|
||||
@@ -7610,3 +7610,43 @@ nursery stall is reproduced locally, not confirmed as this player's precise live
|
||||
refusal. This gate changes neither nursery resources nor simulation/replay rules.
|
||||
No deployment or World0 operation ran. Authentication is a following gate under
|
||||
ADR-0131. The unrelated deployment edit and untracked files were preserved.
|
||||
|
||||
## 2026-10-15 — ADR-0131 client sign-in (CI pending)
|
||||
|
||||
The Windows engineering client signs in with Keycloak in the system browser (PKCE S256,
|
||||
loopback `127.0.0.1:47600`), keeps the refresh token in Windows Credential Manager,
|
||||
fetches 10-minute grants from the broker and connects to the DEV region. It renews
|
||||
grants about 60 s before expiry through `SessionRefresh`, and again after a lost
|
||||
connection. Sign-out revokes at the broker and at Keycloak. The bounded JSON reader
|
||||
moved to `evo_json` (`evo::serialization`), which the broker and the client share.
|
||||
|
||||
This completes the in-progress client work from another session. The fixes:
|
||||
- `main.cpp` wiring (sign in, connect on the first grant, renew, sign out);
|
||||
- the session now records the expiry from accepted refreshes, so it no longer asks
|
||||
for a grant every 5 s;
|
||||
- no grant requests for a superseded or cancelled session;
|
||||
- clang-tidy findings (enum sizes, `stop_token` by reference, an unterminated
|
||||
`string_view` in the panel);
|
||||
- the Windows SDK header order, pinned against clang-format reordering.
|
||||
|
||||
New `client-auth` tests (`tests/client_auth.cpp`):
|
||||
- callback path, state, `iss`, duplicate and control-character refusals;
|
||||
- token replies and their error mapping;
|
||||
- grant replies cross-checked against the record: region, expiry, account,
|
||||
environment, serial, padding and lifetime bound;
|
||||
- the worker on a scripted platform: first login with PKCE fields, saved-login
|
||||
rotation, fallback to the browser after a revoked refresh token, account change
|
||||
refused, logout order, unconfirmed revocation, unverified email, credential-store
|
||||
failure, and cancel and destruction while the browser is open.
|
||||
|
||||
Executed locally:
|
||||
- WSL clang-19 `client-probe` with clang-tidy as CI runs it: 14/14 CTests, plus the
|
||||
Xvfb X11 lifecycle check;
|
||||
- ASan/UBSan `client-auth` three times, plus `client-panels`;
|
||||
- MSVC `tools/windows-check.ps1 -Preset client-package`: 18/18, including
|
||||
`client-auth` and the QUIC session tests;
|
||||
- the PostgreSQL broker build on the moved parser;
|
||||
- clang-format 19.
|
||||
|
||||
Limits: no live sign-in against `auth.aeternalisgames.com` yet. That needs the broker
|
||||
pod running (the issuer key name) and the `grants.aeternalisgames.com` Ingress.
|
||||
|
||||
Reference in New Issue
Block a user