session

package
v0.2.92 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Expiry is the session expiry time for garbage collection purposes
	Expiry = time.Hour * 24 * 7 // 7 days

	// Skew is the amount of time before a session expires that we will consider it close to expiring
	Skew = time.Hour * 24 // 1 day
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Identifier   string    `json:"identifier"`
	Creation     time.Time `json:"creation"`
	Expiry       time.Time `json:"expiry"`
	Device       bool      `json:"device"`
	Provider     flow.Key  `json:"provider"`
	Creator      string    `json:"creator"`
	Organization string    `json:"organization"`
}

Session represents a user's authenticated session

func New

func New(device bool, provider flow.Key, creator string, organization string) *Session

New returns a new session for a user with the given kind key, provider key, creator identifier, and organization

func (*Session) CloseToExpiry

func (s *Session) CloseToExpiry() bool

CloseToExpiry returns true if the session is close to expiring

func (*Session) Expired

func (s *Session) Expired() bool

Expired returns true if the session has expired

func (*Session) Refresh

func (s *Session) Refresh()

Jump to

Keyboard shortcuts

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