goIn

package module
v0.0.0-...-aeef51a Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2014 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserFunc

type GetUserFunc func(user string) (string, bool)

string ->:stored bcrypt hash, bool -> user exists

type MakeUserFunc

type MakeUserFunc func(user, hash string) error

generate a user, return error if username/password are bad.

type PasswordMiddleware

type PasswordMiddleware struct {
	GetUser       GetUserFunc
	MakeUser      MakeUserFunc
	ValidPassword ValidPasswordFunc
	Servicename   string
	Keypairs      [][]byte
	Cost          int
	// If not set, must call Init method
	Cookies *sessions.CookieStore
}

func (*PasswordMiddleware) Auth

func (*PasswordMiddleware) ChangePassword

func (pm *PasswordMiddleware) ChangePassword(accept http.HandlerFunc, reject http.HandlerFunc) http.HandlerFunc

TODO: fuckit, I'll do it later

func (*PasswordMiddleware) Init

func (pm *PasswordMiddleware) Init()

func (*PasswordMiddleware) Login

func (*PasswordMiddleware) Logout

func (pm *PasswordMiddleware) Logout(accept http.HandlerFunc, reject http.HandlerFunc) http.HandlerFunc

func (*PasswordMiddleware) NewUser

func (pm *PasswordMiddleware) NewUser(accept http.HandlerFunc, reject http.HandlerFunc) http.HandlerFunc

type ValidPasswordFunc

type ValidPasswordFunc func(password string) bool

Don't store password, but validate it meets security requirements

Jump to

Keyboard shortcuts

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