Repository navigation
Sign workload tokens across a key creation or rotation race - #261
Merged
Merged
Conversation
A call that read the clock just before another call created or rotated the key ring found no active signing key and failed with 409. It now signs with the next key, which is already published.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 3613913 | Nov 21 2026, 01:18 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workloadKeysreads the clock once per call. If another call creates or rotates the key ring during the read, the first call can see a ring whose next key activates a second after its own clock:Either way the call fails with
No active workload signing key(409). This can happen once on first use and then around every rotation (every 30 days). It is also whyissues app and service tokens … including concurrent cold callssometimes fails onmain.Fix
If no key with a private key is active yet for the call's clock, it signs with the earliest key that has one. That key has been in the JWKS since it was generated, so receivers verify the token.
Tests
pnpm checkpasses.

Confidence Score: 5/5 
The PR appears safe to merge; no actionable issues were found.Summary
Updates
workloadKeysto select the earliest key with a private key when a concurrent call has created or rotated the ring ahead of the caller’s clock.Tests were reviewed, not run.
Reviews (1) · Last reviewed commit: "Sign workload tokens across a key creati..." · Reviewed by Greptile