Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSessionExpired should be returned by stores for expired sessions ErrSessionExpired = errors.New("session expired") )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface {
// SessionLoad loads a session by id
SessionLoad(ctx context.Context, id string) (Session, error)
// SessionCreate creates a session
SessionCreate(ctx context.Context, session *Session) error
// SessionUpdate updates a session
SessionUpdate(ctx context.Context, session *Session) error
// SessionDestroy destroys a session by id
SessionDestroy(ctx context.Context, id string) error
// SessionOptions returns the options from the audience
SessionOptions(ctx context.Context, aud string) (Options, error)
// SessionCleanup should remove expired sessions from the store
SessionCleanup(ctx context.Context) error
}
Controller represents the backend session storage interface
type Manager ¶
type Manager struct {
Controller
// contains filtered or unexported fields
}
Manager store is a session store
type Options ¶
type Options struct {
sessions.Options
KeyPairs [][]byte
// contains filtered or unexported fields
}
Options provide cookie hashing and encryption
type Session ¶
type Session struct {
ID string `json:"id"`
Audience string `json:"aud"`
Subject string `json:"sub"`
Data string `json:"data"`
CreatedAt time.Time `json:"iat"`
ExpiresAt time.Time `json:"exp"`
RevokedAt *time.Time `json:"rev,omitempty"`
}
Session represents an oauth session stored in a browser cookie and backed by the controller
Click to show internal directories.
Click to hide internal directories.