Documentation ¶
Index ¶
- type Identity
- type Provider
- func (p *Provider) DestroySession(ctx *fasthttp.RequestCtx) error
- func (p *Provider) GetExpiration(ctx *fasthttp.RequestCtx) (time.Duration, error)
- func (p *Provider) GetSession(ctx *fasthttp.RequestCtx) (UserSession, error)
- func (p *Provider) RegenerateSession(ctx *fasthttp.RequestCtx) error
- func (p *Provider) SaveSession(ctx *fasthttp.RequestCtx, userSession UserSession) error
- func (p *Provider) UpdateExpiration(ctx *fasthttp.RequestCtx, expiration time.Duration) error
- type ProviderConfig
- type U2FRegistration
- type UserSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
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 ¶
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 U2FRegistration ¶
U2FRegistration is a serializable version of a U2F registration
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 *U2FRegistration // 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.