auth

package module
v0.0.0-...-4c95daf Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: MIT Imports: 7 Imported by: 1

README

goji-auth

Simple authentication package for Goji.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user not found")

Functions

func Configure

func Configure(options *Opts)

func RouteGetUser

func RouteGetUser(c web.C, w http.ResponseWriter, r *http.Request)

func RouteLogin

func RouteLogin(c web.C, w http.ResponseWriter, r *http.Request)

func RouteLogout

func RouteLogout(c web.C, w http.ResponseWriter, r *http.Request)

func Skip

func Skip(path string, args ...string)

Types

type AccessCheckerInterface

type AccessCheckerInterface interface {
	Check(r *http.Request, user UserInterface) (bool, error)
}

type Opts

type Opts struct {
	UserFinder    UserFinderInterface
	AccessChecker AccessCheckerInterface
	Mux           *web.Mux
	MuxBase       string
	SessionStore  session.Store
}

type Token

type Token struct {
	Id        string      `json:"id"`
	User      interface{} `json:"user"`
	ExpiresAt time.Time   `json:"expires_at"`
}

type UserFinderInterface

type UserFinderInterface interface {
	FindUserByEmailAndPassword(email, password string) (UserInterface, error)
}

type UserInterface

type UserInterface interface {
	GetEmail() string
	GetDisplayName() string
}

abstract user

Jump to

Keyboard shortcuts

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