Class KubernetesAuthToken
java.lang.Object
org.jenkinsci.plugins.kubernetes.auth.impl.KubernetesAuthToken
- All Implemented Interfaces:
KubernetesAuth
Kubernetes authentication using a token.
The token itself is obtained from a
TokenProducer
that may need some execution context.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.fabric8.kubernetes.api.model.ConfigBuilder
buildConfigBuilder
(KubernetesAuthConfig config, String context, String clusterName, String username) buildKubeConfig
(KubernetesAuthConfig config) Builds a kube config file content based on the current authentication object.io.fabric8.kubernetes.api.model.AuthInfoBuilder
decorate
(io.fabric8.kubernetes.api.model.AuthInfoBuilder authInfoBuilder, KubernetesAuthConfig config) io.fabric8.kubernetes.client.ConfigBuilder
decorate
(io.fabric8.kubernetes.client.ConfigBuilder builder, KubernetesAuthConfig config) Decorates aConfigBuilder
to connect using the current authentication object.protected String
getToken
(KubernetesAuthConfig config)
-
Constructor Details
-
KubernetesAuthToken
-
-
Method Details
-
getToken
- Throws:
KubernetesAuthException
-
decorate
public io.fabric8.kubernetes.api.model.AuthInfoBuilder decorate(io.fabric8.kubernetes.api.model.AuthInfoBuilder authInfoBuilder, KubernetesAuthConfig config) throws KubernetesAuthException - Throws:
KubernetesAuthException
-
decorate
public io.fabric8.kubernetes.client.ConfigBuilder decorate(io.fabric8.kubernetes.client.ConfigBuilder builder, KubernetesAuthConfig config) throws KubernetesAuthException Description copied from interface:KubernetesAuth
Decorates aConfigBuilder
to connect using the current authentication object.- Parameters:
builder
- the configuration to decorate- Returns:
- the decorated configuration
- Throws:
KubernetesAuthException
- if anything fails during the processing of the authentication configuration
-
buildKubeConfig
Description copied from interface:KubernetesAuth
Builds a kube config file content based on the current authentication object.- Specified by:
buildKubeConfig
in interfaceKubernetesAuth
- Returns:
- Kubeconfig file content corresponding to this authentication object.
- Throws:
KubernetesAuthException
- if something fails while dealing with credentials
-
buildConfigBuilder
public io.fabric8.kubernetes.api.model.ConfigBuilder buildConfigBuilder(KubernetesAuthConfig config, String context, String clusterName, String username) throws KubernetesAuthException - Specified by:
buildConfigBuilder
in interfaceKubernetesAuth
- Throws:
KubernetesAuthException
-