usertoken

package
v0.0.0-testrgm4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const UrgentRotateTime = 1 * time.Minute

Variables

View Source
var ErrInvalidSessionToken = errors.New("invalid session token")

Functions

This section is empty.

Types

type TokenRevokedError

type TokenRevokedError struct {
	UserID                int64
	TokenID               int64
	MaxConcurrentSessions int64
}

func (*TokenRevokedError) Error

func (e *TokenRevokedError) Error() string

func (*TokenRevokedError) Unwrap

func (e *TokenRevokedError) Unwrap() error

type UserToken

type UserToken struct {
	Id            int64
	UserId        int64
	AuthToken     string
	PrevAuthToken string
	UserAgent     string
	ClientIp      string
	AuthTokenSeen bool
	SeenAt        int64
	RotatedAt     int64
	CreatedAt     int64
	UpdatedAt     int64
	RevokedAt     int64
	UnhashedToken string
}

UserToken represents a user token

func (*UserToken) NeedsRotation

func (t *UserToken) NeedsRotation(rotationInterval time.Duration) bool

func (*UserToken) NextRotation

func (t *UserToken) NextRotation(rotationInterval time.Duration) time.Time

Jump to

Keyboard shortcuts

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