tokenauth

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHeader

func WithHeader(header string) option

WithHeader sets the http header to use. Defaults to 'Authorization'. Optional.

func WithPrefix

func WithPrefix(prefix string) option

WithPrefix sets the prefix to check for in the header. Defaults to 'Token'. Optional.

func WithTokenSource

func WithTokenSource(ts TokenSource) option

WithTokenSource sets the backing token source. Required.

Types

type Module

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

func (*Module) Authenticate

func (m *Module) Authenticate(rw http.ResponseWriter, req *http.Request) (bool, *string, error)

func (*Module) Configure

func (m *Module) Configure(opts ...option)

func (*Module) Init

func (m *Module) Init(c *service.Config)

func (*Module) Logout

func (m *Module) Logout(rw http.ResponseWriter, req *http.Request)

type TokenSource

type TokenSource interface {
	Get(token string) *string
}

Jump to

Keyboard shortcuts

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