Documentation
¶
Overview ¶
Package session implements a cookie-backed auth.Authenticator: it reads the session cookie, resolves its hashed token to a live session and user, and returns the corresponding auth.Principal. Issuance/revocation live in the auth REST handler; this package only reads.
Index ¶
Constants ¶
const DefaultCookieName = "sqi_session"
DefaultCookieName is the session cookie name.
Variables ¶
var ErrNoCredential = errors.New("session: no credential")
ErrNoCredential means the request carried no session cookie.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator resolves a session cookie to a Principal.
func New ¶
func New(src SessionSource, cookieName string, clock func() time.Time) *Authenticator
New returns a session Authenticator. A nil clock defaults to time.Now.
func (*Authenticator) Authenticate ¶
Authenticate implements auth.Authenticator.