auth

package
v0.0.0-...-0e89551 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CookieName = "ATC-Authorization"

Variables

View Source
var ErrUnparsableHeader = errors.New("cannot parse 'Authorization' header")

Functions

func ExtractUsernameAndPassword

func ExtractUsernameAndPassword(authorizationHeader string) (string, string, error)

func Unauthorized

func Unauthorized(w http.ResponseWriter)

Types

type BasicAuthHashedValidator

type BasicAuthHashedValidator struct {
	Username       string
	HashedPassword string
}

func (BasicAuthHashedValidator) IsAuthenticated

func (validator BasicAuthHashedValidator) IsAuthenticated(r *http.Request) bool

type BasicAuthValidator

type BasicAuthValidator struct {
	Username string
	Password string
}

func (BasicAuthValidator) IsAuthenticated

func (validator BasicAuthValidator) IsAuthenticated(r *http.Request) bool

type CookieSetHandler

type CookieSetHandler struct {
	Handler http.Handler
}

func (CookieSetHandler) ServeHTTP

func (handler CookieSetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Handler

type Handler struct {
	Validator Validator
	Handler   http.Handler
}

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NoopValidator

type NoopValidator struct{}

func (NoopValidator) IsAuthenticated

func (NoopValidator) IsAuthenticated(*http.Request) bool

type Validator

type Validator interface {
	IsAuthenticated(*http.Request) bool
}

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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