authenticator

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// AuthenticatedTransport returns a RoundTripper with the required configuration
	// to connect to the endpoint.
	AuthenticatedTransport(endpoint config.Endpoint) (http.RoundTripper, error)
}

Authenticator provides an interface to generate a authorized round tripper.

type Config

type Config struct {
	SecretListerer  discovery.SecretListerer
	InClusterConfig *rest.Config
}

type K8sClientAuthenticator

type K8sClientAuthenticator struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(config Config, opts ...OptionFunc) (*K8sClientAuthenticator, error)

New returns an K8sClientAuthenticator that supports plain, bearer token and mTLS.

func (K8sClientAuthenticator) AuthenticatedTransport

func (a K8sClientAuthenticator) AuthenticatedTransport(endpoint config.Endpoint) (http.RoundTripper, error)

AuthenticatedTransport returns a round tripper according to the endpoint config. For mTLS configuration it fetches the certificates from the secret.

type OptionFunc

type OptionFunc func(kca *K8sClientAuthenticator) error

func WithLogger

func WithLogger(logger *log.Logger) OptionFunc

WithLogger returns an OptionFunc to change the logger from the default noop logger.

Jump to

Keyboard shortcuts

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