-
Notifications
You must be signed in to change notification settings - Fork 592
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
Add library for OIDC token management #7315
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: creydr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7315 +/- ##
==========================================
- Coverage 77.53% 76.91% -0.62%
==========================================
Files 250 252 +2
Lines 13566 13671 +105
==========================================
- Hits 10518 10515 -3
- Misses 2523 2630 +107
- Partials 525 526 +1
☔ View full report in Codecov by Sentry. |
2546d33
to
243c52e
Compare
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.
Are you planning to add some unit tests?
@@ -34,7 +34,7 @@ kubeadmConfigPatches: | |||
kind: ClusterConfiguration | |||
apiServer: | |||
extraArgs: | |||
"service-account-issuer": "kubernetes.default.svc" | |||
"service-account-issuer": "https://kubernetes.default.svc" |
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.
Does that mean https://
is required? Could we infer it when it's missing since without it is considered valid by the k8s API server?
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.
afaik, https
for OIDC is required, so assuming scheme = https
would work
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.
When I setup a kind cluster without https://
, I got a 404 on /.well-known/...
From the docs:
The issuer URL must comply with the OIDC Discovery Spec. In practice, this means it must use the https scheme, and should serve an OpenID provider configuration at {service-account-issuer}/.well-known/openid-configuration
The token_provider is mostly a wrapper around the TokenRequest API without much additional logic. So I don't see value here yet. |
/lgtm |
Fixes #7175
Proposed Changes
OIDCTokenProvider.GetJWT()
method to return a JWT for a given service account and audienceOIDCTokenVerifier.VerifyJWT()
method to verify a token with the provider configured for the clusterOpen points: