New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose SkipExpiryCheck OIDC Config Option in Verifier #1271
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1271 +/- ##
==========================================
+ Coverage 58.01% 58.23% +0.21%
==========================================
Files 50 50
Lines 3013 3031 +18
==========================================
+ Hits 1748 1765 +17
+ Misses 1113 1110 -3
- Partials 152 156 +4
|
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
|
||
type Issuer interface { | ||
// Match checks if this issuer can authenticate tokens from a given issuer URL | ||
Match(ctx context.Context, url string) bool | ||
|
||
// Authenticate ID token and return Principal on success. The ID token's signature | ||
// is verified in the call -- invalid signature must result in an error. | ||
Authenticate(ctx context.Context, token string) (Principal, error) | ||
Authenticate(ctx context.Context, token string, opts ...config.InsecureOIDCConfigOption) (Principal, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm, this is what you are calling within your code, correct? Just wanted to understand why we need options propagated to all of the issuers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! We have a custom issuer which requires this option to be passed in.
// Look up our fixed issuer verifiers | ||
v, ok := fc.verifiers[issuerURL] | ||
if ok { | ||
return v, true | ||
for _, c := range v { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a use case that needs to be handled? What's the case when you'd have a configuration that specifies both skipping the expiration and not skipping the expiration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, so our custom issuer does have this use case. Not sure if I can give more details though 😅
This PR exposes some oidc config options allowed by the go-oidc library that we use, specifically SkipExpiryCheck.
It updates the LRU cache for verifiers to include both the verifier and the config in the cache, so that Verifier A with a normal config can be distinguished from Verifier A with a config with SkipExpiryCheck set