mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
## Why A guest needs a stable JWT alias even when the upstream bearer expires or is invalidated. A disconnect during refresh can leave a rotating credential already spent, so concurrent and subsequent requests need to share the in-flight exchange. ## What changed Add `JwtBearerGrant` behind `#[cfg(test)]`. It exposes a decodable alias with explicitly selected scalar claims, reuses current bearers, and refreshes on demand. A refreshed token must preserve the grant's identity and disclosed claims. Invalidation makes previously resolved bearers unusable. Revocation also blocks future refreshes, and a failed or ambiguous refresh permanently revokes the grant. ## Testing Cover shared refreshes, request cancellation, invalidation and revocation during refresh, timeouts, and claim consistency across token rotation. GitOrigin-RevId: 67cdf18e5aafa9dbc7290a2ef8ba62da84f826c5