Documentation ¶
Overview ¶
Package auth manages the authorization of SIFT users
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Log = logging.Log.New("pkg", "auth")
Log is used to log messages for the auth package. Logs are disabled by default; use sift/logging.SetLevel() to set log levels for all packages, or Log.SetHandler() to set a custom handler for this package (see: https://godoc.org/gopkg.in/inconshreveable/log15.v2)
Functions ¶
This section is empty.
Types ¶
type Authorizor ¶
An Authorizor allows users to log in to a system, and authorizes them for specific actions
type SiftAuthorizor ¶
type SiftAuthorizor struct {
// contains filtered or unexported fields
}
A SiftAuthorizor authorizes users to log in to a system, and authorizes them for specific actions. SiftAuthorizors could be instantiated by a call to auth.New()
func (*SiftAuthorizor) Authorize ¶
func (a *SiftAuthorizor) Authorize(t Token, path interface{}) bool
Authorize confirms whether or not a particular user (represented by their token) has access to perform a particular action.
func (*SiftAuthorizor) Login ¶
func (a *SiftAuthorizor) Login() Token
Login registers a new user and returns a unique Token that they may use to authorize further actions.