authenticators

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthenticatorUnauthorized        = "unauthorized"
	AuthenticatorBasicAuth           = "basic_auth"
	AuthenticatorAnonymous           = "anonymous"
	AuthenticatorOAuth2Introspection = "oauth2_introspection"
	AuthenticatorJwt                 = "jwt"
	AuthenticatorGeneric             = "generic"
)

Variables

View Source
var ErrSessionLifespanParseError = errors.New("session lifespan parse error")
View Source
var ErrSessionValidity = errors.New("session validity error")
View Source
var (
	ErrUnsupportedAuthenticatorType = errors.New("authenticator type unsupported")
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	ID() string
	Execute(ctx heimdall.Context) (*subject.Subject, error)
	WithConfig(config map[string]any) (Authenticator, error)
	IsFallbackOnErrorAllowed() bool
}

func CreatePrototype

func CreatePrototype(ctx CreationContext, id string, typ string, config map[string]any) (Authenticator, error)

type CreationContext

type CreationContext interface {
	Watcher() watcher.Watcher
	KeyHolderRegistry() keyholder.Registry
	CertificateObserver() certificate.Observer
}

type SessionLifespan

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

func (*SessionLifespan) Assert

func (s *SessionLifespan) Assert() error

type SessionLifespanConfig

type SessionLifespanConfig struct {
	ActiveField    string        `mapstructure:"active"`
	IssuedAtField  string        `mapstructure:"issued_at"`
	NotBeforeField string        `mapstructure:"not_before"`
	NotAfterField  string        `mapstructure:"not_after"`
	TimeFormat     string        `mapstructure:"time_format"`
	ValidityLeeway time.Duration `mapstructure:"validity_leeway"`
}

func (*SessionLifespanConfig) CreateSessionLifespan

func (s *SessionLifespanConfig) CreateSessionLifespan(rawData []byte) (*SessionLifespan, error)

type SubjectFactory

type SubjectFactory interface {
	CreateSubject(rawData []byte) (*subject.Subject, error)
}

type SubjectInfo

type SubjectInfo struct {
	IDFrom         string `mapstructure:"id"         validate:"required"`
	AttributesFrom string `mapstructure:"attributes"`
}

func (*SubjectInfo) CreateSubject

func (s *SubjectInfo) CreateSubject(rawData []byte) (*subject.Subject, error)

type TypeFactory

type TypeFactory func(ctx CreationContext, id string, typ string, config map[string]any) (bool, Authenticator, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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