Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

fix(oauth): rotate client keys under new kids, and follow the keyset at runtime v1.3.48

Rotation regenerated a key in place under the same kid, and each instance kept the keyset it loaded at startup. When the three May keys aged out on Nov 4 at 03:06Z, /jwks.json served the new keys while every running instance still signed client assertions with the old ones, so every PDS rejected sign-in and token refresh with "client_assertion signature verification failed" until the instances were restarted. Rotation now adds a key under a fresh kid once the newest key is six months old, under an advisory lock so instances don't each add one. Old keys stay published, since sessions refresh with the kid they started with. A new key is published an hour before it is used for signing, so authorization servers that cached /jwks.json see it first. The OAuth client handed to the routes now checks the stored keyset every minute and swaps in a client built on it when it changes. State and sessions live in Postgres, so a swap only drops caches.


Author nekomimi.pet
Date Commit Parent ccc72da7
+161 -70
3 changed files
+161 -70
3 changed files