authparsing

package
v0.0.0-...-93e11d5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNoAuthorization = merr.Code("no_authorization")

Variables

This section is empty.

Functions

func GetAuthState

func GetAuthState(ctx context.Context) any

func Middleware

func Middleware(parser Parser) func(http.Handler) http.Handler

func SetAuthState

func SetAuthState(ctx context.Context, val any) context.Context

Types

type Handler

type Handler func(context.Context, string) (any, error)

type Parser

type Parser struct {
	// keys must be lowercase
	Handlers map[string]Handler
}

func (Parser) Check

func (a Parser) Check(ctx context.Context, authorizationHeader string) (any, error)

Jump to

Keyboard shortcuts

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