authparsing

package
v0.0.0-...-f35ab2a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 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