Documentation ¶
Overview ¶
Package session provides functionality for providing auth based on session cookies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth interface { VerifyIDToken(ctx context.Context, idToken string) (*authn.Token, error) SessionCookie(ctx context.Context, idToken string, expiresIn time.Duration) (string, error) VerifySessionCookie(ctx context.Context, sessionCookie string) (*authn.Token, error) RevokeRefreshTokens(ctx context.Context, uID authn.UserID) error }
Auth represents a backing auth system that can handle token verification and session management. It's usually represented by a *fireauth.Client.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) LoginHandler ¶
func (*Client) LogoutHandler ¶
type DB ¶
type DB interface { Transactional(context.Context, func(tx db.Tx) error) error NoTxn(context.Context) db.Tx UserByAuthnProvider(tx db.Tx, provider authn.Provider, userID authn.UserID) (*todo.User, error) CreateUser(tx db.Tx, provider authn.Provider, authID authn.UserID, name, email string) (todo.UserID, error) }
DB represents a storage system for storing information about users, and creating a use-case specific UserID, rather than using the Authorization system's UserID. This storage system is responsible only to have transactional semantics and the ability to create a user, and retrieve back that same user when requested via the same input Authorization IDs.
type LoginRequest ¶
type LoginRequest struct { Name string `json:"name"` IDToken string `json:"idToken"` CSRFToken string `json:"csrfToken"` }
LoginRequest represents the format we expect to receive for session login requests, usually in the JSON-formatted body of a POST request.