ADR-0131: Keycloak grant broker and schema v39 account identities
Foundation / checks (checks) (push) Successful in 42m13s
Foundation / checks (deploy) (push) Successful in 4m5s
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (network) (push) Successful in 19m18s
Foundation / checks (postgres) (push) Successful in 44m19s
Foundation / checks (tsan) (push) Successful in 9m48s
Foundation / checks (client) (push) Failing after 12m6s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

evo-grant-broker verifies realm aeternalis access tokens offline (RS256 against
the pinned JWKS; audience aevolution-grants, client aevolution-game, verified
email) and issues 10-minute session grants:
- POST /grant routes to the region holding the account's life, or the default.
- POST /logout makes every issued grant stale and expires current control.
- GET /healthz.

Schema v39 maps (issuer, subject) to stable accounts with strictly increasing
serials. The binary ships in the server image. The DEV manifests are in
deploy/kubernetes/grant-broker-dev and are not yet enabled in region/dev; that
waits for the image promotion and the out-of-band Secrets and Ingress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-15 10:20:27 -04:00
co-authored by Claude Opus 5.5
parent 817a830a8a
commit 68880ba3b4
29 changed files with 1967 additions and 18 deletions
+31
View File
@@ -7541,3 +7541,34 @@ authentication (Windows credential manager rejected; WSL had no configured
credential). A subsequent Windows retry successfully pushed through `1519287`
to `origin/main`. No credentials were changed or printed by this task. Remote CI
has not yet been checked for this client commit; the verified ZIP is local.
## 2026-10-15 — ADR-0131 grant broker and schema v39 (CI pending)
`evo-grant-broker` verifies Keycloak RS256 access tokens offline against the realm's
pinned JWKS and issues 10-minute session grants. Schema v39 maps (issuer, subject) to
stable accounts and takes strictly increasing serials. Logout raises the accepted
serial and expires current control. `OpsServer::serve_api` adds bodiless GET/POST
with an Authorization header.
Tests (`grant_broker_tests.cpp`, PostgreSQL suite):
- the bounded JSON reader: escapes, surrogates, depth 16, size and integer bounds;
- the token verifier with an OpenSSL-generated realm key: audience, authorized
party, type, issuer, expiry and leeway, nbf, unverified email, missing subject,
unknown kid, `none`/HS256, spliced and foreign signatures, oversize;
- the broker against real PostgreSQL. No database call happens before a token
verifies. Grants verify with the issuer's public key; serials 1, 2, then 3 after
logout. Rate limit 429. Logout fences the live control's renewal, makes serial 2
stale and lets serial 3 claim. Logout without control still raises the serial.
Unknown identities are not revoked, an offline database gives 503, and the runtime
role cannot read identities directly.
Executed locally: WSL g++-14 build of the broker and `evo-postgres-tests`, and the
PostgreSQL C++ suite (schema v39). g++-14 `-Werror -Wshadow` and clang-tidy-19 on the
broker, ops HTTP, store and test sources. clang-format 19. `deploy-policy-check.py`
(0 failures, including the rendered `region/dev` with the broker component),
selftest and ops helpers.
Limits: no live Keycloak token was exercised yet. DEV deployment waits for:
- the image promotion;
- the out-of-band Secrets `aevolution-grant-issuer` and `aevolution-grant-broker-pg`;
- the Ingress for `grants.aeternalisgames.com`.