authenticator

package
v0.1.69 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAuthServiceInContext      = errors.New("no auth service in context")
	ErrInvalidAuthServiceInContext = errors.New("invalid auth service in context")
)

Functions

func ToContext

func ToContext(ctx context.Context, a Authenticator) context.Context

Types

type Authenticator

type Authenticator interface {
	Init(ctx context.Context) error
	Editor() RequestEditor
	ClearCache()
	Name() string
}

func FromContext

func FromContext(ctx context.Context) (Authenticator, error)

type BearerProvider

type BearerProvider interface {
	Token(ctx context.Context, target string) (string, error)
}

type RequestEditor

type RequestEditor func(ctx context.Context, req *http.Request) error

Jump to

Keyboard shortcuts

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