auth

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationHeader  = "Authorization"
	XAuthorizationHeader = "X-Authorization"
)

Variables

This section is empty.

Functions

func CredentialToContext

func CredentialToContext(ctx context.Context, credential Credential) context.Context

Types

type Authenticator

type Authenticator interface {
	Authenticate(Credential) (Credential, error)
}

type AuthenticatorFunc

type AuthenticatorFunc func(Credential) (Credential, error)

func (AuthenticatorFunc) Authenticate

func (a AuthenticatorFunc) Authenticate(credential Credential) (Credential, error)

type Credential

type Credential interface{}

func CredentialFromContext

func CredentialFromContext(ctx context.Context) Credential

func ExtractFromHeader

func ExtractFromHeader(request *http.Request) Credential

type CredentialProvider

type CredentialProvider func() Credential

func FromHeader

func FromHeader(request *http.Request) CredentialProvider

type CredentialSetter

type CredentialSetter func(Credential)

func AddHeader

func AddHeader(request *http.Request) CredentialSetter

Jump to

Keyboard shortcuts

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