authn

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingAuthorization = errors.New("missing authorization")
	ErrInvalidCredentials   = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Type         string
	Authenticate func(*http.Request) error
	Forbidden    func(w http.ResponseWriter, r *http.Request, err error)
}

Authenticator middleware

func (Authenticator) ServeHandler

func (m Authenticator) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type BasicAuthenticator

type BasicAuthenticator struct {
	Realm        string
	Authenticate func(r *http.Request, username, password string) error
}

BasicAuthenticator middleware

func Basic

func Basic(username, password string) *BasicAuthenticator

Basic creates new basic auth middleware

func (BasicAuthenticator) ServeHandler

func (m BasicAuthenticator) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type ForwardAuthenticator added in v0.11.0

type ForwardAuthenticator struct {
	URL                 *url.URL
	Client              *http.Client
	AuthRequestHeaders  []string
	AuthResponseHeaders []string
}

ForwardAuthenticator middleware

func Forward added in v0.11.0

func Forward(url *url.URL) *ForwardAuthenticator

Forward creates new auth request middleware

func (ForwardAuthenticator) ServeHandler added in v0.11.0

func (m ForwardAuthenticator) ServeHandler(h http.Handler) http.Handler

type ForwardServerError added in v0.11.0

type ForwardServerError struct {
	Response         *http.Response
	OriginError      error
	StatusCode       int
	IsTransportError bool
}

func (*ForwardServerError) Error added in v0.11.0

func (err *ForwardServerError) Error() string

Jump to

Keyboard shortcuts

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