auth

package
v0.0.0-...-e526314 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidPasswordError = errors.New("Invalid password")
)

Functions

This section is empty.

Types

type Auth

type Auth struct {
	PingHandler http.Handler
	// contains filtered or unexported fields
}

func New

func New(db db.DB) *Auth

func (*Auth) AuthCookie

func (a *Auth) AuthCookie(u string) (*http.Cookie, error)

func (*Auth) AuthoriseUser

func (a *Auth) AuthoriseUser(username string, password string) (*model.User, error)

func (*Auth) EncryptPassword

func (a *Auth) EncryptPassword(password string) ([]byte, error)

func (*Auth) LoginHandler

func (a *Auth) LoginHandler(w http.ResponseWriter, r *http.Request)

func (*Auth) LogoutHandler

func (a *Auth) LogoutHandler(w http.ResponseWriter, r *http.Request)

func (*Auth) RequireUser

func (a *Auth) RequireUser(h http.Handler) http.Handler

func (*Auth) VerifyCookie

func (a *Auth) VerifyCookie(c *http.Cookie) (*model.User, error)

VerifyCookie checks the given cookie is valid and returns the username encoded within.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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