Files
zeekayandHanzo Dev 9b96b749b8 auth: two key shapes, and the store decides which is which
hk- is gone. IAM resolves sk-, which authenticates, and pk-, which names an
org and authenticates nobody; every other spelling — hk- among them — answers
to no live credential and comes back key_unknown, which keyRefusal turns into
the one sentence a stranded holder can act on: mint a new one. Nothing here
special-cases the retired prefix, because inventing a case for it would put
the third family back.

That leaves the dispatch unable to tell two families apart by prefix: the key
this estate mints and an upstream vendor key wear the same three characters.
So it stops trying. The provider table is asked first — an exact lookup, so it
can never claim a key it does not hold — and anything it misses is put to IAM.
The order matters only for who answers when NEITHER owns the key, and IAM's
refusal names the cure where a provider miss can only say "invalid".

resolveBillingKey skipped every sk- before it reached the cache, back when
sk- meant "vendor key, billed elsewhere". Keeping that would now skip the main
credential and cost IAM keys their router-level gate, so only pk- skips. The
IAM miss is cached alongside the hit, or a vendor key would buy a fresh
round-trip on every request it makes.

TestGetUserByAccessKey_RetiredPrefixGetsTheActionableRefusal pins the outcome:
an hk- key gets "not recognized … Mint a new one", never the bare "the entity
does not exist" relay that sent people looking for a deleted organization, and
the refusal carries the prefix only.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-02 13:40:28 -07:00
..