session

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionCache *ristretto.Cache

SessionCache stores dataset permission lists

Functions

func Get

func Get(key string) ([]string, bool)

Get returns a value from cache at key

func InitialiseSessionCache

func InitialiseSessionCache() (*ristretto.Cache, error)

InitialiseSessionCache creates a cache manager that stores keys and values in memory

func NewSessionKey

func NewSessionKey() string

NewSessionKey generates a session key used for storing dataset permissions, and checks that it doesn't already exist

func Set

func Set(key string, datasets []string)

Types

type DatasetCache

type DatasetCache struct {
	Datasets []string
}

DatasetCache stores the dataset permissions and information whether this information has already been checked or not. This information can then be used to skip the time-costly authentication middleware DatasetCache==nil, session doesn't exist DatasetCache.Datasets==nil, session exists, user has no permissions (this case is not used in middleware.go) DatasetCache.Datasets==[]string{}, session exists, user has permissions

Jump to

Keyboard shortcuts

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