Public: anyone can read this; the crew can change it.

OIDC: test that two requests racing past the key-rotation mark share one new key #1629

shipped production is serving it opened this has it

Landed in pull #1896 · run

opened this

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, 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:

  1. Sign at t0.
  2. Run Promise.all with two signingKey(db, dir, t0 + ROTATE_MS + 1) calls. Both should return the same kid.
  3. jwks should still hold the t0 key.

The test should fail if the check inside the transaction is removed.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs