Documentation ¶
Index ¶
Constants ¶
View Source
const ENABLE_SECURITY = true
noinspection GoUnusedConst,GoSnakeCaseUsage
Variables ¶
View Source
var ROLES = []Role{ ANONYMOUS, USER, ADMINISTRATOR, }
Functions ¶
This section is empty.
Types ¶
type IAccessControlHandler ¶
type ISecurityHandler ¶
type ISecurityHandler interface { AccessControlHandler() IAccessControlHandler SetAccessControlHandler(IAccessControlHandler) Validate(phoneNumber string, password string) (string, error) Verify(token string, confirmationCode string) (string, uint64, error) RefreshTokenCache(identity Identity, token string) error Authenticate(token string, role Role, remoteAddress string, userAgent string) Identity SignOut(Identity) error }
type Identity ¶
type Identity interface { Id() int64 Username() string PhoneNumber() string FirstName() string LastName() string Email() string Token() string SetToken(token string) MultiFactor() bool RemoteAddress() string SetRemoteAddress(string) UserAgent() string SetUserAgent(string) Hash() string Salt() string Permission() uint64 Restriction() uint32 Role() Role IsInRole(role Role) bool IsRestricted() bool IsNotRestricted() bool Payload() Pointer Lock(uint64) Unlock(uint64) SetSystemCallHandler(func(Identity, []string) error) SystemCall(Identity, []string) error }
type IdentityCache ¶
type IdentityCache interface { Put(int64, Identity) Remove(int64) Get(int64) (Identity, bool) Size() int GetByToken(string) (Identity, bool) GetByUsername(string) (Identity, bool) GetByPhoneNumber(string) (Identity, bool) RefreshToken(Identity, string) ForEachValue(func(ISystemObject)) Load(map[int64]ISystemObject) Clear() OnChanged(func()) StoreAuthorizationInfo(string, string, string) RetrieveAuthorizationInfo(string) (string, string, error) }
Click to show internal directories.
Click to hide internal directories.