Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapAuth ¶
func WrapAuth(auth Authenticater, handle http.HandlerFunc) http.HandlerFunc
WrapAuth returns a http.Handlerfunc that runs the passed Handlerfunc if and only if the Authenticator can authenticate the request
Types ¶
type AnyOrNoAuth ¶
type AnyOrNoAuth struct{}
AnyOrNoAuth just returns true for any call to Authenticate
func (AnyOrNoAuth) Authenticate ¶
func (fa AnyOrNoAuth) Authenticate(r *http.Request) bool
type Authenticater ¶
Authenticater provides an interface for authentication of a http.Request
type BasicAuth ¶
BasicAuth handles normal user/password Basic Auth requests, multiple password for the same user and is safe for concurrent use.
func NewBasicAuth ¶
func NewBasicAuth() *BasicAuth
NewBasicAuth returns an empty BasicAuth Authenticator
func NewBasicAuthFromString ¶
NewBasicAuthFromString creates and populates a BasicAuth from the provided credentials, encoded as a string, in the following format: user:password|user:password|...
func (*BasicAuth) AddPrincipal ¶
AddPrincipal add's a user/password combo to the list of valid combinations
type LogplexDrainToken ¶
LogplexDrainToken ensures that the Logplex-Drain-Token header contains a known token and is safe for concurrent use
func NewLogplexDrainToken ¶
func NewLogplexDrainToken() *LogplexDrainToken
NewLogplexDrainToken creates and returns a new LogplexDrainTokens
func NewLogplexDrainTokenFromString ¶
func NewLogplexDrainTokenFromString(tokens string) *LogplexDrainToken
NewLogplexDrainTokenFromString creates and returns a new LogplexDrainTokens instance from the provided string containing tokens in the folloing format: token1,token2,token3,...
func (*LogplexDrainToken) AddToken ¶
func (ldt *LogplexDrainToken) AddToken(token string)
AddToken adds a token to the list of acceptable tokens.
func (*LogplexDrainToken) Authenticate ¶
func (ldt *LogplexDrainToken) Authenticate(r *http.Request) (exists bool)
Authenticate the request if the Logplex-Drain-Token header contains a known token