-
Notifications
You must be signed in to change notification settings - Fork 51
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
MBS-8041 Refresh expired OpenID token #297
Conversation
require(getNamespace() == namespace) { | ||
"kubernetes.context.namespace should be $namespace. " + | ||
"Namespace hardcoded in plugin, and this check only prevents from using wrong context" | ||
} | ||
requestConfig.oauthTokenProvider = oauthTokenProvider(configFile) | ||
} |
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.
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.
Fixed
@@ -20,6 +20,7 @@ sealed class KubernetesCredentials : Serializable { | |||
) : KubernetesCredentials(), Serializable | |||
} | |||
|
|||
// TODO: get rid of this default. autoConfig is enabled by default |
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.
This refactoring is out of scope
We support Open Id tokens in k8s for authentication and authorization.
kubectl
refreshes tokens automatically and stores changes to kube config file.Kubernetes - OpenID Connect Tokens
How they look in the config:
id-token
is the Open id token in Jwt format:exp
- is the expiration date. This is how the client knows it in advance.Unfortunately, fabric8 kubernetes-client doesn't refresh tokens.
I've reused implementation from the official client (kubernetes-client/java#871)
Known issues: