Documentation
¶
Index ¶
- func AddUserSession(s *UserSession, skey string)
- func DeleteUserSession(skey string)
- func GetRoleCheck(method, url string) bool
- func GetSecretRoleCheck(method, url string) bool
- func InitUserSessionCache() error
- func SetSessionErrorFlag(skey string)
- func UpdateUserSessionExpiry(skey string, secs int)
- type UserSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserSession ¶
func AddUserSession(s *UserSession, skey string)
AddUserSession add user session
func GetRoleCheck ¶
GetRoleCheck check the given method and URL matches
func GetSecretRoleCheck ¶
GetRoleCheck check the given method and URL matches
func SetSessionErrorFlag ¶
func SetSessionErrorFlag(skey string)
SetSessionErrorFlag ser session errflg
func UpdateUserSessionExpiry ¶
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
Click to show internal directories.
Click to hide internal directories.