fix: lazily create OIDC Issuer to support Kubernetes tokens#609
Merged
spencerschrock merged 1 commit intosigstore:mainfrom Jan 29, 2026
Merged
fix: lazily create OIDC Issuer to support Kubernetes tokens#609spencerschrock merged 1 commit intosigstore:mainfrom
spencerschrock merged 1 commit intosigstore:mainfrom
Conversation
stefanberger
previously approved these changes
Jan 29, 2026
Contributor
spencerschrock
left a comment
There was a problem hiding this comment.
Switching this to lazy init seems fine to me, one question though
Comment on lines
+156
to
+157
| issuer = sigstore_oidc.Issuer(self._oidc_issuer) | ||
| return issuer.identity_token( |
Contributor
There was a problem hiding this comment.
Any idea how heavy this is as it fetches "an OpenID Connect configuration file, which is then used to bootstrap the issuer's state"
We were previously storing this issuer after creation, and now it gets reinitialized every call to _get_identity_token
Contributor
Author
There was a problem hiding this comment.
Good point, did not think of this. Fixed to cache Issuer object
Issuer was created eagerly in __init__, fetching OIDC discovery config. Kubernetes OIDC providers lack authorization_endpoint/token_endpoint, causing failures even when identity_token was provided directly. Now Issuer is lazily created and cached when OAuth flow is needed. Signed-off-by: SequeI <asiek@redhat.com>
stefanberger
approved these changes
Jan 29, 2026
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.
Summary
Issuer was created early in
__init__, fetching OIDC discovery config. Kubernetes OIDC providers lack authorization_endpoint/token_endpoint, causing failures even when identity_token was provided directly.Now Issuer is only created when OAuth flow is needed, after FIRST checking if OIDC token was supplied directly via args, or env.
Checklist