middleware

package
v0.0.0-...-cb1a7a4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Managers

func Managers(r *http.Request) model.MetadataManagers

func Var

func Var(r *http.Request, name string) (string, bool)

func WebSecurity

func WebSecurity(next http.Handler) http.Handler

func WithAuthentication

func WithAuthentication(a Authenticator) mux.MiddlewareFunc

func WithErrorSensitivity

func WithErrorSensitivity(sensitivity errawr.ErrorSensitivity) mux.MiddlewareFunc

func WithTrustedProxyHops

func WithTrustedProxyHops(n int) mux.MiddlewareFunc

Types

type Authenticator

type Authenticator interface {
	// Authenticate performs the request mapping to a credential. If the request
	// cannot be verified but no other error occurs, this method returns nil.
	Authenticate(r *http.Request) (*Credential, error)
}

Authenticator maps an HTTP request to a credential, if possible.

type Credential

type Credential struct {
	Managers model.MetadataManagers
	Tags     []trackers.Tag
}

Credential represents a valid authentication request.

type KubernetesAuthenticator

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

func (*KubernetesAuthenticator) Authenticate

func (ka *KubernetesAuthenticator) Authenticate(r *http.Request) (*Credential, error)

type KubernetesAuthenticatorClientFactoryFunc

type KubernetesAuthenticatorClientFactoryFunc func(token string) (kubernetes.Interface, error)

type KubernetesAuthenticatorOption

type KubernetesAuthenticatorOption func(ka *KubernetesAuthenticator)

func KubernetesAuthenticatorWithChainToVaultTransitIntermediary

func KubernetesAuthenticatorWithChainToVaultTransitIntermediary(client *vaultapi.Client, path, key string) KubernetesAuthenticatorOption

func KubernetesAuthenticatorWithKeyResolver

func KubernetesAuthenticatorWithKeyResolver(key interface{}) KubernetesAuthenticatorOption

func KubernetesAuthenticatorWithKubernetesIntermediary

func KubernetesAuthenticatorWithKubernetesIntermediary(client *authenticate.KubernetesInterface) KubernetesAuthenticatorOption

func KubernetesAuthenticatorWithLogServiceIntermediary

func KubernetesAuthenticatorWithLogServiceIntermediary(client plspb.LogClient) KubernetesAuthenticatorOption

func KubernetesAuthenticatorWithVaultResolver

func KubernetesAuthenticatorWithVaultResolver(addr, path, role string) KubernetesAuthenticatorOption

Jump to

Keyboard shortcuts

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