chore(security)!: refuse tokens without aud

This commit is contained in:
lobo committed 2026-09-30 15:00:47 +02:00
1 parent 23bf5c41b4
commit e347b7aac8
6 files changed
+62 -118

No files matched your search

+1 -2
View File
@@ -81,8 +81,7 @@ the key set: a key that left the JWKS stops working. `JWT_PUBLIC_KEY` is used on
The token comes from Auth's `tbp_access` cookie or a `Bearer` header, whichever verifies first. Every token names its kind in `aud`
(`tbp-login`, `tbp-public-profile`, `tbp-internal`, with `iss=tbp-auth`); a login's `sub` is the user id. Core reads
`steamId` and the active `role` (missing or unknown = USER) from the claims and grants that role and every lower one
(`USER < AUDITOR < PLATFORM_ADMIN`). A token without `aud` comes from an Auth from before item 26 (kind in `typ`,
user id in `userId`) and is still accepted; item 29 removes that path. The claims are pinned in
(`USER < AUDITOR < PLATFORM_ADMIN`). A token without `aud` is refused. The claims are pinned in
`src/test/resources/contract/auth-core-contract.json`, the same file as in Auth; the tests build tokens only from it.
`POST`, `PUT` and `DELETE` need an `X-TBP-Client` or `Authorization` header (CSRF guard), and CORS allows only the
frontend origin.