session

package
v3.16.3-0...-b1d59dc Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Username string
	Email    string
}

Identity identity of the user who is being verified.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider a session provider.

func NewProvider

func NewProvider(configuration schema.SessionConfiguration) *Provider

NewProvider instantiate a session provider given a configuration.

func (*Provider) DestroySession

func (p *Provider) DestroySession(ctx *fasthttp.RequestCtx) error

DestroySession destroy a session ID and delete the cookie.

func (*Provider) GetExpiration

func (p *Provider) GetExpiration(ctx *fasthttp.RequestCtx) (time.Duration, error)

GetExpiration get the expiration of the current session.

func (*Provider) GetSession

func (p *Provider) GetSession(ctx *fasthttp.RequestCtx) (UserSession, error)

GetSession return the user session from a request

func (*Provider) RegenerateSession

func (p *Provider) RegenerateSession(ctx *fasthttp.RequestCtx) error

RegenerateSession regenerate a session ID.

func (*Provider) SaveSession

func (p *Provider) SaveSession(ctx *fasthttp.RequestCtx, userSession UserSession) error

SaveSession save the user session.

func (*Provider) UpdateExpiration

func (p *Provider) UpdateExpiration(ctx *fasthttp.RequestCtx, expiration time.Duration) error

UpdateExpiration update the expiration of the cookie and session.

type ProviderConfig

type ProviderConfig struct {
	// contains filtered or unexported fields
}

ProviderConfig is the configuration used to create the session provider.

func NewProviderConfig

func NewProviderConfig(configuration schema.SessionConfiguration) ProviderConfig

NewProviderConfig creates a configuration for creating the session provider

type UserSession

type UserSession struct {
	Username string
	// TODO(c.michaud): move groups out of the session.
	Groups []string
	Emails []string

	KeepMeLoggedIn      bool
	AuthenticationLevel authentication.Level
	LastActivity        int64

	// The challenge generated in first step of U2F registration (after identity verification) or authentication.
	// This is used reused in the second phase to check that the challenge has been completed.
	U2FChallenge *u2f.Challenge
	// The registration representing a U2F device in DB set after identity verification.
	// This is used in second phase of a U2F authentication.
	U2FRegistration *u2f.Registration

	// This boolean is set to true after identity verification and checked
	// while doing the query actually updating the password.
	PasswordResetUsername *string
}

UserSession is the structure representing the session of a user.

func NewDefaultUserSession

func NewDefaultUserSession() UserSession

NewDefaultUserSession create a default user session.

Directories

Path Synopsis
Package mock_session is a generated GoMock package.
Package mock_session is a generated GoMock package.

Jump to

Keyboard shortcuts

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