k8s

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultJWTProvider

func DefaultJWTProvider() (string, error)

DefaultJWTProvider is an implementation of JWTProvider that reads the Kubernetes service account JWT token located at /var/run/secrets/kubernetes.io/serviceaccount/token and returns it.

Types

type AuthMethod

type AuthMethod struct {
	Config Config
}

AuthMethod enables the Vault client to use information about your AuthMethod deployment environment to authenticate itself with Vault.

See https://www.vaultproject.io/api-docs/auth/kubernetes for more information on the Kubernetes auth method.

func New

func New(config Config) AuthMethod

New creates a new Vault auth method for Kubernetes.

func (AuthMethod) Login

func (m AuthMethod) Login(ctx context.Context, api api.API) (auth.Token, error)

Login generates a Vault token using information about the AuthMethod deployment environment.

type Config

type Config struct {
	// Role is the AuthMethod service account role that should be used to authenticate with Vault.
	Role string

	// JWTProvider is an optional field used to override how the Kubernetes service account JWT is retrieved for use
	// when authenticating with Vault. If omitted, the client will read the JWT from the
	// `/var/run/secrets/kubernetes.io/serviceaccount/token` file.
	JWTProvider func() (string, error)
}

Jump to

Keyboard shortcuts

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