authn

package
v2.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenAuthFilter

func NewTokenAuthFilter(
	findServiceAccountByTokenFn func(
		ctx context.Context,
		token string,
	) (authn.ServiceAccount, error),
	findSessionFn func(ctx context.Context, token string) (authn.Session, error),
	findEventByTokenFn func(
		ctx context.Context,
		token string,
	) (core.Event, error),
	config *TokenAuthFilterConfig,
) restmachinery.Filter

NewTokenAuthFilter returns an implementation of the restmachinery.Filter interface that decorates an http.HandlerFunc to carry out request authentication by extracting an opaque bearer token form the HTTP Authorization header and using that token to locate an established Session.

Types

type TokenAuthFilterConfig

type TokenAuthFilterConfig struct {
	// RootUserEnabled indicates whether the TokenAuthFilter should permit the
	// "root" user to authenticate using a password.
	RootUserEnabled bool
	// ThirdPartyAuthEnabled indicates whether the TokenAuthFilter service should
	// permit User authentication via third-parties.
	ThirdPartyAuthEnabled bool
	// FindUserFn is a function for locating a User. This field is applicable only
	// when the value of the ThirdPartyAuthEnabled field is true.
	FindUserFn func(ctx context.Context, id string) (authn.User, error)
	// HashedSchedulerToken is a secure hash of the token used by the scheduler
	// component.
	HashedSchedulerToken string
	// HashedObserverToken is a secure hash of the token used by the observer
	// component.
	HashedObserverToken string
}

TokenAuthFilterConfig encapsulates several configuration options for the TokenAuthFilter.

Jump to

Keyboard shortcuts

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