session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWhoAmIController

func NewWhoAmIController(log logging.Logger, service SessionService, identities identities.Service) api.Router

NewWhoAmIController - Router for the Who Am I api routes.

Types

type Config

type Config struct {
	Expiration time.Duration
	Keys       webkeys.WebKeysConfig
}

Config - Holds the configuration for the session cookie created after registration or logging in

type Session

type Session struct {
	IdentityID   uuid.UUID `json:"iid"`
	TenantID     uuid.UUID `json:"tid"`
	CredentialID uuid.UUID `json:"cid"`
}

type SessionJwt

type SessionJwt struct {
	jwe.Claims

	Session
}

type SessionService

type SessionService interface {
	Generate(r *http.Request, Session Session) (string, error)
	GenerateCookie(r *http.Request, session Session) (*http.Cookie, error)

	FromRequest(r *http.Request) (*Session, error)
}

SessionService - Generates the tokens for their fully logged in session.

func NewSessionService

func NewSessionService(time stime.TimeService, jweService jwe.JWEService, config Config) SessionService

NewSessionService - Creates a default instance of a SessionService

Jump to

Keyboard shortcuts

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