Versions in this module Expand all Collapse all v0 v0.5.0 Jan 8, 2026 v0.4.0 Aug 16, 2025 v0.3.0 Feb 22, 2025 v0.2.0 Feb 9, 2025 Changes in this version + var PermissionPrefix = []string v0.1.0 Dec 9, 2024 Changes in this version + const CheckDefaultPassword + const LOGON32_LOGON_INTERACTIVE — windows/amd64 + const LOGON32_PROVIDER_DEFAULT — windows/amd64 + var DefaultRoles = []string + var JWTOperator = JWTValidate(&DefaultJWTHandler{ ... }) + var PrincipalCreater func(session *SessionInfo, user, pass string) PrincipalInterface + var TriggerInvalidUUID func(*SessionInfo, *UserInfo) + func CallbackInit(auth *AuthenticationServer) error + func ClearCallbacks() + func ClearUsers() + func CountLoginUser(passwordFile string) int + func DecryptData(token string) (string, error) + func EncryptData(data string) (string, error) + func GenerateHash(enc, password string) string + func InitLoginService(auth *Authentication) error + func InitOIDC(auth *AuthenticationServer) error + func InitPasswordFile(passwordFile string) (err error) + func InvalidateUUID(uuid string, elapsed time.Time) bool + func LoadUsers(role AccessRole, file string) error + func Register(r func(PrincipalInterface) error) + func RegisterCallback(callback CallbackInterface) + func RegisterDatabaseForAuth(layer, URL, query string) + func RegisterPlugin() + func RegisterTargetForAuth(layer, URL, query string) + func RemoveLoginService(auth *Authentication) + func RemovePasswordFile(passwordFile string) + func ValidAdmin(user string) bool + func ValidUser(role AccessRole, writeAccess bool, user *UserInfo, resource string) bool + type AccessRole int + const AdministratorRole + const UserRole + type Authentication struct + AuthenticationServer []*AuthenticationServer + var AuthenticationConfig *Authentication + type AuthenticationServer struct + AuthMethod Method + ClientID string + ClientSecret string + Comment string + LDAP []Source + Layer string + Module string + PasswordFile string + RedirectURL string + Target string + Type string + URL string + func (service *AuthenticationServer) Authenticate(principal PrincipalInterface, user, passwd string) error + type CallbackInterface interface + Authenticate func(principal PrincipalInterface, userName, passwd string) error + CheckToken func(token string, scopes []string) (PrincipalInterface, error) + GenerateToken func(IAt string, principal PrincipalInterface) (tokenString string, err error) + GetName func() string + Init func() error + type Default struct + Read string + ReadMap map[string]bool + Write string + WriteMap map[string]bool + type DefaultJWTHandler struct + func (df *DefaultJWTHandler) InvalidateUUID(uuid string, elapsed time.Time) bool + func (df *DefaultJWTHandler) Range(f func(uuid, value any) bool) error + func (df *DefaultJWTHandler) Store(principal PrincipalInterface, user, pass string) error + func (df *DefaultJWTHandler) UUIDInfo(uuid string) (*SessionInfo, error) + func (df *DefaultJWTHandler) ValidateUUID(claims *JWTClaims) (PrincipalInterface, bool) + type JWTClaims struct + Audience string + ExpiresAt *jwt.NumericDate + IAt string + ID string + Issuer string + Remote string + Roles []string + Subject string + UUID string + type JWTValidate interface + InvalidateUUID func(string, time.Time) bool + Range func(func(uuid, value any) bool) error + Store func(PrincipalInterface, string, string) error + UUIDInfo func(uuid string) (*SessionInfo, error) + ValidateUUID func(claims *JWTClaims) (PrincipalInterface, bool) + type Method int + const CallbackMethod + const FileMethod + const LDAPMethod + const OIDCClientMethod + const OpenIDMethod + const PluginMethod + const SQLDatabaseMethod + const SystemMethod + const UnknownMethod + func MethodType(s string) Method + func (authMethod Method) String() string + type PasswordFileStruct struct + Counter uint64 + func NewAppendPasswordFile(realmFile string) *PasswordFileStruct + func NewInitFileRealm(realmFile string, createAutogenerated bool) (*PasswordFileStruct, error) + func (rfs *PasswordFileStruct) AppendUserToPasswordFile(user, newPassword, roles string) error + func (rfs *PasswordFileStruct) CheckUser(u string) bool + func (rfs *PasswordFileStruct) Close() + func (rfs *PasswordFileStruct) CountLoginUser() int + func (rfs *PasswordFileStruct) CreateDefaultRealm() (err error) + func (rfs *PasswordFileStruct) CreateDefaultUser() error + func (rfs *PasswordFileStruct) FlushUserToPasswordFile() error + func (rfs *PasswordFileStruct) LoadPasswordFile() (err error) + func (rfs *PasswordFileStruct) UpdateUserPasswordToRealmFile(user, newPassword string) error + type PrincipalInterface interface + AddRoles func([]string) + Name func() string + Remote func() string + Roles func() []string + Session func() interface{} + SetRemote func(string) + SetSession func(interface{}) + UUID func() string + func BasicAuth(user string, pass string) (PrincipalInterface, error) + type SearchResult struct + IsAdmin bool + IsRestricted bool + Mail string + Name string + Surname string + Username string + type SecurityProtocol int + const SecurityProtocolLDAPS + const SecurityProtocolStartTLS + const SecurityProtocolUnencrypted + type SessionInfo struct + Created time.Time + Data []byte + Invalidated time.Time + LastAccess time.Time + UUID string + User string + func NewSessionInfo(user string) *SessionInfo + func UUIDInfo(uuid string) (*SessionInfo, error) + type Source struct + AdminFilter string + AttributeMail string + AttributeName string + AttributeSurname string + AttributeUsername string + AttributesInBind bool + BindDN string + BindPassword string + Enabled bool + Filter string + GroupDN string + GroupFilter string + GroupMemberUID string + GroupsEnabled bool + Host string + Name string + Port int + RestrictedFilter string + SearchPageSize uint32 + SecurityProtocol SecurityProtocol + SkipVerify bool + UserBase string + UserDN string + UserUID string + func (src *Source) SearchEntries() ([]*SearchResult, error) + func (src *Source) SearchEntry(name, passwd string, directBind bool) (*SearchResult, error) + func (src *Source) UsePagedSearch() bool + type User struct + Name string + Read string + ReadMap map[string]bool + Write string + WriteMap map[string]bool + func (user *User) InitPermission(d *Default) + type UserInfo struct + Administrator bool + Created time.Time + EMail string + LastLogin time.Time + LongName string + Permission *User + Picture []byte + User string + type Users struct + Default *Default + File string + Role AccessRole + User []*User + UserMap map[string]*User + var AllowedAdministrators *Users = nil + var AllowedUsers *Users = nil + func (users *Users) Add(user string) error + func (users *Users) Delete(user string) error + type WebToken struct + Comment string + Encrypt bool + Expirer string + IssuerName string + OAuth2 bool + PassToken string + PrivateKey string + PublicKey string + var WebTokenConfig *WebToken + func (webToken *WebToken) GenerateJWToken(IAt string, principal PrincipalInterface) (tokenString string, err error) + func (webToken *WebToken) InitWebTokenJose2() error + func (webToken *WebToken) InitWebTokenOIDC() error + func (webToken *WebToken) JWTContainsRoles(token string, scopes []string) (PrincipalInterface, error)