sessions

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserSession

func AddUserSession(s *UserSession, skey string)

AddUserSession add user session

func DeleteUserSession

func DeleteUserSession(skey string)

DeleteUserSession add user session

func GetRoleCheck

func GetRoleCheck(method, url string) bool

GetRoleCheck check the given method and URL matches

func GetSecretRoleCheck

func GetSecretRoleCheck(method, url string) bool

GetRoleCheck check the given method and URL matches

func InitUserSessionCache

func InitUserSessionCache() error

InitUserSessionCache init user cache

func SetSessionErrorFlag

func SetSessionErrorFlag(skey string)

SetSessionErrorFlag ser session errflg

func UpdateUserSessionExpiry

func UpdateUserSessionExpiry(skey string, secs int)

UpdateUserSessionExpiry set a short TTL when error happens

Types

type UserSession

type UserSession struct {
	// Type of the server. Relay means user-facing
	// Dialin means cluster-facing
	Type string

	// ServerName of the server which accepted the connection
	ServerName string

	// CertSNI derived from client certificate
	CertSNI string

	// DialinCachedKey already stiched to a dialin
	DialinCachedKey string

	// ErrorFlag indicate the session got 401/502
	ErrorFlag bool

	// UserName used in login
	UserName string

	// RoleName Role
	RoleName string

	// IsReadrole read/write
	IsReadrole bool

	// IsReadrole OrgAdmin
	IsOrgAdmin bool

	// EnforceOrgAdminOnlySecret access
	EnforceOrgAdminOnlySecret bool
}

UserSession session cache

func GetUserSession

func GetUserSession(skey string) (*UserSession, bool)

GetUserSession get the user session

Jump to

Keyboard shortcuts

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