session

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdentityNotFound     = errors.New("identity not set or found")
	ErrCredentialsNotSet    = errors.New("credentialID not set")
	ErrPutSessionNotEnabled = errors.New("put session not enabled")
)

Functions

This section is empty.

Types

type Config

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

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 SessionController added in v0.2.3

type SessionController interface {
	AppendRoutes(router *mux.Router) *mux.Router
}

func NewSessionController added in v0.2.3

func NewSessionController(logger logging.Logger, service SessionService) SessionController

type SessionJwt

type SessionJwt struct {
	jwe.Claims

	Session
}

type SessionService

type SessionService interface {
	GetDetails(claims tmw.TumblerClaims) (*client.SessionDetails, error)
	ChangeDetails(req *http.Request, claims tmw.TumblerClaims, updates client.ChangeSessionDetails) (*client.SessionDetails, *http.Cookie, error)
}

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

func NewSessionService

func NewSessionService(logger logging.Logger, identities identities.Service, service TokenService, credentials credentials.CredentialsService, config Config) SessionService

NewSessionService - Creates a default instance of a SessionService

type TokenService added in v0.3.2

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

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

func NewTokenService added in v0.3.2

func NewTokenService(time stime.TimeService, jweService jwe.JWEService, config Config) TokenService

NewTokenService - 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