Files
claude-botandClaude Opus 4.8 808cb5397d
ci/woodpecker/push/build-ci-images Pipeline was successful
fix(secret-rotator): HTTP/WS timeouts, entropy floor, orphan-token logging
Addresses three review findings, all real bugs rather than style:

1. No timeouts anywhere. The Python this replaces passed timeout=30 on every
   call; ureq 3's default agent has none and tungstenite has no read timeout,
   so a hung endpoint would stall the Job silently until activeDeadlineSeconds
   with no useful error — and the cluster demonstrably has hanging paths (the
   ingress-LB hairpin). Now: a shared ureq::Agent with timeout_global(30s)
   threaded through every OpenBao call, and a 30s read timeout set on the
   TcpStream under tungstenite's socket (handling both plain and rustls
   streams).

2. RANDOM_BYTES=0 would generate a near-empty secret, store it, and report
   success — the same silent-misconfig class assert_fields_exist guards. Now
   floored at 16 bytes (128 bits); every real rotator uses 32 or 50.

3. If mint succeeds but the OpenBao store fails, the freshly minted token is
   valid for its full lifespan, referenced nowhere, and never auto-revoked
   (revocation only targets the OLD stored id). The store error path now logs
   the orphan's refresh-token id — recovered from its own JWT — so it can be
   revoked by hand, and makes clear the consumer is unaffected because the old
   token is still stored and valid.

clippy -D warnings clean; 10 tests pass; scratch image builds (4.92 MB) and
all error paths exit non-zero.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 09:07:52 +02:00

2 lines
8 B
Plaintext