auth

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizationSourceBasic = "basic"
View Source
const AuthorizationSourceBearer = "bearer"

Variables

View Source
var (
	ErrBasicAuthHeaderNotFound    = errors.New("no header value found")
	ErrHeaderValueMalformed       = errors.New("header value malformed")
	ErrAppVerifcationFailed       = errors.New("application verification failed")
	ErrUnknown                    = errors.New("unknown error")
	ErrInvalidAuthorizationResult = errors.New("invalid authorization result")
)
View Source
var (
	SourceContextKey          = &contextKey{"Source"}
	AuthorizationIDContextKey = &contextKey{"AuthorizationID"}
	ClientIDContextKey        = &contextKey{"ClientID"}
	SubjectContextKey         = &contextKey{"Subject"}
)

Functions

func ClientIDFromBasicAuth

func ClientIDFromBasicAuth(r *http.Request, as ApplicationQuerySource) (string, string, error)

func ConnectAuthenticator

func ConnectAuthenticator(as ApplicationQuerySource) func(http.Handler) http.Handler

Types

type ApplicationQuerySource

type ApplicationQuerySource interface {
	ApplicationByClientID(ctx context.Context, clientID string) (*application.Application, error)
}

type AuthorizationInfo

type AuthorizationInfo struct {
	Source          string
	ClientID        string
	Subject         *string
	AuthorizationID *string
}

func FromContext

func FromContext(ctx context.Context) (*AuthorizationInfo, error)

type AuthorizationSource

type AuthorizationSource string

type BasicAuth

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

Jump to

Keyboard shortcuts

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