middleware

package
v2.14.24 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrEmptyAuth occurs when authorization content is not found
	ErrEmptyAuth = errors.New("empty authorization content")

	// ErrNoMatchingProvider occurs no provider is found for given auth
	ErrNoMatchingProvider = errors.New("no matching provider for Authorization content")
)

Functions

This section is empty.

Types

type App

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

App of package

func New

func New(authProvider auth.Provider, tracer trace.Tracer, identProviders ...ident.Provider) App

New creates new App for given providers

func (App) IsAuthenticated

func (a App) IsAuthenticated(r *http.Request) (ident.Provider, model.User, error)

IsAuthenticated check if request has correct headers for authentification

func (App) IsAuthorized added in v2.11.3

func (a App) IsAuthorized(ctx context.Context, profile string) bool

IsAuthorized checks if User in context has given profile

func (App) Middleware

func (a App) Middleware(next http.Handler) http.Handler

Middleware wraps next authenticated handler

Jump to

Keyboard shortcuts

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