auth

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized")

ErrUnauthorized is returned when the attempted request is not authorized

Functions

This section is empty.

Types

type AuthenticationHandlerFunc added in v0.1.3

type AuthenticationHandlerFunc func(scheme, payload string) error

func (AuthenticationHandlerFunc) Authenticate added in v0.1.3

func (r AuthenticationHandlerFunc) Authenticate(scheme, payload string) error

type Authenticator added in v0.1.3

type Authenticator map[string]Handler

func (Authenticator) Authenticate added in v0.1.3

type Handler added in v0.1.3

type Handler interface {
	Authenticate(scheme, payload string) error
}

func HandleBasic

func HandleBasic(username, password string) Handler

HandleBasic performs basic authentication for register listener request metadata

func HandleBearer

func HandleBearer(token string) Handler

HandleBearer performs a bearer token comparison for register listener request metadata

func HandleBearerHashed added in v0.1.1

func HandleBearerHashed(expected []byte) Handler

HandleBearerHashed performs a bearer token comparison for register listener request metadata It expects the token to have been pre-hashed using sha256 and encoded as a hexidecimal string

func HandleExternalAuthorizer added in v0.1.3

func HandleExternalAuthorizer(addr string) Handler

Jump to

Keyboard shortcuts

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