saauth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceAccountAuthInfoWriter

type ServiceAccountAuthInfoWriter struct {
	// contains filtered or unexported fields
}

ServiceAccountAuthInfoWriter implements Kubernetes service account authentication.

func NewServiceAccountAuthInfoWriter

func NewServiceAccountAuthInfoWriter(saFile string, refreshInterval time.Duration) (*ServiceAccountAuthInfoWriter, error)

NewServiceAccountAuthInfoWriter creates a new ServiceAccountAuthInfoWriter. ServiceAccountAuthInfoWriter implements Kubernetes service account authentication. It reads the token from the given file and refreshes it every refreshInterval. If refreshInterval is 0, it defaults to 5 minutes. If saFile is empty, it defaults to /var/run/secrets/kubernetes.io/serviceaccount/token. An error is returned if the initial token read fails. Further read failures do not cause an error.

func (*ServiceAccountAuthInfoWriter) AuthenticateRequest

AuthenticateRequest implements the runtime.ClientAuthInfoWriter interface. It sets the Authorization header to the current token.

func (*ServiceAccountAuthInfoWriter) Stop

func (s *ServiceAccountAuthInfoWriter) Stop()

Stop stops the token refresh

Jump to

Keyboard shortcuts

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