auth

package
v0.0.0-...-b25b198 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package auth provides TKG authentication functions.

Index

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

func GetServerKubernetesVersion(kubeconfigPath, context string) (string, error)

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

func TanzuLocalKubeConfigPath() (path string, err error)

TanzuLocalKubeConfigPath returns the local tanzu kubeconfig path

Types

type DiscoveryStrategy

type DiscoveryStrategy struct {
	DiscoveryPort        *int
	ClusterInfoConfigMap string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL