API Key and Token Service · View 12 of 22 · Act 5 · Runtime
The budget
- p50 ≤ 0.3 ms, p99 ≤ 3 ms, p99.9 ≤ 10 ms in-process. Stated assumptions, and chosen so that verification is cheaper than the cheapest platform call it guards — which is what makes "verify on every request" a decision nobody has to defend in a budget review.
- The digest is a keyed HMAC, not a memory-hard KDF. At 250,000/s an Argon2id verification is not affordable, and 160 bits of platform-generated entropy is not a password.
What the response carries
- Tenant, principal, scope set, constraints, credential class, expiry — and the projection's staleness, on every response including the successful ones.
- Invalid answers come from a closed set of reasons and are returned at constant shape and cost, so timing does not disclose whether a key identifier exists.
The failure branch
- Past 120 s without a successful feed poll the guard refuses write and admin scopes while read-only scopes continue. That is the scope-graded answer to the fail-open/fail-closed question, and it doubles the behaviours that need testing.