Documentation ¶
Overview ¶
Package auth provides TKG authentication functions.
Index ¶
- Constants
- func GetPinnipedKubeconfig(cluster *clientcmdapi.Cluster, pinnipedInfo *pinnipedinfo.PinnipedInfo, ...) (*clientcmdapi.Config, error)
- func GetServerKubernetesVersion(kubeconfigPath, context string) (string, error)
- func KubeconfigWithPinnipedAuthLoginPlugin(endpoint string, options *KubeConfigOptions, ...) (mergeFilePath, currentContext string, err error)
- func TanzuLocalKubeConfigPath() (path string, err error)
- type DiscoveryStrategy
- type KubeConfigOptions
Constants ¶
View Source
const ( // ConciergeAuthenticatorType is the pinniped concierge authenticator type ConciergeAuthenticatorType = "jwt" // ConciergeAuthenticatorName is the pinniped concierge authenticator object name ConciergeAuthenticatorName = "tkg-jwt-authenticator" // PinnipedOIDCScopes are the scopes of pinniped oidc PinnipedOIDCScopes = "offline_access,openid,pinniped:request-audience" // TanzuLocalKubeDir is the local config directory TanzuLocalKubeDir = ".kube-tanzu" // TanzuKubeconfigFile is the name the of the kubeconfig file TanzuKubeconfigFile = "config" // DefaultPinnipedLoginTimeout is the default login timeout DefaultPinnipedLoginTimeout = time.Minute // DefaultClusterInfoConfigMap is the default ConfigMap looked up in the kube-public namespace when generating a kubeconfig. DefaultClusterInfoConfigMap = "cluster-info" )
Variables ¶
This section is empty.
Functions ¶
func GetPinnipedKubeconfig ¶
func GetPinnipedKubeconfig(cluster *clientcmdapi.Cluster, pinnipedInfo *pinnipedinfo.PinnipedInfo, clustername, audience string) (*clientcmdapi.Config, error)
GetPinnipedKubeconfig generate kubeconfig given cluster-info and pinniped-info and the requested audience
func GetServerKubernetesVersion ¶
GetServerKubernetesVersion uses the kubeconfig to get the server k8s version.
func KubeconfigWithPinnipedAuthLoginPlugin ¶
func KubeconfigWithPinnipedAuthLoginPlugin(endpoint string, options *KubeConfigOptions, discoveryStrategy DiscoveryStrategy) (mergeFilePath, currentContext string, err error)
KubeconfigWithPinnipedAuthLoginPlugin prepares the kubeconfig with tanzu pinniped-auth login as client-go exec plugin
func TanzuLocalKubeConfigPath ¶
TanzuLocalKubeConfigPath returns the local tanzu kubeconfig path
Types ¶
type DiscoveryStrategy ¶
A DiscoveryStrategy contains information about how various discovery information should be looked up from an endpoint when setting up a kubeconfig.
type KubeConfigOptions ¶
type KubeConfigOptions struct {
MergeFilePath string
}
KubeConfigOptions contains the kubeconfig options
Click to show internal directories.
Click to hide internal directories.