identity

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSecretMalformed = fmt.Errorf("service account's secret malformed")

Functions

func BeginIdentityKeyRotation

func BeginIdentityKeyRotation(ctx context.Context, cli kubernetes.Clientset, name string, namespace string) (*corev1.Secret, error)

func CompleteIdentityKeyRotation

func CompleteIdentityKeyRotation(ctx context.Context, cli kubernetes.Clientset, name string, namespace string) (*string, error)

func CreateNewTokenVersion

func CreateNewTokenVersion(ctx context.Context, cli kubernetes.Clientset, name string, namespace string) (*corev1.Secret, error)

func GetKubeconfig

func GetKubeconfig(cli kubernetes.Clientset, token *ServiceAccountToken, opts GetKubeconfigOptions) ([]byte, error)

func RevokeIdentityKey

func RevokeIdentityKey(ctx context.Context, cli kubernetes.Clientset, name string, namespace string, version uint64) (*string, error)

func RollbackIdentityKey

func RollbackIdentityKey(ctx context.Context, cli kubernetes.Clientset, name string, namespace string, version uint64) (*corev1.Secret, error)

Types

type GetKubeconfigOptions

type GetKubeconfigOptions struct {
	OverrideHost *string
	User         *string
	Namespace    *string
}

type Instance

type Instance struct {
	Namespace      string   `json:"namespace"`
	ServiceAccount string   `json:"serviceAccount"`
	Secrets        []string `json:"secrets"`
}

func CreateIdentity

func CreateIdentity(ctx context.Context, cli kubernetes.Clientset, name string, namespace string) (*Instance, error)

type ServiceAccountToken

type ServiceAccountToken struct {
	CACrt     []byte `json:"ca.crt"`
	Namespace []byte `json:"namespace"`
	Token     []byte `json:"token"`
}

func GetToken

func GetToken(secret *corev1.Secret) (*ServiceAccountToken, error)

Jump to

Keyboard shortcuts

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