Help us shape the future of Go! Take the 2026 Go Developer Survey

authentication

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExpirationDuration = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenGetter

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

func NewTokenGetter

func NewTokenGetter(client corev1.ServiceAccountsGetter, options ...TokenGetterOption) *TokenGetter

Returns a token getter that can fetch tokens given a service account. The token getter also caches tokens which helps reduce the number of requests to the API Server. In case a cached token is expiring a fresh token is created.

func (*TokenGetter) Get

Get returns a token from the cache if available and not expiring, otherwise creates a new token

type TokenGetterOption

type TokenGetterOption func(*TokenGetter)

func WithExpirationDuration

func WithExpirationDuration(expirationDuration time.Duration) TokenGetterOption

Jump to

Keyboard shortcuts

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