httpauth

package
v0.0.0-...-c1a87c5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationFallbackHandler

func AuthenticationFallbackHandler(handler http.Handler, authenticationFunc AuthenticationFunc, fallbackHandler http.Handler) http.Handler

func AuthenticationHandler

func AuthenticationHandler(handler http.Handler, authenticationFunc AuthenticationFunc) http.Handler

func BasicAuthenticationHandler

func BasicAuthenticationHandler(handler http.Handler, realm string, userAuthenticator UserAuthenticator, contextKey interface{}) http.Handler

func BearerAuthenticationHandler

func BearerAuthenticationHandler(handler http.Handler, tokenAuthenticator TokenAuthenticator, contextKey interface{}) http.Handler

func TokenHeaderAuthenticationHandler

func TokenHeaderAuthenticationHandler(handler http.Handler, tokenAuthenticator TokenAuthenticator, contextKey interface{}, header string) http.Handler

Types

type AuthenticationFunc

type AuthenticationFunc func(w http.ResponseWriter, req *http.Request) (*http.Request, bool, error)

func BasicAuthentication

func BasicAuthentication(realm string, userAuthenticator UserAuthenticator, contextKey interface{}) AuthenticationFunc

func BearerAuthentication

func BearerAuthentication(tokenAuthenticator TokenAuthenticator, contextKey interface{}) AuthenticationFunc

func TokenHeaderAuthentication

func TokenHeaderAuthentication(tokenAuthenticator TokenAuthenticator, contextKey interface{}, header string) AuthenticationFunc

type SingleTokenAuthenticator

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

func NewSingleTokenAuthenticator

func NewSingleTokenAuthenticator(id id.ID) *SingleTokenAuthenticator

func (*SingleTokenAuthenticator) AuthenticateToken

func (s *SingleTokenAuthenticator) AuthenticateToken(id id.ID) (interface{}, bool, error)

type SingleUserAuthenticator

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

func NewSingleUserAuthenticator

func NewSingleUserAuthenticator(username, password string) *SingleUserAuthenticator

func (*SingleUserAuthenticator) AuthenticateUser

func (s *SingleUserAuthenticator) AuthenticateUser(username, password string) (info interface{}, authentic bool, err error)

type TokenAuthenticator

type TokenAuthenticator interface {
	AuthenticateToken(id.ID) (info interface{}, authentic bool, err error)
}

type UserAuthenticator

type UserAuthenticator interface {
	AuthenticateUser(username, password string) (info interface{}, authentic bool, err error)
}

Jump to

Keyboard shortcuts

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