auth

package
v0.6.42 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 14 Imported by: 12 modules, 20 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CattleAuthFailed = "X-API-Cattle-Auth-Failed"

Variables

View Source
var ExistingContext = ToMiddleware(AuthenticatorFunc(func(req *http.Request) (user.Info, bool, error) {
	user, ok := request.UserFrom(req.Context())
	return user, ok, nil
}))
View Source
var (
	// Default value taken from DefaultAuthWebhookRetryBackoff
	WebhookBackoff = wait.Backoff{
		Duration: 500 * time.Millisecond,
		Factor:   1.5,
		Jitter:   0.2,
		Steps:    5,
	}
)

Functions

func AlwaysAdmin

func AlwaysAdmin(req *http.Request) (user.Info, bool, error)

func Impersonation

func Impersonation(req *http.Request) (user.Info, bool, error)

func WebhookConfigForURL

func WebhookConfigForURL(url string) (string, error)

Types

type Authenticator

type Authenticator interface {
	Authenticate(req *http.Request) (user.Info, bool, error)
}

func NewWebhookAuthenticator

func NewWebhookAuthenticator(cacheTTL time.Duration, kubeConfig *rest.Config) (Authenticator, error)

type AuthenticatorFunc

type AuthenticatorFunc func(req *http.Request) (user.Info, bool, error)

func (AuthenticatorFunc) Authenticate

func (a AuthenticatorFunc) Authenticate(req *http.Request) (user.Info, bool, error)

type Middleware

type Middleware func(next http.Handler) http.Handler

func NewWebhookMiddleware

func NewWebhookMiddleware(cacheTTL time.Duration, kubeConfig *rest.Config) (Middleware, error)

func ToMiddleware

func ToMiddleware(auth Authenticator) Middleware

func (Middleware) Chain

func (m Middleware) Chain(middleware Middleware) Middleware

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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