oauth

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const AuthzHeader = "Authorization"

Variables

This section is empty.

Functions

func GetAuthorizationToken

func GetAuthorizationToken(ctx context.Context, httpClient httputils.Client, credentials Credentials, scopes string, additionalHeaders map[string]string) (httputils.Token, error)

func NewAuthorizationProviderFromSecret

func NewAuthorizationProviderFromSecret(config *Config, httpClient httputils.Client, tokenTimeout time.Duration, k8sClientConstructor func(time.Duration) (client.Client, error)) (*tokenAuthorizationProviderFromSecret, error)

func NewTokenAuthorizationProviderFromHeader

func NewTokenAuthorizationProviderFromHeader() *tokenAuthorizationProviderFromHeader

func PrepareK8sClient

func PrepareK8sClient(duration time.Duration) (client.Client, error)

Types

type Config

type Config struct {
	SecretName            string        `mapstructure:"secret_name"`
	SecretNamespace       string        `mapstructure:"secret_namespace"`
	WaitSecretTimeout     time.Duration `mapstructure:"wait_secret_timeout"`
	WaitKubeMapperTimeout time.Duration `mapstructure:"wait_kube_mapper_timeout"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type Credentials

type Credentials struct {
	ClientID     string
	ClientSecret string
	TokenURL     string
}

Jump to

Keyboard shortcuts

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