authn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BasicAuthnFilterName string = "BasicAuthnFilter"

BasicAuthnFilterName is the name of the basic authentication filter

View Source
const BearerAuthnFilterName string = "BearerAuthnFilter"

BearerAuthnFilterName is the name of the bearer authentication filter

View Source
const RequiredAuthenticationFilterName = "RequiredAuthenticationFilter"

RequiredAuthenticationFilterName is the name of RequiredAuthenticationFilter

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthnFilter

type BasicAuthnFilter struct {
	Middleware
}

BasicAuthnFilter performs Basic authentication by validating the Authorization header

func NewBasicAuthnFilter

func NewBasicAuthnFilter(storage storage.Credentials, encrypter security.Encrypter) *BasicAuthnFilter

NewBasicAuthnFilter returns a BasicAuthnFilter using the provided credentials storage in order to validate the credentials

func (*BasicAuthnFilter) FilterMatchers

func (ba *BasicAuthnFilter) FilterMatchers() []web.FilterMatcher

FilterMatchers implements the web.Filter interface and returns the conditions on which the filter should be executed

func (*BasicAuthnFilter) Name

func (ba *BasicAuthnFilter) Name() string

Name implements the web.Filter interface and returns the identifier of the filter

type BearerAuthnFilter

type BearerAuthnFilter struct {
	Middleware
}

BearerAuthnFilter performs Bearer authentication by validating the Authorization header

func NewBearerAuthnFilter

func NewBearerAuthnFilter(ctx context.Context, tokenIssuer, clientID string) (*BearerAuthnFilter, error)

NewBearerAuthnFilter returns a BearerAuthnFilter

func (*BearerAuthnFilter) FilterMatchers

func (ba *BearerAuthnFilter) FilterMatchers() []web.FilterMatcher

FilterMatchers implements the web.Filter interface and returns the conditions on which the filter should be executed

func (*BearerAuthnFilter) Name

func (ba *BearerAuthnFilter) Name() string

Name implements the web.Filter interface and returns the identifier of the filter

type Middleware

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

Middleware type represents an authentication middleware

func (*Middleware) Run

func (ba *Middleware) Run(request *web.Request, next web.Handler) (*web.Response, error)

Run represents the authentication middleware function that delegates the authentication to the provided authenticator

type RequiredAuthnFilter

type RequiredAuthnFilter struct {
}

RequiredAuthnFilter type verifies that authentication has been performed for APIs that are secured

func NewRequiredAuthnFilter

func NewRequiredAuthnFilter() *RequiredAuthnFilter

NewRequiredAuthnFilter returns RequiredAuthnFilter

func (*RequiredAuthnFilter) FilterMatchers

func (raf *RequiredAuthnFilter) FilterMatchers() []web.FilterMatcher

FilterMatchers implements the web.Filter interface and returns the conditions on which the filter should be executed

func (*RequiredAuthnFilter) Name

func (raf *RequiredAuthnFilter) Name() string

Name implements the web.Filter interface and returns the identifier of the filter

func (*RequiredAuthnFilter) Run

func (raf *RequiredAuthnFilter) Run(request *web.Request, next web.Handler) (*web.Response, error)

Run implements web.Filter and represents the authentication middleware function that verifies the user is authenticated

Jump to

Keyboard shortcuts

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