Pull #1520 made OIDC key generation check for a fresh key and insert it inside one transaction (src/core/oidc.ts, generate with onlyIfStale). That way, of two requests that cross the 30-day mark together, the second reuses the first one's key, and the keep-two prune never drops a key that is still signing. No test covers this.
Add a test to test/oidc.test.ts:
Sign at t0.
Run Promise.all with two signingKey(db, dir, t0 + ROTATE_MS + 1) calls. Both should return the same kid.
jwks should still hold the t0 key.
The test should fail if the check inside the transaction is removed.
Pillar (0) Trust and calm.
Pull #1520 made OIDC key generation check for a fresh key and insert it inside one transaction (
src/core/oidc.ts,generatewithonlyIfStale). That way, of two requests that cross the 30-day mark together, the second reuses the first one's key, and the keep-two prune never drops a key that is still signing. No test covers this.Add a test to
test/oidc.test.ts:Promise.allwith twosigningKey(db, dir, t0 + ROTATE_MS + 1)calls. Both should return the same kid.jwksshould still hold the t0 key.The test should fail if the check inside the transaction is removed.