Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModuleName = "auth-svc" OrchestratorName = "orchestrator" TokenRegExpStr = `^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$` RefreshCookie = "refresh_token" AccessCookie = "access_token" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateTokens ¶
type ModulePayload ¶
type ModulePayload struct { RequestId string `json:"request_id"` Action string `json:"action"` //other fields that are required for module ModulePermissions ModulePermissions `json:"module_permissions,omitempty"` ModuleName string `json:"module_name"` }
type ModulePermission ¶
type ModulePermissions ¶
type ModulePermissions map[string]StatusPermission
type Permission ¶
type Permission struct { Id int64 `db:"id" structs:"-"` ModuleId int64 `db:"module_id" structs:"module_id"` Name string `db:"name" structs:"name"` Status UserStatus `db:"status" structs:"status"` *Module `db:"-" structs:",omitempty"` }
type Permissions ¶
type Permissions interface { New() Permissions Insert(permission Permission) error Select() ([]ModulePermission, error) Get() (*ModulePermission, error) Delete() error IncludeModules() Permissions FilterByStatus(status UserStatus) Permissions }
type RefreshToken ¶
type RefreshTokens ¶
type RefreshTokens interface { New() RefreshTokens Create(token RefreshToken) error Get() (*RefreshToken, error) Select() ([]RefreshToken, error) Delete() error FilterByTokens(tokens ...string) RefreshTokens FilterByLowerValidTill(expiresAtUnix int64) RefreshTokens }
type StatusPermission ¶
type User ¶
type User struct { Id int64 `db:"id" structs:"-"` Email string `db:"email" structs:"email"` Password string `db:"password" structs:"password"` Status UserStatus `db:"status" structs:"status"` }
type UserStatus ¶
type UserStatus string
const ( SUPER_ADMIN UserStatus = "super_admin" ADMIN UserStatus = "admin" USER UserStatus = "user" )
Click to show internal directories.
Click to hide internal directories.