Files
at-container-registry/pkg
Evan JarrettandClaude Opus 5 934e4a2a59 appview: stop the crypto key first-boot race
Two instances booting against a fresh database both find no key, both generate
one, and both write. PutCryptoKey was last-writer-wins, so the loser kept its own
key in memory while the database held the other's. It then signed OAuth client
assertions with a key absent from the published JWKS, and issued registry JWTs
that did not match the certificate written to disk. Every one of them fails
verification, and nothing logs why.

PutCryptoKey now keeps the first write, and both loaders re-read afterwards and
use whatever is stored. Nothing in the codebase rotates a key through this
function, so the update arm only ever fired on the race.

Verified against the old behavior: with last-writer-wins restored, three of six
concurrent loaders returned a key that was not the one in the database.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 21:34:42 -05:00
..
2026-05-11 19:53:13 -05:00