authn

package
v0.19.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 20 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthenticatorNotEnabled = herodot.DefaultError{
	ErrorField:  "authenticator matching this route is misconfigured or disabled",
	CodeField:   http.StatusInternalServerError,
	StatusField: http.StatusText(http.StatusInternalServerError),
}
View Source
var ErrAuthenticatorNotResponsible = errors.New("Authenticator not responsible")

Functions

func NewErrAuthenticatorMisconfigured

func NewErrAuthenticatorMisconfigured(a Authenticator, err error) *herodot.DefaultError

func NewErrAuthenticatorNotEnabled

func NewErrAuthenticatorNotEnabled(a Authenticator) *herodot.DefaultError

Types

type AuthenticationSession

type AuthenticationSession struct {
	Subject string                 `json:"subject"`
	Extra   map[string]interface{} `json:"extra"`
	Header  http.Header            `json:"header"`
}

func (*AuthenticationSession) SetHeader

func (a *AuthenticationSession) SetHeader(key, val string)

type Authenticator

type Authenticator interface {
	Authenticate(r *http.Request, config json.RawMessage, rule pipeline.Rule) (*AuthenticationSession, error)
	GetID() string
	Validate(config json.RawMessage) error
}

type AuthenticatorAnonymous

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

func (*AuthenticatorAnonymous) Authenticate

func (*AuthenticatorAnonymous) Config

func (*AuthenticatorAnonymous) GetID

func (a *AuthenticatorAnonymous) GetID() string

func (*AuthenticatorAnonymous) Validate

func (a *AuthenticatorAnonymous) Validate(config json.RawMessage) error

type AuthenticatorAnonymousConfiguration

type AuthenticatorAnonymousConfiguration struct {
	Subject string `json:"subject"`
}

type AuthenticatorCookieSession

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

func (*AuthenticatorCookieSession) Authenticate

func (*AuthenticatorCookieSession) Config

func (*AuthenticatorCookieSession) GetID

func (*AuthenticatorCookieSession) Validate

func (a *AuthenticatorCookieSession) Validate(config json.RawMessage) error

type AuthenticatorCookieSessionConfiguration

type AuthenticatorCookieSessionConfiguration struct {
	Only            []string `json:"only"`
	CheckSessionURL string   `json:"check_session_url"`
}

type AuthenticatorCookieSessionFilter

type AuthenticatorCookieSessionFilter struct {
}

type AuthenticatorJWT

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

func (*AuthenticatorJWT) Authenticate

func (*AuthenticatorJWT) Config

func (*AuthenticatorJWT) GetID

func (a *AuthenticatorJWT) GetID() string

func (*AuthenticatorJWT) Validate

func (a *AuthenticatorJWT) Validate(config json.RawMessage) error

type AuthenticatorJWTRegistry

type AuthenticatorJWTRegistry interface {
	credentials.VerifierRegistry
}

type AuthenticatorNoOp

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

func NewAuthenticatorNoOp

func NewAuthenticatorNoOp(c configuration.Provider) *AuthenticatorNoOp

func (*AuthenticatorNoOp) Authenticate

func (*AuthenticatorNoOp) GetID

func (a *AuthenticatorNoOp) GetID() string

func (*AuthenticatorNoOp) Validate

func (a *AuthenticatorNoOp) Validate(config json.RawMessage) error

type AuthenticatorOAuth2ClientCredentials

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

func (*AuthenticatorOAuth2ClientCredentials) Authenticate

func (*AuthenticatorOAuth2ClientCredentials) Config

func (*AuthenticatorOAuth2ClientCredentials) GetID

func (*AuthenticatorOAuth2ClientCredentials) Validate

type AuthenticatorOAuth2Configuration

type AuthenticatorOAuth2Configuration struct {
	Scopes   []string `json:"required_scope"`
	TokenURL string   `json:"token_url"`
}

type AuthenticatorOAuth2Introspection

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

func (*AuthenticatorOAuth2Introspection) Authenticate

func (*AuthenticatorOAuth2Introspection) Config

func (*AuthenticatorOAuth2Introspection) GetID

func (*AuthenticatorOAuth2Introspection) Validate

type AuthenticatorOAuth2IntrospectionConfiguration

type AuthenticatorOAuth2IntrospectionConfiguration struct {
	Scopes           []string                                              `json:"required_scope"`
	Audience         []string                                              `json:"target_audience"`
	Issuers          []string                                              `json:"trusted_issuers"`
	PreAuth          *AuthenticatorOAuth2IntrospectionPreAuthConfiguration `json:"pre_authorization"`
	ScopeStrategy    string                                                `json:"scope_strategy"`
	IntrospectionURL string                                                `json:"introspection_url"`
}

type AuthenticatorOAuth2IntrospectionPreAuthConfiguration

type AuthenticatorOAuth2IntrospectionPreAuthConfiguration struct {
	Enabled      bool     `json:"enabled"`
	ClientID     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	Scope        []string `json:"scope"`
	TokenURL     string   `json:"token_url"`
}

type AuthenticatorOAuth2IntrospectionResult

type AuthenticatorOAuth2IntrospectionResult struct {
	Active    bool                   `json:"active"`
	Extra     map[string]interface{} `json:"ext"`
	Subject   string                 `json:"sub,omitempty"`
	Username  string                 `json:"username"`
	Audience  []string               `json:"aud"`
	TokenType string                 `json:"token_type"`
	Issuer    string                 `json:"iss"`
	ClientID  string                 `json:"client_id,omitempty"`
	Scope     string                 `json:"scope,omitempty"`
}

type AuthenticatorOAuth2JWTConfiguration

type AuthenticatorOAuth2JWTConfiguration struct {
	Scope             []string `json:"required_scope"`
	Audience          []string `json:"target_audience"`
	Issuers           []string `json:"trusted_issuers"`
	AllowedAlgorithms []string `json:"allowed_algorithms"`
	JWKSURLs          []string `json:"jwks_urls"`
	ScopeStrategy     string   `json:"scope_strategy"`
}

type AuthenticatorUnauthorized

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

func (*AuthenticatorUnauthorized) Authenticate

func (*AuthenticatorUnauthorized) GetID

func (a *AuthenticatorUnauthorized) GetID() string

func (*AuthenticatorUnauthorized) Validate

func (a *AuthenticatorUnauthorized) Validate(config json.RawMessage) error

type Registry

type Registry interface {
	AvailablePipelineAuthenticators() []string
	PipelineAuthenticator(string) (Authenticator, error)
}

Jump to

Keyboard shortcuts

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