lumbermill: github.com/heroku/lumbermill/Godeps/_workspace/src/github.com/heroku/authenticater Index | Files

package authenticater

import "github.com/heroku/lumbermill/Godeps/_workspace/src/github.com/heroku/authenticater"

Index

Package Files

any.go auth.go basic_auth.go logplex_drain_tokens.go

func WrapAuth Uses

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

type AnyOrNoAuth Uses

type AnyOrNoAuth struct{}

AnyOrNoAuth just returns true for any call to Authenticate

func (AnyOrNoAuth) Authenticate Uses

func (fa AnyOrNoAuth) Authenticate(r *http.Request) bool

Authenticate all requests

type Authenticater Uses

type Authenticater interface {
    Authenticate(r *http.Request) bool
}

Authenticater provides an interface for authentication of a http.Request

type BasicAuth Uses

type BasicAuth struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

BasicAuth handles normal user/password Basic Auth requests, multiple password for the same user and is safe for concurrent use.

func NewBasicAuth Uses

func NewBasicAuth() *BasicAuth

NewBasicAuth returns an empty BasicAuth Authenticator

func NewBasicAuthFromString Uses

func NewBasicAuthFromString(creds string) (*BasicAuth, error)

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 Uses

func (ba *BasicAuth) AddPrincipal(user, pass string)

AddPrincipal add's a user/password combo to the list of valid combinations

func (*BasicAuth) Authenticate Uses

func (ba *BasicAuth) Authenticate(r *http.Request) bool

Authenticate is true if the Request has a valid BasicAuth signature and that signature encodes a known username/password combo.

type LogplexDrainToken Uses

type LogplexDrainToken struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

LogplexDrainToken ensures that the Logplex-Drain-Token header contains a known token and is safe for concurrent use

func NewLogplexDrainToken Uses

func NewLogplexDrainToken() *LogplexDrainToken

NewLogplexDrainToken creates and returns a new LogplexDrainTokens

func NewLogplexDrainTokenFromString Uses

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 Uses

func (ldt *LogplexDrainToken) AddToken(token string)

AddToken adds a token to the list of acceptable tokens.

func (*LogplexDrainToken) Authenticate Uses

func (ldt *LogplexDrainToken) Authenticate(r *http.Request) (exists bool)

Authenticate the request if the Logplex-Drain-Token header contains a known token

Package authenticater imports 4 packages (graph) and is imported by 1 packages. Updated 2016-07-16. Refresh now. Tools for package owners.