Documentation
¶
Index ¶
- Constants
- Variables
- func AddAdapter(adapter *Adapter) (bool, error)
- func AddApplication(application *Application) (bool, error)
- func AddCert(cert *Cert) (bool, error)
- func AddEnforcer(enforcer *Enforcer) (bool, error)
- func AddForm(form *Form) (bool, error)
- func AddGroup(group *Group) (bool, error)
- func AddGroups(groups []*Group) (bool, error)
- func AddGroupsInBatch(groups []*Group) (bool, error)
- func AddInvitation(invitation *Invitation, lang string) (bool, error)
- func AddKey(key *Key) (bool, error)
- func AddLdap(ldap *Ldap) (bool, error)
- func AddModel(model *Model) (bool, error)
- func AddOrUpdateResource(resource *Resource) (bool, error)
- func AddOrganization(organization *Organization) (bool, error)
- func AddPermission(permission *Permission) (bool, error)
- func AddPermissions(permissions []*Permission) (bool, error)
- func AddPermissionsInBatch(permissions []*Permission) (bool, error)
- func AddPolicy(id string, ptype string, policy []string) (bool, error)
- func AddPrices(price1 float64, price2 float64) float64
- func AddProject(project *Project) (bool, error)
- func AddProvider(provider *Provider) (bool, error)
- func AddRadiusAccounting(ra *RadiusAccounting) error
- func AddRecord(record *Record) bool
- func AddResource(resource *Resource) (bool, error)
- func AddRole(role *Role) (bool, error)
- func AddRoles(roles []*Role) bool
- func AddRolesInBatch(roles []*Role) bool
- func AddRule(rule *Rule) (bool, error)
- func AddServer(server *Server) (bool, error)
- func AddSession(session *Session) (bool, error)
- func AddSite(site *Site) (bool, error)
- func AddSyncer(syncer *Syncer) (bool, error)
- func AddTicket(ticket *Ticket) (bool, error)
- func AddTicketMessage(id string, message *TicketMessage) (bool, error)
- func AddToVerificationRecord(user *User, provider *Provider, organization *Organization, ...) error
- func AddToken(token *Token) (bool, error)
- func AddUser(user *User, lang string) (bool, error)
- func AddUserKeys(user *User, isAdmin bool) (bool, error)
- func AddUserToOriginalDatabase(user *User) error
- func AddUsers(users []*User) (bool, error)
- func AddUsersInBatch(users []*User) (bool, error)
- func AddWebhook(webhook *Webhook) (bool, error)
- func AdminAPIAdapterName() string
- func AdminAPIEnforcerName() string
- func AdminAPIModelName() string
- func AdminAppOrganization() string
- func AdminCertName() string
- func AdminPermissionName() string
- func AdminUserAdapterName() string
- func AdminUserEnforcerName() string
- func AdminUserModelName() string
- func BatchEnforce(permission *Permission, requests [][]string, permissionIds ...string) ([]bool, error)
- func CheckAccountItemModifyRule(accountItem *AccountItem, isAdmin bool, lang string) (bool, string)
- func CheckApiPermission(userId string, organization string, path string, method string) (bool, error)
- func CheckCasLogin(application *Application, lang string, service string) error
- func CheckConsentRequired(userObj *User, application *Application, scopeStr string) (bool, error)
- func CheckEntryIp(clientIp string, user *User, application *Application, ...) error
- func CheckFaceId(user *User, faceId []float64, lang string) error
- func CheckInvitationDefaultCode(code string, defaultCode string, lang string) error
- func CheckIpWhitelist(ipWhitelistStr string, lang string) error
- func CheckLdapExist(ldap *Ldap) (bool, error)
- func CheckLdapUserPassword(user *User, password string, lang string, options ...bool) error
- func CheckLoginPermission(userId string, application *Application) (bool, error)
- func CheckPassword(user *User, password string, lang string, options ...bool) error
- func CheckPasswordComplexity(user *User, password string, lang string) string
- func CheckPasswordComplexityByOrg(organization *Organization, password string, lang string) string
- func CheckPasswordNotSameAsCurrent(user *User, newPassword string, organization *Organization) bool
- func CheckPermissionForUpdateUser(oldUser, newUser *User, isAdmin bool, allowDisplayNameEmpty bool, lang string) (bool, string)
- func CheckSigninCode(user *User, dest, code, lang string) error
- func CheckToEnableCaptcha(application *Application, organization, username string, clientIp string) (bool, error)
- func CheckUpdateUser(oldUser, user *User, lang string) string
- func CheckUserIsAdminRaw(owner, name string) bool
- func CheckUserPermission(requestUserId, userId string, strict bool, lang string) (bool, error)
- func CheckUserSignup(application *Application, organization *Organization, authForm *form.AuthForm, ...) string
- func CheckUsername(username string, lang string) string
- func CheckUsernameWithEmail(username string, lang string) string
- func CheckVerifyCodeWithLimit(user *User, dest, code, lang string) error
- func CleanupExpiredRevokedTokens() (int64, error)
- func CleanupTokens(tokenRetentionIntervalAfterExpiry int) error
- func ClearThroughputPerSecond()
- func ClearUserOAuthProperties(user *User, providerType string) (bool, error)
- func ContextWithOrgEngine(ctx context.Context, owner string) context.Context
- func ConvertCurrency(amount float64, fromCurrency, toCurrency string) float64
- func CreateTables()
- func DeleteAdapter(adapter *Adapter) (bool, error)
- func DeleteAllUserSessions(owner string, name string) (bool, error)
- func DeleteApplication(application *Application) (bool, error)
- func DeleteBeegoSession(sessionIds []string)
- func DeleteCert(cert *Cert) (bool, error)
- func DeleteEnforcer(enforcer *Enforcer) (bool, error)
- func DeleteFile(provider *Provider, objectKey string, lang string) error
- func DeleteForm(form *Form) (bool, error)
- func DeleteGroup(group *Group) (bool, error)
- func DeleteGroupForUser(user string, group string) (bool, error)
- func DeleteInvitation(invitation *Invitation) (bool, error)
- func DeleteKey(key *Key) (bool, error)
- func DeleteLdap(ldap *Ldap) (bool, error)
- func DeleteModel(model *Model) (bool, error)
- func DeleteOrganization(organization *Organization) (bool, error)
- func DeletePermission(permission *Permission) (bool, error)
- func DeleteProject(project *Project) (bool, error)
- func DeleteProvider(provider *Provider) (bool, error)
- func DeleteRadiusAccounting(ra *RadiusAccounting) error
- func DeleteResource(resource *Resource) (bool, error)
- func DeleteRole(role *Role) (bool, error)
- func DeleteRule(rule *Rule) (bool, error)
- func DeleteServer(server *Server) (bool, error)
- func DeleteSession(id, curSessionId string) (bool, error)
- func DeleteSessionId(id string, sessionId string) (bool, error)
- func DeleteSite(site *Site) (bool, error)
- func DeleteSyncer(syncer *Syncer) (bool, error)
- func DeleteTicket(ticket *Ticket) (bool, error)
- func DeleteToken(token *Token) (bool, error)
- func DeleteUser(user *User) (bool, error)
- func DeleteWebhook(webhook *Webhook) (bool, error)
- func DialWithCert(SshUser string, CertId string, SshHost string, SshPort int) (*ssh.Client, error)
- func DialWithPassword(SshUser string, SshPassword string, SshHost string, SshPort int) (*ssh.Client, error)
- func DialWithPrivateKey(SshUser string, PrivateKey []byte, SshHost string, SshPort int) (*ssh.Client, error)
- func DisableVerificationCode(dest string) error
- func DisabledMultiFactorAuth(user *User) error
- func DownloadAndUpload(url string, fullFilePath string, lang string) (err error)
- func DumpToFile(filePath string) error
- func Enforce(permission *Permission, request []string, permissionIds ...string) (bool, error)
- func EvictAppCache(owner, name string)
- func EvictAppCacheByClientId(clientId string)
- func EvictCertCache(name string)
- func EvictOrgCache(owner, name string)
- func EvictPermCache(userId string)
- func EvictUserCache(owner, name string)
- func ExpireTokenByAccessToken(accessToken string) (bool, *Application, *Token, error)
- func ExpireTokenByUser(owner, username string) (bool, error)
- func ExtendGroupWithUsers(group *Group) error
- func ExtendGroupsWithUsers(groups []*Group) error
- func ExtendUserWithRolesAndPermissions(user *User) (err error)
- func FromProviderToIdpInfo(ctx *context.Context, provider *Provider) (*idp.ProviderInfo, error)
- func GenerateCasToken(userId string, service string) (string, error)
- func GenerateId()
- func GenerateIdForNewUser(application *Application) (string, error)
- func GenerateSamlRequest(id, relayState, host, lang string) (auth string, method string, err error)
- func GetAccessTokenByUser(user *User, host string) (string, error)
- func GetAcmeClient(useProxy bool) (*lego.Client, error)
- func GetAdapterCount(owner, field, value string) (int64, error)
- func GetAllActions(userId string) ([]string, error)
- func GetAllObjects(userId string) ([]string, error)
- func GetAllRoles(userId string) ([]string, error)
- func GetApiKeyToken(application *Application, accessKey string, accessSecret string, scope string, ...) (*Token, *TokenError, error)
- func GetApplicationCount(owner, field, value string) (int64, error)
- func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string, ...) (*Token, *TokenError, error)
- func GetBuiltInModel(modelText string) (authzmodel.Model, error)
- func GetCaptcha() (string, []byte, error)
- func GetCertCount(owner, field, value string) (int64, error)
- func GetClientCredentialsToken(application *Application, clientSecret string, scope string, host string) (*Token, *TokenError, error)
- func GetDashboard(owner string) (*map[string][]int64, error)
- func GetDomainExpireTime(domainName string) (string, error)
- func GetEnforcerCount(owner, field, value string) (int64, error)
- func GetExchangeRate(fromCurrency, toCurrency string) float64
- func GetExistUuids(owner string, uuids []string) ([]string, error)
- func GetExportFilePath() string
- func GetFailedSigninConfigByUser(user *User) (int, int, error)
- func GetFaviconUrl(htmlStr string) (string, error)
- func GetFilteredPolicies(id string, ptype string, fieldIndex int, fieldValues ...string) ([]*util.AuthzRule, error)
- func GetFilteredPoliciesMulti(id string, filters []Filter) ([]*util.AuthzRule, error)
- func GetFormCount(owner string, field, value string) (int64, error)
- func GetGlobalCertsCount(field, value string) (int64, error)
- func GetGlobalKeyCount(field, value string) (int64, error)
- func GetGlobalProviderCount(field, value string) (int64, error)
- func GetGlobalUserCount(field, value string) (int64, error)
- func GetGroupCount(owner, field, value string) (int64, error)
- func GetGroupUserCount(groupId string, field, value string) (int64, error)
- func GetGroupWithPrefix(group string) string
- func GetGroupWithoutPrefix(group string) string
- func GetGroupsHaveChildrenMap(groups []*Group) (map[string]*Group, error)
- func GetIdvProviderFromProvider(provider *Provider) idv.IdvProvider
- func GetImplicitToken(application *Application, username string, scope string, nonce string, ...) (*Token, *TokenError, error)
- func GetInitDataDiagnostics() map[string]interface{}
- func GetInvitationCount(owner, field, value string) (int64, error)
- func GetJwksBytes(applicationName string) (body []byte, etag string, err error)
- func GetJwtBearerToken(application *Application, assertion string, scope string, nonce string, ...) (*Token, *TokenError, error)
- func GetKeyCount(owner, field, value string) (int64, error)
- func GetModelCount(owner, field, value string) (int64, error)
- func GetOAuthToken(grantType string, clientId string, clientSecret string, code string, ...) (interface{}, error)
- func GetOnlineUserCount(owner string, isOnline int) (int64, error)
- func GetOrgEngineFromContext(ctx context.Context) *xorm.Engine
- func GetOrganizationApplicationCount(owner, organization, field, value string) (int64, error)
- func GetOrganizationCount(owner, name, field, value string) (int64, error)
- func GetPasswordToken(application *Application, username string, password string, scope string, ...) (*Token, *TokenError, error)
- func GetPermissionCount(owner, field, value string) (int64, error)
- func GetPolicies(id string) ([]*util.AuthzRule, error)
- func GetProjectCount(owner, field, value string) (int64, error)
- func GetProviderCount(owner, field, value string) (int64, error)
- func GetRecordCount(field, value string, filterRecord *Record) (int64, error)
- func GetResourceCount(owner, user, field, value string) (int64, error)
- func GetRevokedTokenCount(owner string, application string) (int64, error)
- func GetRoleCount(owner, field, value string) (int64, error)
- func GetRuleCount(owner, field, value string) (int64, error)
- func GetSamlRedirectAddress(owner string, application string, relayState string, samlRequest string, ...) string
- func GetSamlResponse(application *Application, user *User, samlRequest string, host string) (string, string, string, error)
- func GetServerCount(owner, field, value string) (int64, error)
- func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session
- func GetSessionCount(owner, field, value string) (int64, error)
- func GetSessionForUser(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session
- func GetSiteCount(owner, field, value string) (int64, error)
- func GetSyncerCount(owner, organization, field, value string) (int64, error)
- func GetTicketCount(owner, field, value string) (int64, error)
- func GetTokenCount(owner, organization, field, value string) (int64, error)
- func GetTokenExchangeToken(application *Application, clientSecret string, subjectToken string, ...) (*Token, *TokenError, error)
- func GetTruncatedPath(provider *Provider, fullFilePath string, limit int) string
- func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool) (string, string)
- func GetUserCount(owner, field, value string, groupName string) (int64, error)
- func GetUserField(user *User, field string) string
- func GetUserFieldStringValue(user *User, fieldName string) (bool, string, error)
- func GetUserOAuthAccessToken(user *User, providerType string) string
- func GetUserOAuthRefreshToken(user *User, providerType string) string
- func GetValidationBySaml(samlRequest string, host string) (string, string, error)
- func GetVerificationCount(owner, field, value string) (int64, error)
- func GetVerifyType(username string) (verificationCodeType string)
- func GetWebAuthnObject(host string) (*webauthn.WebAuthn, error)
- func GetWebhookCount(owner, organization, field, value string) (int64, error)
- func GetWechatMiniProgramToken(application *Application, code string, host string, username string, ...) (*Token, *TokenError, error)
- func GroupChangeTrigger(oldName, newName string) error
- func GroupPermissionsByModelAdapter(permissions []*Permission) map[string][]string
- func HasRoleDefinition(m authzmodel.Model) bool
- func HasUserByField(organizationName string, field string, value string) bool
- func InitAdapter()
- func InitCleanupTokens()
- func InitConfig()
- func InitDb()
- func InitDefaultStorageProvider()
- func InitFlag()
- func InitFromFile()
- func InitKMS()
- func InitLdapAutoSynchronizer()
- func InitRuleMap()
- func InitSiteMap()
- func InitUserManager()
- func InterimUpdateRadiusAccounting(oldRa *RadiusAccounting, newRa *RadiusAccounting, stop bool) error
- func InvalidateJwksCache()
- func IsAllowSend(user *User, remoteAddr, recordType string, application *Application) error
- func IsAppUser(userId string) bool
- func IsGrantTypeValid(method string, grantTypes []string) bool
- func IsNeedPromptMfa(org *Organization, user *User) bool
- func IsOriginAllowed(origin string) (bool, error)
- func IsScopeValid(scope string, application *Application) bool
- func IsScopeValidAndExpand(scope string, application *Application) (string, bool)
- func IsSessionDuplicated(id string, sessionId string) (bool, error)
- func IsTokenRevoked(tokenValue string) (bool, error)
- func IsTokenRevokedByHash(tokenHash string) (bool, error)
- func LinkUserAccount(user *User, field string, value string) (bool, error)
- func MfaRecover(user *User, recoveryCode string) error
- func MoveUserToOrg(user *User, newOrg string) (bool, error)
- func NewSamlResponse(application *Application, user *User, host string, certificate string, ...) (*etree.Element, error)
- func NewSamlResponse11(application *Application, user *User, requestID string, host string) (*etree.Element, error)
- func OrgIsolationEnabled() bool
- func ParseJwtTokenWithoutValidation(token string) (*jwt.Token, error)
- func ParseSamlResponse(samlResponse string, provider *Provider, host string) (*idp.UserInfo, error)
- func PromoteByEmailDomain(user *User) (bool, error)
- func RefreshToken(application *Application, grantType string, refreshToken string, scope string, ...) (interface{}, error)
- func RegisterDynamicClient(req *DynamicClientRegistrationRequest, organization string) (*DynamicClientRegistrationResponse, *DcrError, error)
- func RemovePolicy(id string, ptype string, policy []string) (bool, error)
- func RenewCert(cert *Cert) (bool, error)
- func ResetLdapPassword(user *User, oldPassword string, newPassword string, lang string) error
- func RevokeToken(tokenValue string, tokenType string, revokedBy string, clientId string, ...) error
- func RevokeTokenByHash(tokenHash string, tokenType string, revokedBy string, clientId string, ...) error
- func RunSyncUsersJob()
- func RunSyncer(syncer *Syncer) error
- func SendEmail(provider *Provider, title string, content string, dest []string, sender string) error
- func SendNotification(provider *Provider, content string) error
- func SendSms(provider *Provider, content string, phoneNumbers ...string) error
- func SendSsoLogoutNotifications(user *User, sessionIds []string, tokens []*Token) error
- func SendVerificationCodeToEmail(organization *Organization, user *User, provider *Provider, remoteAddr string, ...) error
- func SendVerificationCodeToPhone(organization *Organization, user *User, provider *Provider, remoteAddr string, ...) error
- func SendWebhooks(record *Record) error
- func SetPreferredMultiFactorAuth(user *User, mfaType string) error
- func SetUserField(user *User, field string, value string) (bool, error)
- func SetUserOAuthProperties(organization *Organization, user *User, providerType string, ...) (bool, error)
- func ShouldExportData() bool
- func SplitOriginList(s string) []string
- func StartMonitorSitesLoop()
- func StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
- func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
- func StringArrayToStruct[T any](stringArray [][]string) ([]*T, error)
- func SyncLdapGroups(owner string, ldapGroups []LdapGroup, ldapId string) (newGroups int, updatedGroups int, err error)
- func SyncLdapUsers(owner string, syncUsers []LdapUser, ldapId string) (existUsers []LdapUser, failedUsers []LdapUser, err error)
- func TestSmtpServer(provider *Provider) error
- func TestSyncer(syncer Syncer) error
- func TriggerWebhookForUser(action string, user *User)
- func UpdateAdapter(id string, adapter *Adapter) (bool, error)
- func UpdateApplication(id string, application *Application, isGlobalAdmin bool, lang string) (bool, error)
- func UpdateCert(id string, cert *Cert) (bool, error)
- func UpdateEnforcer(id string, enforcer *Enforcer) (bool, error)
- func UpdateForm(id string, form *Form) (bool, error)
- func UpdateGroup(id string, group *Group) (bool, error)
- func UpdateInvitation(id string, invitation *Invitation, lang string) (bool, error)
- func UpdateKey(id string, key *Key) (bool, error)
- func UpdateLdap(ldap *Ldap) (bool, error)
- func UpdateLdapSyncTime(ldapId string) error
- func UpdateModel(id string, modelObj *Model) (bool, error)
- func UpdateModelWithCheck(id string, modelObj *Model) error
- func UpdateOrganization(id string, organization *Organization, isGlobalAdmin bool) (bool, error)
- func UpdateOrganizationBalance(owner string, name string, balance float64, currency string, isOrgBalance bool, ...) error
- func UpdatePermission(id string, permission *Permission) (bool, error)
- func UpdatePolicy(id string, ptype string, oldPolicy []string, newPolicy []string) (bool, error)
- func UpdateProject(id string, project *Project) (bool, error)
- func UpdateProvider(id string, provider *Provider) (bool, error)
- func UpdateRadiusAccounting(id string, ra *RadiusAccounting) error
- func UpdateResource(id string, resource *Resource) (bool, error)
- func UpdateRole(id string, role *Role) (bool, error)
- func UpdateRule(id string, rule *Rule) (bool, error)
- func UpdateServer(id string, server *Server) (bool, error)
- func UpdateSession(id string, session *Session) (bool, error)
- func UpdateSite(id string, site *Site) (bool, error)
- func UpdateSiteNoRefresh(id string, site *Site) (bool, error)
- func UpdateSyncer(id string, syncer *Syncer, isGlobalAdmin bool, lang string) (bool, error)
- func UpdateTicket(id string, ticket *Ticket) (bool, error)
- func UpdateToken(id string, token *Token, isGlobalAdmin bool) (bool, error)
- func UpdateUser(id string, user *User, columns []string, isAdmin bool) (bool, error)
- func UpdateUserBalance(owner string, name string, balance float64, currency string, lang string) error
- func UpdateUserForAllFields(id string, user *User) (bool, error)
- func UpdateUserToOriginalDatabase(user *User) error
- func UpdateWebhook(id string, webhook *Webhook, isGlobalAdmin bool, lang string) (bool, error)
- func UploadFileSafe(provider *Provider, fullFilePath string, fileBuffer *bytes.Buffer, lang string) (string, string, error)
- func UploadGroups(owner string, path string) (bool, error)
- func UploadPermissions(owner string, path string) (bool, error)
- func UploadRoles(owner string, path string) (bool, error)
- func UploadUsers(owner string, path string, userObj *User, lang string) (bool, error)
- func ValidateKerberosToken(organization *Organization, spnegoTokenBase64 string) (string, error)
- func VerifyCaptcha(id string, digits string) bool
- func VerifyInvitation(id string) (attachInfo map[string]interface{}, err error)
- func VerifySsoLogoutSignature(clientSecret string, notification *SsoLogoutNotification) bool
- type AccountItem
- type ActiveDirectorySyncerProvider
- func (p *ActiveDirectorySyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *ActiveDirectorySyncerProvider) Close() error
- func (p *ActiveDirectorySyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *ActiveDirectorySyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *ActiveDirectorySyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *ActiveDirectorySyncerProvider) InitAdapter() error
- func (p *ActiveDirectorySyncerProvider) TestConnection() error
- func (p *ActiveDirectorySyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type Adapter
- type Address
- type Affiliation
- type Application
- func CheckOAuthLogin(clientId string, responseType string, redirectUri string, scope string, ...) (string, *Application, error)
- func FindApplicationByName(name, orgHint string) (*Application, error)
- func GetAllowedApplications(applications []*Application, userId string, lang string) ([]*Application, error)
- func GetApplication(id string) (*Application, error)
- func GetApplicationByClientId(clientId string) (*Application, error)
- func GetApplicationByOrganizationName(organization string) (*Application, error)
- func GetApplicationByUser(user *User) (*Application, error)
- func GetApplicationByUserId(userId string) (application *Application, err error)
- func GetApplications(owner string) ([]*Application, error)
- func GetDefaultApplication(id string) (*Application, error)
- func GetMaskedApplication(application *Application, userId string) *Application
- func GetMaskedApplications(applications []*Application, userId string) []*Application
- func GetOrganizationApplications(owner string, organization string) ([]*Application, error)
- func GetPaginationApplications(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Application, error)
- func GetPaginationOrganizationApplications(owner, organization string, offset, limit int, ...) ([]*Application, error)
- func NewAdminApp() *Application
- func ValidateClientAssertion(clientAssertion string, host string) (bool, *Application, error)
- func (application *Application) GetEmailProvider(method string) (*Provider, error)
- func (application *Application) GetId() string
- func (application *Application) GetProviderByCategory(category string) (*Provider, error)
- func (application *Application) GetProviderByCategoryAndRule(category string, method string, countryCode string) (*Provider, error)
- func (application *Application) GetProviderItem(providerName string) *ProviderItem
- func (application *Application) GetProviderItemByType(providerType string) *ProviderItem
- func (application *Application) GetSignupItemRule(itemName string) string
- func (application *Application) GetSmsProvider(method string, countryCode string) (*Provider, error)
- func (application *Application) GetStorageProvider() (*Provider, error)
- func (application *Application) HasPromptPage() bool
- func (application *Application) IsCodeSigninViaEmailEnabled() bool
- func (application *Application) IsCodeSigninViaSmsEnabled() bool
- func (application *Application) IsFaceIdEnabled() bool
- func (application *Application) IsLdapEnabled() bool
- func (application *Application) IsPasswordEnabled() bool
- func (application *Application) IsPasswordWithLdapEnabled() bool
- func (application *Application) IsRedirectUriValid(redirectUri string) bool
- func (application *Application) IsSignupItemRequired(itemName string) bool
- func (application *Application) IsSignupItemVisible(itemName string) bool
- type Attribute
- type AwsIamSyncerProvider
- func (p *AwsIamSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *AwsIamSyncerProvider) Close() error
- func (p *AwsIamSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *AwsIamSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *AwsIamSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *AwsIamSyncerProvider) InitAdapter() error
- func (p *AwsIamSyncerProvider) TestConnection() error
- func (p *AwsIamSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type AzureAdAccessTokenResp
- type AzureAdSyncerProvider
- func (p *AzureAdSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *AzureAdSyncerProvider) Close() error
- func (p *AzureAdSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *AzureAdSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *AzureAdSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *AzureAdSyncerProvider) InitAdapter() error
- func (p *AzureAdSyncerProvider) TestConnection() error
- func (p *AzureAdSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type AzureAdUser
- type AzureAdUserListResp
- type CasAnyAttribute
- type CasAttributes
- type CasAuthenticationFailure
- type CasAuthenticationSuccess
- type CasAuthenticationSuccessWrapper
- type CasNamedAttribute
- type CasProxies
- type CasProxyFailure
- type CasProxySuccess
- type CasServiceResponse
- type CasUserAttributes
- type Cert
- func GetCert(id string) (*Cert, error)
- func GetCertByDomain(domain string) (*Cert, error)
- func GetCerts(owner string) ([]*Cert, error)
- func GetDefaultCert() (*Cert, error)
- func GetGlobalCerts() ([]*Cert, error)
- func GetMaskedCert(cert *Cert) *Cert
- func GetMaskedCerts(certs []*Cert, err error) ([]*Cert, error)
- func GetPaginationCerts(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Cert, error)
- func GetPaginationGlobalCerts(offset, limit int, field, value, sortField, sortOrder string) ([]*Cert, error)
- type Claims
- type ClaimsShort
- type ClaimsStandard
- type ClaimsWithoutThirdIdp
- type Code
- type ConsentRecord
- type Credential
- type DashboardDateItem
- type DashboardMapItem
- type DatabaseSyncerProvider
- func (p *DatabaseSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *DatabaseSyncerProvider) Close() error
- func (p *DatabaseSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *DatabaseSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *DatabaseSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *DatabaseSyncerProvider) InitAdapter() error
- func (p *DatabaseSyncerProvider) TestConnection() error
- func (p *DatabaseSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type DcrError
- type DeviceAuthCache
- type DeviceAuthResponse
- type DingtalkAccessTokenResp
- type DingtalkDepartment
- type DingtalkDeptDetailResp
- type DingtalkDeptListResp
- type DingtalkResult
- type DingtalkSyncerProvider
- func (p *DingtalkSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *DingtalkSyncerProvider) Close() error
- func (p *DingtalkSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *DingtalkSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *DingtalkSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *DingtalkSyncerProvider) InitAdapter() error
- func (p *DingtalkSyncerProvider) TestConnection() error
- func (p *DingtalkSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type DingtalkUser
- type DingtalkUserListResp
- type DomainPromotion
- type DynamicClientRegistrationRequest
- type DynamicClientRegistrationResponse
- type Enforcer
- type Expression
- type FaceId
- type Filter
- type Form
- func GetForm(id string) (*Form, error)
- func GetForms(owner string) ([]*Form, error)
- func GetGlobalForms() ([]*Form, error)
- func GetMaskedForm(form *Form, isMaskEnabled bool) *Form
- func GetMaskedForms(forms []*Form, isMaskEnabled bool) []*Form
- func GetPaginationForms(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Form, error)
- type FormItem
- type GaugeVecInfo
- type GoogleWorkspaceSyncerProvider
- func (p *GoogleWorkspaceSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *GoogleWorkspaceSyncerProvider) Close() error
- func (p *GoogleWorkspaceSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *GoogleWorkspaceSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *GoogleWorkspaceSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *GoogleWorkspaceSyncerProvider) InitAdapter() error
- func (p *GoogleWorkspaceSyncerProvider) TestConnection() error
- func (p *GoogleWorkspaceSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type Group
- func ConvertToTreeData(groups []*Group, parentId string) []*Group
- func GetGlobalGroups() ([]*Group, error)
- func GetGroup(id string) (*Group, error)
- func GetGroups(owner string) ([]*Group, error)
- func GetPaginationGroups(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Group, error)
- type GroupNode
- type Header
- type HistogramVecInfo
- type HttpProvider
- type HttpSmsClient
- type IdpEntityDescriptor
- type IdpSSODescriptor
- type InitData
- type IntrospectionResponse
- type Invitation
- func CheckInvitationCode(application *Application, organization *Organization, authForm *form.AuthForm, ...) (*Invitation, string)
- func GetInvitation(id string) (*Invitation, error)
- func GetInvitationByCode(code string, organizationName string, lang string) (*Invitation, string)
- func GetInvitations(owner string) ([]*Invitation, error)
- func GetMaskedInvitation(invitation *Invitation) *Invitation
- func GetPaginationInvitations(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Invitation, error)
- func (invitation *Invitation) GetId() string
- func (invitation *Invitation) GetInvitationLink(host string, application string) string
- func (invitation *Invitation) IsInvitationCodeValid(application *Application, invitationCode string, username string, email string, ...) (bool, string)
- func (invitation *Invitation) SimpleCheckInvitationCode(invitationCode string, lang string) (bool, string)
- type JsonWebKeySet
- type JwtItem
- type Key
- func GetGlobalKeys() ([]*Key, error)
- func GetKey(id string) (*Key, error)
- func GetKeyByAccessKey(accessKey string) (*Key, error)
- func GetKeyBySecretKey(secretKey string) (*Key, error)
- func GetKeys(owner string) ([]*Key, error)
- func GetMaskedKey(key *Key, isMaskEnabled bool) *Key
- func GetMaskedKeys(keys []*Key, isMaskEnabled bool, err error) ([]*Key, error)
- func GetPaginationGlobalKeys(offset, limit int, field, value, sortField, sortOrder string) ([]*Key, error)
- func GetPaginationKeys(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Key, error)
- func ResolveAnyKey(token string) (*Key, bool, error)
- type KeyDescriptor
- type KeyInfo
- type KeycloakSyncerProvider
- type LarkAccessTokenResp
- type LarkAvatar
- type LarkDeptListResp
- type LarkStatus
- type LarkSyncerProvider
- func (p *LarkSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *LarkSyncerProvider) Close() error
- func (p *LarkSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *LarkSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *LarkSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *LarkSyncerProvider) InitAdapter() error
- func (p *LarkSyncerProvider) TestConnection() error
- func (p *LarkSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type LarkUser
- type LarkUserListResp
- type Ldap
- type LdapAutoSynchronizer
- type LdapConn
- type LdapGroup
- type LdapUser
- type Link
- type MLDSA65WebKey
- type ManagedAccount
- type MfaAccount
- type MfaInterface
- type MfaItem
- type MfaProps
- type Model
- type NameIDFormat
- type NodeItem
- type OIDCAddress
- type OauthProtectedResourceMetadata
- type OidcDiscovery
- type OktaSyncerProvider
- func (p *OktaSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *OktaSyncerProvider) Close() error
- func (p *OktaSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *OktaSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *OktaSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *OktaSyncerProvider) InitAdapter() error
- func (p *OktaSyncerProvider) TestConnection() error
- func (p *OktaSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type OktaUser
- type OrgDBManager
- type Organization
- func CreatePersonalOrganization(username, displayName string) (*Organization, error)
- func GetMaskedOrganization(organization *Organization, errs ...error) (*Organization, error)
- func GetMaskedOrganizations(organizations []*Organization, errs ...error) ([]*Organization, error)
- func GetOrganization(id string) (*Organization, error)
- func GetOrganizationByUser(user *User) (*Organization, error)
- func GetOrganizations(owner string, name ...string) ([]*Organization, error)
- func GetOrganizationsByFields(owner string, fields ...string) ([]*Organization, error)
- func GetPaginationOrganizations(owner string, name string, offset, limit int, ...) ([]*Organization, error)
- func NewAdminOrg() *Organization
- func NewOrg(name string) *Organization
- type OriginalGroup
- type OriginalUser
- type Ormer
- type PK
- type Permission
- func GetMaskedPermissions(permissions []*Permission) []*Permission
- func GetPaginationPermissions(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Permission, error)
- func GetPermission(id string) (*Permission, error)
- func GetPermissions(owner string) ([]*Permission, error)
- func GetPermissionsByModel(owner string, model string) ([]*Permission, error)
- func GetPermissionsByResource(resourceId string) ([]*Permission, error)
- func GetPermissionsByRole(roleId string) ([]*Permission, error)
- func GetPermissionsBySubmitter(owner string, submitter string) ([]*Permission, error)
- type PnvsSmsClient
- type ProductInfo
- type Project
- type PrometheusInfo
- type Provider
- func GetCaptchaProviderByApplication(applicationId, isCurrentProvider, lang string) (*Provider, error)
- func GetCaptchaProviderByOwnerName(applicationId, lang string) (*Provider, error)
- func GetFaceIdProviderByApplication(applicationId, isCurrentProvider, lang string) (*Provider, error)
- func GetFaceIdProviderByOwnerName(applicationId, lang string) (*Provider, error)
- func GetGlobalProviders() ([]*Provider, error)
- func GetIdvProviderByApplication(applicationId, isCurrentProvider, lang string) (*Provider, error)
- func GetIdvProviderByOwnerName(applicationId, lang string) (*Provider, error)
- func GetMaskedProvider(provider *Provider, isMaskEnabled bool) *Provider
- func GetMaskedProviders(providers []*Provider, isMaskEnabled bool) []*Provider
- func GetPaginationGlobalProviders(offset, limit int, field, value, sortField, sortOrder string) ([]*Provider, error)
- func GetPaginationProviders(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Provider, error)
- func GetProvider(id string) (*Provider, error)
- func GetProviders(owner string) ([]*Provider, error)
- func GetProvidersByCategory(owner string, category string) ([]*Provider, error)
- func GetWechatMiniProgramProvider(application *Application) *Provider
- type ProviderItem
- type PushMfa
- type RadiusAccounting
- type RadiusMfa
- type Record
- func CopyRecord(record *Record) *Record
- func GetPaginationRecords(offset, limit int, field, value, sortField, sortOrder string, ...) ([]*Record, error)
- func GetRecords() ([]*Record, error)
- func GetRecordsByField(record *Record) ([]*Record, error)
- func NewRecord(ctx *context.Context) (*Record, error)
- type Resource
- func GetDirectResources(owner string, user string, provider *Provider, prefix string, lang string) ([]*Resource, error)
- func GetPaginationResources(owner, user string, offset, limit int, ...) ([]*Resource, error)
- func GetResource(id string) (*Resource, error)
- func GetResources(owner string, user string) ([]*Resource, error)
- type Response
- type RevokedToken
- type Role
- func GetAncestorRoles(roleIds ...string) ([]*Role, error)
- func GetMaskedRoles(roles []*Role) []*Role
- func GetPaginationRoles(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Role, error)
- func GetRole(id string) (*Role, error)
- func GetRoles(owner string) ([]*Role, error)
- type Rule
- type SCIMAddress
- type SCIMEmail
- type SCIMListResponse
- type SCIMName
- type SCIMPhoneNumber
- type SCIMSyncerProvider
- func (p *SCIMSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *SCIMSyncerProvider) Close() error
- func (p *SCIMSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *SCIMSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *SCIMSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *SCIMSyncerProvider) InitAdapter() error
- func (p *SCIMSyncerProvider) TestConnection() error
- func (p *SCIMSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type SCIMUser
- type SafeAdapter
- type Saml11AssertionArtifact
- type Saml11Request
- type SamlItem
- type ScopeDescription
- type ScopeItem
- type Server
- type Session
- func GetPaginationSessions(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Session, error)
- func GetSessions(owner string) ([]*Session, error)
- func GetSingleSession(id string) (*Session, error)
- func GetUserAppSessions(owner string, name string, application string) ([]*Session, error)
- func GetUserSessions(owner string, name string) ([]*Session, error)
- type SigninItem
- type SigninMethod
- type SignupItem
- type SingleSignOnService
- type Site
- func GetGlobalSites() ([]*Site, error)
- func GetMaskedSite(site *Site, node string) *Site
- func GetMaskedSites(sites []*Site, node string) []*Site
- func GetPaginationSites(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Site, error)
- func GetSite(id string) (*Site, error)
- func GetSiteByDomain(domain string) *Site
- func GetSites(owner string) ([]*Site, error)
- type SmsMfa
- type SsoLogoutNotification
- type Syncer
- func GetMaskedSyncer(syncer *Syncer, errs ...error) (*Syncer, error)
- func GetMaskedSyncers(syncers []*Syncer, errs ...error) ([]*Syncer, error)
- func GetOrganizationSyncers(owner, organization string) ([]*Syncer, error)
- func GetPaginationSyncers(owner, organization string, offset, limit int, ...) ([]*Syncer, error)
- func GetSyncer(id string) (*Syncer, error)
- func GetSyncers(owner string) ([]*Syncer, error)
- type SyncerProvider
- type TableColumn
- type ThemeData
- type Ticket
- type TicketMessage
- type Token
- func GetPaginationTokens(owner, organization string, offset, limit int, ...) ([]*Token, error)
- func GetToken(id string) (*Token, error)
- func GetTokenByAccessToken(accessToken string) (*Token, error)
- func GetTokenByRefreshToken(refreshToken string) (*Token, error)
- func GetTokenByTokenValue(tokenValue, tokenTypeHint string) (*Token, error)
- func GetTokenByUser(application *Application, user *User, scope string, nonce string, host string) (*Token, error)
- func GetTokens(owner string, organization string) ([]*Token, error)
- func GetTokensByUser(owner, username string) ([]*Token, error)
- type TokenError
- type TokenWrapper
- type Tool
- type TotpMfa
- type User
- func CheckUserPassword(organization string, username string, password string, lang string, ...) (*User, error)
- func ExtendManagedAccountsWithUser(user *User) (*User, error)
- func GetFilteredUser(user *User, isAdmin bool, isAdminOrSelf bool, accountItems []*AccountItem) (*User, error)
- func GetGlobalUsers() ([]*User, error)
- func GetGlobalUsersWithFilter(cond builder.Cond) ([]*User, error)
- func GetGroupUsers(groupId string) ([]*User, error)
- func GetGroupUsersWithoutError(groupId string) []*User
- func GetMaskedUser(user *User, isAdminOrSelf bool, errs ...error) (*User, error)
- func GetMaskedUsers(users []*User, errs ...error) ([]*User, error)
- func GetPaginationGlobalUsers(offset, limit int, field, value, sortField, sortOrder string) ([]*User, error)
- func GetPaginationGroupUsers(groupId string, offset, limit int, field, value, sortField, sortOrder string) ([]*User, error)
- func GetPaginationUsers(owner string, offset, limit int, field, value, sortField, sortOrder string, ...) ([]*User, error)
- func GetSortedUsers(owner string, sorter string, limit int) ([]*User, error)
- func GetUser(id string) (*User, error)
- func GetUserByAccessKey(accessKey string) (*User, error)
- func GetUserByEmail(owner string, email string) (*User, error)
- func GetUserByEmailOnly(email string) (*User, error)
- func GetUserByField(organizationName string, field string, value string) (*User, error)
- func GetUserByFieldCrossOrg(field string, value string) (*User, error)
- func GetUserByFields(organization string, field string) (*User, error)
- func GetUserByInvitationCode(owner string, invitationCode string) (*User, error)
- func GetUserByKerberosName(organizationName string, kerberosUsername string) (*User, error)
- func GetUserByPhone(owner string, phone string) (*User, error)
- func GetUserByPhoneOnly(phone string) (*User, error)
- func GetUserByUserId(owner string, userId string) (*User, error)
- func GetUserByUserIdOnly(userId string) (*User, error)
- func GetUserByWebauthID(webauthId string) (*User, error)
- func GetUserNoCheck(id string) (*User, error)
- func GetUsers(owner string) ([]*User, error)
- func GetUsersByTagWithFilter(owner string, tag string, cond builder.Cond) ([]*User, error)
- func GetUsersWithFilter(owner string, cond builder.Cond) ([]*User, error)
- func NewAdminUser() *User
- func (user *User) AddCredentials(credential webauthn.Credential, isGlobalAdmin bool) (bool, error)
- func (user *User) CheckUserFace(faceIdImage []string, provider *Provider) (bool, error)
- func (user *User) CredentialExcludeList() []protocol.CredentialDescriptor
- func (user *User) DeleteCredentials(credentialIdBase64 string) (bool, error)
- func (user *User) GetCountryCode(countryCode string) string
- func (user *User) GetFriendlyName() string
- func (user *User) GetId() string
- func (user *User) GetMfaProps(mfaType string, masked bool) *MfaProps
- func (user *User) GetPreferredMfaProps(masked bool) *MfaProps
- func (user *User) GetUserFullGroupPath() ([]string, error)
- func (user *User) IsAdminUser() bool
- func (user *User) IsApplicationAdmin(application *Application) bool
- func (user *User) IsGlobalAdmin() bool
- func (user *User) IsMfaEnabled() bool
- func (user *User) UpdateUserHash() error
- func (user *User) UpdateUserPassword(organization *Organization)
- func (user *User) WebAuthnCredentials() []webauthn.Credential
- func (user *User) WebAuthnDisplayName() string
- func (user *User) WebAuthnID() []byte
- func (user *User) WebAuthnIcon() string
- func (user *User) WebAuthnName() string
- type UserGroupEnforcer
- func (e *UserGroupEnforcer) AddGroupForUser(user string, group string) (bool, error)
- func (e *UserGroupEnforcer) AddGroupsForUser(user string, groups []string) (bool, error)
- func (e *UserGroupEnforcer) DeleteGroupForUser(user string, group string) (bool, error)
- func (e *UserGroupEnforcer) DeleteGroupsForUser(user string) (bool, error)
- func (e *UserGroupEnforcer) GetAllUsersByGroup(group string) ([]string, error)
- func (e *UserGroupEnforcer) GetGroupsForUser(user string) ([]string, error)
- func (e *UserGroupEnforcer) GetUserNamesByGroupName(groupName string) ([]string, error)
- func (e *UserGroupEnforcer) UpdateGroupsForUser(user string, groups []string) (bool, error)
- type UserShort
- type UserStandard
- type UserWithoutThirdIdp
- type Userinfo
- type ValidatorFunc
- type VerificationRecord
- func GetPaginationVerifications(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*VerificationRecord, error)
- func GetUserVerifications(owner, user string) ([]*VerificationRecord, error)
- func GetVerification(id string) (*VerificationRecord, error)
- func GetVerifications(owner string) ([]*VerificationRecord, error)
- type VerifyResult
- type ViaSSHDialer
- func (v *ViaSSHDialer) Dial(network, address string) (net.Conn, error)
- func (v *ViaSSHDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error)
- func (v *ViaSSHDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)
- func (v *ViaSSHDialer) MysqlDial(ctx context.Context, addr string) (net.Conn, error)
- func (v *ViaSSHDialer) Open(s string) (_ driver.Conn, err error)
- type WebFinger
- type WebFingerLink
- type Webhook
- type WecomAccessTokenResp
- type WecomDeptListResp
- type WecomSyncerProvider
- func (p *WecomSyncerProvider) AddUser(user *OriginalUser) (bool, error)
- func (p *WecomSyncerProvider) Close() error
- func (p *WecomSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
- func (p *WecomSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
- func (p *WecomSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
- func (p *WecomSyncerProvider) InitAdapter() error
- func (p *WecomSyncerProvider) TestConnection() error
- func (p *WecomSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
- type WecomUser
- type WecomUserListResp
- type X509Certificate
- type X509Data
- type X509Key
Constants ¶
const ( DefaultFailedSigninLimit = 5 DefaultFailedSigninFrozenTime = 15 )
const ( EmailType = "email" SmsType = "sms" TotpType = "app" RadiusType = "radius" PushType = "push" )
const ( MfaSessionUserId = "MfaSessionUserId" NextMfa = "NextMfa" RequiredMfa = "RequiredMfa" )
const ( ProviderTypeGoogleCloudStorage = "Google Cloud Storage" ProviderTypeTencentCloudCOS = "Tencent Cloud COS" ProviderTypeAzureBlob = "Azure Blob" ProviderTypeLocalFileSystem = "Local File System" ProviderTypeMinIO = "MinIO" )
const ( InvalidRequest = "invalid_request" InvalidClient = "invalid_client" InvalidGrant = "invalid_grant" UnsupportedGrantType = "unsupported_grant_type" InvalidScope = "invalid_scope" EndpointError = "endpoint_error" )
const ( UserPropertiesWechatUnionId = "wechatUnionId" UserPropertiesWechatOpenId = "wechatOpenId" )
const ( VerifyTypePhone = "phone" VerifyTypeEmail = "email" )
const ( OidcPathAuthorize = "/v1/iam/oauth/authorize" OidcPathToken = "/v1/iam/oauth/token" OidcPathUserinfo = "/v1/iam/oauth/userinfo" OidcPathDevice = "/v1/iam/oauth/device" OidcPathRegister = "/v1/iam/oauth/register" OidcPathIntrospect = "/v1/iam/oauth/introspect" OidcPathRevoke = "/v1/iam/oauth/revoke" OidcPathEndSession = "/v1/iam/oauth/logout" OidcPathWellKnownBase = "/v1/iam/.well-known" )
Canonical public OIDC paths. The IAM service publishes its discovery doc using ONLY these — external consumers (IdPs, SDKs, OIDC libraries) see exactly one shape per endpoint. Legacy /oauth/*, /login/oauth/*, and /api/* aliases are accepted by routers.PathRewriteFilter but never advertised. /v1/iam/* is the law.
const (
MfaTotpPeriodInSeconds = 30
)
const (
VerificationSuccess = iota
)
Variables ¶
var ( ApiThroughput = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "iam_api_throughput", Help: "The throughput of each api access", }, []string{"path", "method"}) ApiLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "iam_api_latency", Help: "API processing latency in milliseconds", }, []string{"path", "method"}) CpuUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "iam_cpu_usage", Help: "IAM cpu usage", }, []string{"cpuNum"}) MemoryUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "iam_memory_usage", Help: "IAM memory usage in Byte", }, []string{"type"}) TotalThroughput = promauto.NewGauge(prometheus.GaugeOpts{ Name: "iam_total_throughput", Help: "The total throughput of iam", }) )
var ( DefaultApplication = "hanzo-app" DefaultOrganization = "hanzo" )
var DeviceAuthMap = sync.Map{}
var (
ResetLinkReg *regexp.Regexp
)
var (
// SigningMethodMLDSA65 is the JWT signing method for ML-DSA-65.
SigningMethodMLDSA65 *signingMethodMLDSA65
)
var (
SiteMap = map[string]*Site{}
)
var UserAuthzEnforcerId = conf.AdminOrg + "/user-enforcer-" + conf.AdminApp
UserAuthzEnforcerId is the composite ID for the user authz enforcer in the admin org. Derived from conf.AdminOrg / conf.AdminApp at package init; immutable thereafter.
Functions ¶
func AddAdapter ¶
func AddApplication ¶
func AddApplication(application *Application) (bool, error)
func AddEnforcer ¶
func AddGroupsInBatch ¶
func AddInvitation ¶
func AddInvitation(invitation *Invitation, lang string) (bool, error)
func AddOrUpdateResource ¶
func AddOrganization ¶
func AddOrganization(organization *Organization) (bool, error)
func AddPermission ¶
func AddPermission(permission *Permission) (bool, error)
func AddPermissions ¶
func AddPermissions(permissions []*Permission) (bool, error)
func AddPermissionsInBatch ¶
func AddPermissionsInBatch(permissions []*Permission) (bool, error)
func AddProject ¶
func AddProvider ¶
func AddRadiusAccounting ¶
func AddRadiusAccounting(ra *RadiusAccounting) error
func AddResource ¶
func AddRolesInBatch ¶
func AddSession ¶
func AddTicketMessage ¶
func AddTicketMessage(id string, message *TicketMessage) (bool, error)
func AddToVerificationRecord ¶
func AddToVerificationRecord(user *User, provider *Provider, organization *Organization, remoteAddr, recordType, dest, code string) error
func AddUsersInBatch ¶
func AddWebhook ¶
func AdminAPIAdapterName ¶ added in v1.14.21
func AdminAPIAdapterName() string
func AdminAPIEnforcerName ¶ added in v1.14.21
func AdminAPIEnforcerName() string
func AdminAPIModelName ¶ added in v1.14.21
func AdminAPIModelName() string
func AdminAppOrganization ¶ added in v1.14.21
func AdminAppOrganization() string
AdminAppOrganization is the value to drop into Application.Organization / User.SignupApplication when wiring records to the admin app.
func AdminCertName ¶ added in v1.14.21
func AdminCertName() string
AdminCertName is the name of the JWT signing cert for the admin app.
func AdminPermissionName ¶ added in v1.14.21
func AdminPermissionName() string
AdminPermissionName is the name of the admin permission row.
func AdminUserAdapterName ¶ added in v1.14.21
func AdminUserAdapterName() string
AdminUserAdapterName / AdminAPIAdapterName are authz adapter names.
func AdminUserEnforcerName ¶ added in v1.14.21
func AdminUserEnforcerName() string
AdminUserEnforcerName / AdminAPIEnforcerName are authz enforcer names.
func AdminUserModelName ¶ added in v1.14.21
func AdminUserModelName() string
AdminUserModelName / AdminAPIModelName are authz model names.
func BatchEnforce ¶
func BatchEnforce(permission *Permission, requests [][]string, permissionIds ...string) ([]bool, error)
func CheckAccountItemModifyRule ¶
func CheckAccountItemModifyRule(accountItem *AccountItem, isAdmin bool, lang string) (bool, string)
func CheckApiPermission ¶
func CheckCasLogin ¶
func CheckCasLogin(application *Application, lang string, service string) error
func CheckConsentRequired ¶
func CheckConsentRequired(userObj *User, application *Application, scopeStr string) (bool, error)
CheckConsentRequired checks if user consent is required for the OAuth flow
func CheckEntryIp ¶
func CheckEntryIp(clientIp string, user *User, application *Application, organization *Organization, lang string) error
func CheckIpWhitelist ¶
func CheckLdapExist ¶
func CheckLdapUserPassword ¶
func CheckLoginPermission ¶
func CheckLoginPermission(userId string, application *Application) (bool, error)
func CheckPassword ¶
func CheckPasswordComplexity ¶
func CheckPasswordComplexityByOrg ¶
func CheckPasswordComplexityByOrg(organization *Organization, password string, lang string) string
func CheckPasswordNotSameAsCurrent ¶
func CheckPasswordNotSameAsCurrent(user *User, newPassword string, organization *Organization) bool
CheckPasswordNotSameAsCurrent checks if the new password is different from the current password
func CheckSigninCode ¶
func CheckToEnableCaptcha ¶
func CheckToEnableCaptcha(application *Application, organization, username string, clientIp string) (bool, error)
func CheckUpdateUser ¶
func CheckUserIsAdminRaw ¶
CheckUserIsAdminRaw bypasses xorm ORM and queries the database directly to check the is_admin boolean field. This works around a known issue where xorm may fail to correctly deserialize boolean columns from Postgres, causing user.IsAdmin to always read as false.
func CheckUserPermission ¶
func CheckUserSignup ¶
func CheckUserSignup(application *Application, organization *Organization, authForm *form.AuthForm, lang string) string
func CheckUsername ¶
func CheckUsernameWithEmail ¶
func CleanupExpiredRevokedTokens ¶
CleanupExpiredRevokedTokens removes revoked tokens that have passed their original expiration time. This prevents the revocation table from growing indefinitely.
func CleanupTokens ¶
func ClearThroughputPerSecond ¶
func ClearThroughputPerSecond()
func ContextWithOrgEngine ¶
ContextWithOrgEngine stores an org-scoped engine in the context.
func ConvertCurrency ¶
ConvertCurrency converts an amount from one currency to another using exchange rates
func CreateTables ¶
func CreateTables()
func DeleteAdapter ¶
func DeleteApplication ¶
func DeleteApplication(application *Application) (bool, error)
func DeleteBeegoSession ¶
func DeleteBeegoSession(sessionIds []string)
func DeleteCert ¶
func DeleteEnforcer ¶
func DeleteForm ¶
func DeleteGroup ¶
func DeleteInvitation ¶
func DeleteInvitation(invitation *Invitation) (bool, error)
func DeleteLdap ¶
func DeleteModel ¶
func DeleteOrganization ¶
func DeleteOrganization(organization *Organization) (bool, error)
func DeletePermission ¶
func DeletePermission(permission *Permission) (bool, error)
func DeleteProject ¶
func DeleteProvider ¶
func DeleteRadiusAccounting ¶
func DeleteRadiusAccounting(ra *RadiusAccounting) error
func DeleteResource ¶
func DeleteRole ¶
func DeleteRule ¶
func DeleteServer ¶
func DeleteSession ¶
func DeleteSite ¶
func DeleteSyncer ¶
func DeleteTicket ¶
func DeleteToken ¶
func DeleteUser ¶
func DeleteWebhook ¶
func DialWithCert ¶
func DialWithPassword ¶
func DialWithPrivateKey ¶
func DisableVerificationCode ¶
func DisabledMultiFactorAuth ¶
func DownloadAndUpload ¶
func DumpToFile ¶
func Enforce ¶
func Enforce(permission *Permission, request []string, permissionIds ...string) (bool, error)
func EvictAppCache ¶
func EvictAppCache(owner, name string)
EvictAppCache removes a cached application. Call after any write.
func EvictAppCacheByClientId ¶
func EvictAppCacheByClientId(clientId string)
EvictAppCacheByClientId removes a cached client_id mapping.
func EvictCertCache ¶
func EvictCertCache(name string)
EvictCertCache removes a cached cert and its parsed key.
func EvictOrgCache ¶
func EvictOrgCache(owner, name string)
EvictOrgCache removes a cached organization. Call after any write.
func EvictPermCache ¶
func EvictPermCache(userId string)
EvictPermCache removes only the permission graph for userId. Call after any role/permission assignment change.
func EvictUserCache ¶
func EvictUserCache(owner, name string)
EvictUserCache removes the user row and permission graph from cache. Call this after any write that modifies a User record.
func ExpireTokenByAccessToken ¶
func ExpireTokenByAccessToken(accessToken string) (bool, *Application, *Token, error)
func ExpireTokenByUser ¶
func ExtendGroupWithUsers ¶
func ExtendGroupsWithUsers ¶
func FromProviderToIdpInfo ¶
func GenerateId ¶
func GenerateId()
func GenerateIdForNewUser ¶
func GenerateIdForNewUser(application *Application) (string, error)
func GenerateSamlRequest ¶
func GetAdapterCount ¶
func GetAllActions ¶
func GetAllObjects ¶
func GetAllRoles ¶
func GetApiKeyToken ¶
func GetApiKeyToken(application *Application, accessKey string, accessSecret string, scope string, host string) (*Token, *TokenError, error)
GetApiKeyToken exchanges a user's API key (access_key + access_secret) for a user-bound OAuth token. This enables machine-to-machine authentication using long-lived API keys instead of username/password (ROPC).
func GetApplicationCount ¶
func GetAuthorizationCodeToken ¶
func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string, resource string) (*Token, *TokenError, error)
GetAuthorizationCodeToken Authorization code flow
func GetBuiltInModel ¶
func GetBuiltInModel(modelText string) (authzmodel.Model, error)
func GetCaptcha ¶
func GetCertCount ¶
func GetClientCredentialsToken ¶
func GetClientCredentialsToken(application *Application, clientSecret string, scope string, host string) (*Token, *TokenError, error)
GetClientCredentialsToken Client Credentials flow
func GetDomainExpireTime ¶
func GetEnforcerCount ¶
func GetExchangeRate ¶
GetExchangeRate returns the exchange rate from fromCurrency to toCurrency
func GetExportFilePath ¶
func GetExportFilePath() string
func GetFaviconUrl ¶
func GetFilteredPolicies ¶
func GetFilteredPoliciesMulti ¶
GetFilteredPoliciesMulti applies multiple filters to policies Doing this in our loop is more efficient than using GetFilteredGroupingPolicy / GetFilteredPolicy which iterates over all policies again and again
func GetGlobalCertsCount ¶
func GetGlobalKeyCount ¶
func GetGlobalProviderCount ¶
func GetGlobalUserCount ¶
func GetGroupCount ¶
func GetGroupWithPrefix ¶
func GetGroupWithoutPrefix ¶
func GetIdvProviderFromProvider ¶
func GetIdvProviderFromProvider(provider *Provider) idv.IdvProvider
func GetImplicitToken ¶
func GetImplicitToken(application *Application, username string, scope string, nonce string, host string) (*Token, *TokenError, error)
GetImplicitToken Implicit flow
func GetInitDataDiagnostics ¶
func GetInitDataDiagnostics() map[string]interface{}
GetInitDataDiagnostics returns a safe summary of init data sync status. Does NOT expose DB schema, indexes, raw SQL, or internal state in production.
func GetInvitationCount ¶
func GetJwksBytes ¶ added in v1.14.15
GetJwksBytes returns the JSON-encoded JWKS for the given application (empty == global). Reads are lock-free on a cache hit; misses do one computation under a single-flight mutex.
The returned []byte is owned by the cache — callers MUST NOT mutate it. Treat it as read-only.
func GetJwtBearerToken ¶
func GetJwtBearerToken(application *Application, assertion string, scope string, nonce string, host string) (*Token, *TokenError, error)
GetJwtBearerToken RFC 7523
func GetKeyCount ¶
func GetModelCount ¶
func GetOAuthToken ¶
func GetOAuthToken(grantType string, clientId string, clientSecret string, code string, verifier string, scope string, nonce string, username string, password string, host string, refreshToken string, tag string, avatar string, lang string, subjectToken string, subjectTokenType string, assertion string, clientAssertion string, clientAssertionType string, audience string, resource string, accessKey string, accessSecret string) (interface{}, error)
func GetOrgEngineFromContext ¶
GetOrgEngineFromContext retrieves the org-scoped engine from context. Falls back to the global engine if not set.
func GetOrganizationCount ¶
func GetPasswordToken ¶
func GetPasswordToken(application *Application, username string, password string, scope string, host string) (*Token, *TokenError, error)
GetPasswordToken Resource Owner Password Credentials flow
func GetPermissionCount ¶
func GetProjectCount ¶
func GetProviderCount ¶
func GetResourceCount ¶
func GetRevokedTokenCount ¶
GetRevokedTokenCount returns the count of revoked tokens for an application.
func GetRoleCount ¶
func GetRuleCount ¶
func GetSamlRedirectAddress ¶
func GetSamlResponse ¶
func GetSamlResponse(application *Application, user *User, samlRequest string, host string) (string, string, string, error)
GetSamlResponse generates a SAML2.0 response parameter samlRequest is saml request in base64 format
func GetServerCount ¶
func GetSession ¶
func GetSessionCount ¶
func GetSessionForUser ¶
func GetSiteCount ¶
func GetSyncerCount ¶
func GetTicketCount ¶
func GetTokenCount ¶
func GetTokenExchangeToken ¶
func GetTokenExchangeToken(application *Application, clientSecret string, subjectToken string, subjectTokenType string, audience string, scope string, host string) (*Token, *TokenError, error)
GetTokenExchangeToken Token Exchange Grant (RFC 8693) Exchanges a subject token for a new token with different audience or scope
func GetTruncatedPath ¶
func GetUploadFileUrl ¶
func GetUserField ¶
func GetUserFieldStringValue ¶
func GetUserOAuthAccessToken ¶
GetUserOAuthAccessToken retrieves the OAuth access token for a specific provider
func GetUserOAuthRefreshToken ¶
GetUserOAuthRefreshToken retrieves the OAuth refresh token for a specific provider
func GetValidationBySaml ¶
GetValidationBySaml * @ret1: saml response @ret2: the service URL who requested to issue this token @ret3: error
func GetVerificationCount ¶
func GetVerifyType ¶
func GetWebhookCount ¶
func GetWechatMiniProgramToken ¶
func GetWechatMiniProgramToken(application *Application, code string, host string, username string, avatar string, lang string) (*Token, *TokenError, error)
GetWechatMiniProgramToken Wechat Mini Program flow
func GroupChangeTrigger ¶
func GroupPermissionsByModelAdapter ¶
func GroupPermissionsByModelAdapter(permissions []*Permission) map[string][]string
GroupPermissionsByModelAdapter group permissions by model and adapter. Every model and adapter will be a key, and the value is a list of permission ids. With each list of permission ids have the same key, we just need to init the enforcer and do the enforce/batch-enforce once (with list of permission ids as the policyFilter when the enforcer load policy).
func HasRoleDefinition ¶
func HasRoleDefinition(m authzmodel.Model) bool
func InitAdapter ¶
func InitAdapter()
func InitCleanupTokens ¶
func InitCleanupTokens()
func InitConfig ¶
func InitConfig()
func InitDb ¶
func InitDb()
InitDb is the bootstrap entrypoint: it seeds the admin org, the IAM application, the bootstrap admin user, and the authz primitives (model, adapter, enforcer, permission). All seeds are idempotent — if a row already exists with the canonical (owner, name), the seed is skipped.
func InitDefaultStorageProvider ¶
func InitDefaultStorageProvider()
func InitFromFile ¶
func InitFromFile()
func InitKMS ¶
func InitKMS()
InitKMS connects to the native-ZAP base KMS plugin, fetches the bootstrap secrets, and overrides Beego config values for infrastructure secrets (e.g. dataSourceName). Must be called before InitAdapter().
When BASE_KMS_NODES is unset, KMS is disabled and this function is a no-op. The caller is expected to fall back to plain environment variables in that case.
func InitLdapAutoSynchronizer ¶
func InitLdapAutoSynchronizer()
func InitRuleMap ¶
func InitRuleMap()
func InitSiteMap ¶
func InitSiteMap()
func InitUserManager ¶
func InitUserManager()
func InterimUpdateRadiusAccounting ¶
func InterimUpdateRadiusAccounting(oldRa *RadiusAccounting, newRa *RadiusAccounting, stop bool) error
func InvalidateJwksCache ¶ added in v1.14.15
func InvalidateJwksCache()
InvalidateJwksCache clears the cache, forcing the next GetJwksBytes call to recompute. Wire this into any code path that mutates a Cert row (key rotation, cert delete, application cert reassignment).
func IsAllowSend ¶
func IsAllowSend(user *User, remoteAddr, recordType string, application *Application) error
func IsGrantTypeValid ¶
IsGrantTypeValid Check if grantType is allowed in the current application authorization_code is allowed by default
func IsNeedPromptMfa ¶
func IsNeedPromptMfa(org *Organization, user *User) bool
func IsOriginAllowed ¶
func IsScopeValid ¶
func IsScopeValid(scope string, application *Application) bool
IsScopeValid checks whether all space-separated scopes in the scope string are defined in the application's Scopes list (including regex expansion). If the application has no defined scopes, every scope is considered valid (backward-compatible behaviour).
func IsScopeValidAndExpand ¶
func IsScopeValidAndExpand(scope string, application *Application) (string, bool)
IsScopeValidAndExpand expands any regex patterns in the space-separated scope string against the application's configured scopes. Literal scopes are kept as-is after verifying they exist in the allowed list. Regex scopes are matched against every allowed scope name; all matches replace the pattern. If the application has no defined scopes, the original scope string is returned unchanged (backward-compatible behaviour). Returns the expanded scope string and whether the scope is valid.
func IsTokenRevoked ¶
IsTokenRevoked checks if a token has been revoked.
func IsTokenRevokedByHash ¶
IsTokenRevokedByHash checks if a token has been revoked by its hash.
func MfaRecover ¶
func MoveUserToOrg ¶
MoveUserToOrg changes a user's owner (organization) field. Since owner is part of the composite primary key in IAM, this uses xorm's Exec for a direct SQL UPDATE.
func NewSamlResponse ¶
func NewSamlResponse(application *Application, user *User, host string, certificate string, destination string, iss string, requestId string, redirectUri []string) (*etree.Element, error)
NewSamlResponse returns a saml2 response
func NewSamlResponse11 ¶
func NewSamlResponse11(application *Application, user *User, requestID string, host string) (*etree.Element, error)
NewSamlResponse11 return a saml1.1 response(not 2.0)
func OrgIsolationEnabled ¶
func OrgIsolationEnabled() bool
OrgIsolationEnabled returns true if per-org SQLite isolation is active.
func ParseSamlResponse ¶
func PromoteByEmailDomain ¶ added in v1.18.1
PromoteByEmailDomain applies the email-domain promotion rule to the given user. It is idempotent: if the user is already in the target org with the required IsAdmin flag, it is a no-op.
Returns true if any DB mutation occurred. Callers (HandleLoggedIn etc.) should log promotion events but MUST NOT fail the signin on promotion error — promotion is best-effort; an unexpected DB error here must not lock the user out of their session.
func RefreshToken ¶
func RegisterDynamicClient ¶
func RegisterDynamicClient(req *DynamicClientRegistrationRequest, organization string) (*DynamicClientRegistrationResponse, *DcrError, error)
RegisterDynamicClient creates a new application based on DCR request
func ResetLdapPassword ¶
func RevokeToken ¶
func RevokeToken(tokenValue string, tokenType string, revokedBy string, clientId string, owner string, application string, expiresAt time.Time) error
RevokeToken revokes an OAuth2 token (access_token or refresh_token). This implements RFC 7009 - OAuth 2.0 Token Revocation.
func RevokeTokenByHash ¶
func RevokeTokenByHash(tokenHash string, tokenType string, revokedBy string, clientId string, owner string, application string, expiresAt time.Time) error
RevokeTokenByHash revokes a token by its hash value.
func RunSyncUsersJob ¶
func RunSyncUsersJob()
func SendNotification ¶
func SendSsoLogoutNotifications ¶
SendSsoLogoutNotifications sends logout notifications to all notification providers configured in the user's signup application
func SendVerificationCodeToEmail ¶
func SendVerificationCodeToEmail(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string, method string, host string, applicationName string, application *Application) error
func SendVerificationCodeToPhone ¶
func SendVerificationCodeToPhone(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string, application *Application) error
func SendWebhooks ¶
func SetUserOAuthProperties ¶
func ShouldExportData ¶
func ShouldExportData() bool
func SplitOriginList ¶ added in v1.14.24
SplitOriginList parses a comma-separated origin config value into a slice of trimmed origins. Empty entries are dropped. Returns nil for empty input.
Multi-tenant IAM serves many host names from one backend, so `origin` (and `originFrontend`) in app.conf may be either a single origin or a CSV. The discovery endpoint must emit exactly one issuer per request — the one that matches the incoming host — not the entire CSV joined back together.
func StartMonitorSitesLoop ¶
func StartMonitorSitesLoop()
func StoreCasTokenForPgt ¶
func StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
func StoreCasTokenForProxyTicket ¶
func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
func StringArrayToStruct ¶
func SyncLdapGroups ¶
func SyncLdapGroups(owner string, ldapGroups []LdapGroup, ldapId string) (newGroups int, updatedGroups int, err error)
SyncLdapGroups syncs LDAP groups/OUs to IAM groups with hierarchy
func SyncLdapUsers ¶
func TestSmtpServer ¶
TestSmtpServer Test the SMTP server
func TestSyncer ¶
func TriggerWebhookForUser ¶
TriggerWebhookForUser triggers a webhook for user operations (add, update, delete) action: the action type, e.g., "new-user", "update-user", "delete-user" user: the user object
func UpdateApplication ¶
func UpdateInvitation ¶
func UpdateInvitation(id string, invitation *Invitation, lang string) (bool, error)
func UpdateLdap ¶
func UpdateLdapSyncTime ¶
func UpdateModelWithCheck ¶
func UpdateOrganization ¶
func UpdateOrganization(id string, organization *Organization, isGlobalAdmin bool) (bool, error)
func UpdatePermission ¶
func UpdatePermission(id string, permission *Permission) (bool, error)
func UpdatePolicy ¶
func UpdateRadiusAccounting ¶
func UpdateRadiusAccounting(id string, ra *RadiusAccounting) error
func UpdateSyncer ¶
func UpdateUser ¶
func UpdateUserBalance ¶
func UpdateWebhook ¶
func UploadFileSafe ¶
func UploadUsers ¶
func ValidateKerberosToken ¶
func ValidateKerberosToken(organization *Organization, spnegoTokenBase64 string) (string, error)
ValidateKerberosToken validates a base64-encoded SPNEGO token from the Authorization header and returns the authenticated Kerberos username.
func VerifyCaptcha ¶
func VerifyInvitation ¶
func VerifySsoLogoutSignature ¶
func VerifySsoLogoutSignature(clientSecret string, notification *SsoLogoutNotification) bool
VerifySsoLogoutSignature verifies the signature of an SSO logout notification This should be called by applications receiving logout notifications
Types ¶
type AccountItem ¶
type AccountItem struct {
Name string `json:"name"`
Visible bool `json:"visible"`
ViewRule string `json:"viewRule"`
ModifyRule string `json:"modifyRule"`
Regex string `json:"regex"`
Tab string `json:"tab"`
}
func GetAccountItemByName ¶
func GetAccountItemByName(name string, organization *Organization) *AccountItem
type ActiveDirectorySyncerProvider ¶
type ActiveDirectorySyncerProvider struct {
Syncer *Syncer
}
ActiveDirectorySyncerProvider implements SyncerProvider for Active Directory LDAP-based syncers
func (*ActiveDirectorySyncerProvider) AddUser ¶
func (p *ActiveDirectorySyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to Active Directory (not supported for read-only LDAP)
func (*ActiveDirectorySyncerProvider) Close ¶
func (p *ActiveDirectorySyncerProvider) Close() error
Close closes any open connections (no-op for Active Directory LDAP-based syncer)
func (*ActiveDirectorySyncerProvider) GetOriginalGroups ¶
func (p *ActiveDirectorySyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Active Directory (not implemented yet)
func (*ActiveDirectorySyncerProvider) GetOriginalUserGroups ¶
func (p *ActiveDirectorySyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*ActiveDirectorySyncerProvider) GetOriginalUsers ¶
func (p *ActiveDirectorySyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Active Directory via LDAP
func (*ActiveDirectorySyncerProvider) InitAdapter ¶
func (p *ActiveDirectorySyncerProvider) InitAdapter() error
InitAdapter initializes the Active Directory syncer (no database adapter needed)
func (*ActiveDirectorySyncerProvider) TestConnection ¶
func (p *ActiveDirectorySyncerProvider) TestConnection() error
TestConnection tests the Active Directory LDAP connection
func (*ActiveDirectorySyncerProvider) UpdateUser ¶
func (p *ActiveDirectorySyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in Active Directory (not supported for read-only LDAP)
type Adapter ¶
type Adapter struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Table string `xorm:"varchar(100)" json:"table"`
UseSameDb bool `json:"useSameDb"`
Type string `xorm:"varchar(100)" json:"type"`
DatabaseType string `xorm:"varchar(100)" json:"databaseType"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
User string `xorm:"varchar(100)" json:"user"`
Password string `xorm:"varchar(150)" json:"password"`
Database string `xorm:"varchar(100)" json:"database"`
*authzstore.Adapter `xorm:"-" json:"-"`
// contains filtered or unexported fields
}
func GetAdapter ¶
func GetAdapters ¶
func GetPaginationAdapters ¶
func (*Adapter) InitAdapter ¶
type Address ¶
type Address struct {
Tag string `xorm:"varchar(100)" json:"tag"`
Line1 string `xorm:"varchar(100)" json:"line1"`
Line2 string `xorm:"varchar(100)" json:"line2"`
City string `xorm:"varchar(100)" json:"city"`
State string `xorm:"varchar(100)" json:"state"`
ZipCode string `xorm:"varchar(100)" json:"zipCode"`
Region string `xorm:"varchar(100)" json:"region"`
}
type Affiliation ¶
type Application ¶
type Application struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(20)" json:"category"`
Type string `xorm:"varchar(20)" json:"type"`
Scopes []*ScopeItem `xorm:"mediumtext" json:"scopes"`
Logo string `xorm:"varchar(200)" json:"logo"`
Title string `xorm:"varchar(100)" json:"title"`
Favicon string `xorm:"varchar(200)" json:"favicon"`
Order int `json:"order"`
HomepageUrl string `xorm:"varchar(100)" json:"homepageUrl"`
Description string `xorm:"varchar(100)" json:"description"`
Organization string `xorm:"varchar(100)" json:"organization"`
Cert string `xorm:"varchar(100)" json:"cert"`
DefaultGroup string `xorm:"varchar(100)" json:"defaultGroup"`
HeaderHtml string `xorm:"mediumtext" json:"headerHtml"`
EnablePassword bool `xorm:"bool" json:"enablePassword"`
EnableSignUp bool `xorm:"bool" json:"enableSignUp"`
DisableSignin bool `xorm:"bool" json:"disableSignin"`
EnableSigninSession bool `xorm:"bool" json:"enableSigninSession"`
EnableAutoSignin bool `xorm:"bool" json:"enableAutoSignin"`
EnableCodeSignin bool `xorm:"bool" json:"enableCodeSignin"`
EnableExclusiveSignin bool `xorm:"bool" json:"enableExclusiveSignin"`
EnableSamlCompress bool `xorm:"bool" json:"enableSamlCompress"`
EnableSamlC14n10 bool `xorm:"bool" json:"enableSamlC14n10"`
EnableSamlPostBinding bool `xorm:"bool" json:"enableSamlPostBinding"`
DisableSamlAttributes bool `xorm:"bool" json:"disableSamlAttributes"`
EnableSamlAssertionSignature bool `xorm:"bool" json:"enableSamlAssertionSignature"`
UseEmailAsSamlNameId bool `xorm:"bool" json:"useEmailAsSamlNameId"`
EnableWebAuthn bool `xorm:"bool" json:"enableWebAuthn"`
EnableLinkWithEmail bool `xorm:"bool" json:"enableLinkWithEmail"`
OrgChoiceMode string `json:"orgChoiceMode"`
SamlReplyUrl string `xorm:"varchar(500)" json:"samlReplyUrl"`
Providers []*ProviderItem `xorm:"mediumtext" json:"providers"`
SigninMethods []*SigninMethod `xorm:"mediumtext" json:"signinMethods"`
SignupItems []*SignupItem `xorm:"mediumtext" json:"signupItems"`
SigninItems []*SigninItem `xorm:"mediumtext" json:"signinItems"`
GrantTypes []string `xorm:"mediumtext" json:"grantTypes"`
OrganizationObj *Organization `xorm:"-" json:"organizationObj"`
CertPublicKey string `xorm:"-" json:"certPublicKey"`
Tags []string `xorm:"mediumtext" json:"tags"`
SamlAttributes []*SamlItem `xorm:"mediumtext" json:"samlAttributes"`
SamlHashAlgorithm string `xorm:"varchar(20)" json:"samlHashAlgorithm"`
IpRestriction string `json:"ipRestriction"`
ClientId string `xorm:"varchar(100)" json:"clientId"`
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
ClientCert string `xorm:"varchar(100)" json:"clientCert"`
RedirectUris []string `xorm:"mediumtext" json:"redirectUris"`
ForcedRedirectOrigin string `xorm:"varchar(100)" json:"forcedRedirectOrigin"`
TokenFormat string `xorm:"varchar(100)" json:"tokenFormat"`
TokenSigningMethod string `xorm:"varchar(100)" json:"tokenSigningMethod"`
TokenFields []string `xorm:"mediumtext" json:"tokenFields"`
TokenAttributes []*JwtItem `xorm:"mediumtext" json:"tokenAttributes"`
ExpireInHours float64 `json:"expireInHours"`
RefreshExpireInHours float64 `json:"refreshExpireInHours"`
CookieExpireInHours int64 `json:"cookieExpireInHours"`
SignupUrl string `xorm:"varchar(200)" json:"signupUrl"`
SigninUrl string `xorm:"varchar(200)" json:"signinUrl"`
ForgetUrl string `xorm:"varchar(200)" json:"forgetUrl"`
AffiliationUrl string `xorm:"varchar(100)" json:"affiliationUrl"`
IpWhitelist string `xorm:"varchar(200)" json:"ipWhitelist"`
TermsOfUse string `xorm:"varchar(200)" json:"termsOfUse"`
SignupHtml string `xorm:"mediumtext" json:"signupHtml"`
SigninHtml string `xorm:"mediumtext" json:"signinHtml"`
ThemeData *ThemeData `xorm:"json" json:"themeData"`
FormCss string `xorm:"text" json:"formCss"`
FormCssMobile string `xorm:"text" json:"formCssMobile"`
FormOffset int `json:"formOffset"`
FormSideHtml string `xorm:"mediumtext" json:"formSideHtml"`
FormBackgroundUrl string `xorm:"varchar(200)" json:"formBackgroundUrl"`
FormBackgroundUrlMobile string `xorm:"varchar(200)" json:"formBackgroundUrlMobile"`
FailedSigninLimit int `json:"failedSigninLimit"`
FailedSigninFrozenTime int `json:"failedSigninFrozenTime"`
CodeResendTimeout int `json:"codeResendTimeout"`
CustomScopes []*ScopeDescription `xorm:"mediumtext" json:"customScopes"`
Environment string `xorm:"varchar(50)" json:"environment"` // dev, staging, production
Project string `xorm:"varchar(100)" json:"project"` // project within org
// Reverse proxy fields
Domain string `xorm:"varchar(100)" json:"domain"`
OtherDomains []string `xorm:"mediumtext" json:"otherDomains"`
UpstreamHost string `xorm:"varchar(100)" json:"upstreamHost"`
SslMode string `xorm:"varchar(100)" json:"sslMode"`
SslCert string `xorm:"varchar(100)" json:"sslCert"`
CertObj *Cert `xorm:"-"`
}
func CheckOAuthLogin ¶
func FindApplicationByName ¶ added in v1.14.6
func FindApplicationByName(name, orgHint string) (*Application, error)
FindApplicationByName resolves an application by its name across the configured admin namespace and a tenant org. Tries `<adminOrg>/<name>` first (system apps + the legacy seed location), then `<orgHint>/<name>` (apps owned by a tenant org), then a global by-name lookup so a caller that doesn't know the owner can still find the row. Returns (nil, nil) if no match.
Use this everywhere a controller currently does `GetApplication("admin/" + appName)` — that hardcoded `admin/` lookup breaks the moment an app is owned by a tenant org (which is the post-init steady state for everything except the admin-owned IAM app).
func GetAllowedApplications ¶
func GetAllowedApplications(applications []*Application, userId string, lang string) ([]*Application, error)
func GetApplication ¶
func GetApplication(id string) (*Application, error)
func GetApplicationByClientId ¶
func GetApplicationByClientId(clientId string) (*Application, error)
func GetApplicationByOrganizationName ¶
func GetApplicationByOrganizationName(organization string) (*Application, error)
func GetApplicationByUser ¶
func GetApplicationByUser(user *User) (*Application, error)
func GetApplicationByUserId ¶
func GetApplicationByUserId(userId string) (application *Application, err error)
func GetApplications ¶
func GetApplications(owner string) ([]*Application, error)
func GetDefaultApplication ¶
func GetDefaultApplication(id string) (*Application, error)
func GetMaskedApplication ¶
func GetMaskedApplication(application *Application, userId string) *Application
func GetMaskedApplications ¶
func GetMaskedApplications(applications []*Application, userId string) []*Application
func GetOrganizationApplications ¶
func GetOrganizationApplications(owner string, organization string) ([]*Application, error)
func GetPaginationApplications ¶
func GetPaginationApplications(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Application, error)
func GetPaginationOrganizationApplications ¶
func GetPaginationOrganizationApplications(owner, organization string, offset, limit int, field, value, sortField, sortOrder string) ([]*Application, error)
func NewAdminApp ¶ added in v1.14.21
func NewAdminApp() *Application
NewAdminApp returns the IAM application placeholder owned by the admin org.
func ValidateClientAssertion ¶
func ValidateClientAssertion(clientAssertion string, host string) (bool, *Application, error)
func (*Application) GetEmailProvider ¶
func (application *Application) GetEmailProvider(method string) (*Provider, error)
func (*Application) GetId ¶
func (application *Application) GetId() string
func (*Application) GetProviderByCategory ¶
func (application *Application) GetProviderByCategory(category string) (*Provider, error)
func (*Application) GetProviderByCategoryAndRule ¶
func (*Application) GetProviderItem ¶
func (application *Application) GetProviderItem(providerName string) *ProviderItem
func (*Application) GetProviderItemByType ¶
func (application *Application) GetProviderItemByType(providerType string) *ProviderItem
func (*Application) GetSignupItemRule ¶
func (application *Application) GetSignupItemRule(itemName string) string
func (*Application) GetSmsProvider ¶
func (application *Application) GetSmsProvider(method string, countryCode string) (*Provider, error)
func (*Application) GetStorageProvider ¶
func (application *Application) GetStorageProvider() (*Provider, error)
func (*Application) HasPromptPage ¶
func (application *Application) HasPromptPage() bool
func (*Application) IsCodeSigninViaEmailEnabled ¶
func (application *Application) IsCodeSigninViaEmailEnabled() bool
func (*Application) IsCodeSigninViaSmsEnabled ¶
func (application *Application) IsCodeSigninViaSmsEnabled() bool
func (*Application) IsFaceIdEnabled ¶
func (application *Application) IsFaceIdEnabled() bool
func (*Application) IsLdapEnabled ¶
func (application *Application) IsLdapEnabled() bool
func (*Application) IsPasswordEnabled ¶
func (application *Application) IsPasswordEnabled() bool
func (*Application) IsPasswordWithLdapEnabled ¶
func (application *Application) IsPasswordWithLdapEnabled() bool
func (*Application) IsRedirectUriValid ¶
func (application *Application) IsRedirectUriValid(redirectUri string) bool
func (*Application) IsSignupItemRequired ¶
func (application *Application) IsSignupItemRequired(itemName string) bool
func (*Application) IsSignupItemVisible ¶
func (application *Application) IsSignupItemVisible(itemName string) bool
type AwsIamSyncerProvider ¶
type AwsIamSyncerProvider struct {
Syncer *Syncer
// contains filtered or unexported fields
}
AwsIamSyncerProvider implements SyncerProvider for AWS IAM API-based syncers
func (*AwsIamSyncerProvider) AddUser ¶
func (p *AwsIamSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to AWS IAM (not supported for read-only API)
func (*AwsIamSyncerProvider) Close ¶
func (p *AwsIamSyncerProvider) Close() error
Close closes any open connections
func (*AwsIamSyncerProvider) GetOriginalGroups ¶
func (p *AwsIamSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from AWS IAM
func (*AwsIamSyncerProvider) GetOriginalUserGroups ¶
func (p *AwsIamSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to
func (*AwsIamSyncerProvider) GetOriginalUsers ¶
func (p *AwsIamSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from AWS IAM API
func (*AwsIamSyncerProvider) InitAdapter ¶
func (p *AwsIamSyncerProvider) InitAdapter() error
InitAdapter initializes the AWS IAM syncer
func (*AwsIamSyncerProvider) TestConnection ¶
func (p *AwsIamSyncerProvider) TestConnection() error
TestConnection tests the AWS IAM API connection
func (*AwsIamSyncerProvider) UpdateUser ¶
func (p *AwsIamSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in AWS IAM (not supported for read-only API)
type AzureAdAccessTokenResp ¶
type AzureAdSyncerProvider ¶
type AzureAdSyncerProvider struct {
Syncer *Syncer
}
AzureAdSyncerProvider implements SyncerProvider for Azure AD API-based syncers
func (*AzureAdSyncerProvider) AddUser ¶
func (p *AzureAdSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to Azure AD (not supported for read-only API)
func (*AzureAdSyncerProvider) Close ¶
func (p *AzureAdSyncerProvider) Close() error
Close closes any open connections (no-op for Azure AD API-based syncer)
func (*AzureAdSyncerProvider) GetOriginalGroups ¶
func (p *AzureAdSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Azure AD (not implemented yet)
func (*AzureAdSyncerProvider) GetOriginalUserGroups ¶
func (p *AzureAdSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*AzureAdSyncerProvider) GetOriginalUsers ¶
func (p *AzureAdSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Azure AD API
func (*AzureAdSyncerProvider) InitAdapter ¶
func (p *AzureAdSyncerProvider) InitAdapter() error
InitAdapter initializes the Azure AD syncer (no database adapter needed)
func (*AzureAdSyncerProvider) TestConnection ¶
func (p *AzureAdSyncerProvider) TestConnection() error
TestConnection tests the Azure AD API connection
func (*AzureAdSyncerProvider) UpdateUser ¶
func (p *AzureAdSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in Azure AD (not supported for read-only API)
type AzureAdUser ¶
type AzureAdUser struct {
Id string `json:"id"`
UserPrincipalName string `json:"userPrincipalName"`
DisplayName string `json:"displayName"`
GivenName string `json:"givenName"`
Surname string `json:"surname"`
Mail string `json:"mail"`
MobilePhone string `json:"mobilePhone"`
JobTitle string `json:"jobTitle"`
OfficeLocation string `json:"officeLocation"`
PreferredLanguage string `json:"preferredLanguage"`
AccountEnabled bool `json:"accountEnabled"`
}
type AzureAdUserListResp ¶
type AzureAdUserListResp struct {
OdataContext string `json:"@odata.context"`
OdataNextLink string `json:"@odata.nextLink"`
Value []*AzureAdUser `json:"value"`
}
type CasAnyAttribute ¶
type CasAttributes ¶
type CasAttributes struct {
XMLName xml.Name `xml:"cas:attributes" json:"-"`
AuthenticationDate time.Time `xml:"cas:authenticationDate"`
LongTermAuthenticationRequestTokenUsed bool `xml:"cas:longTermAuthenticationRequestTokenUsed"`
IsFromNewLogin bool `xml:"cas:isFromNewLogin"`
MemberOf []string `xml:"cas:memberOf"`
FirstName string `xml:"cas:firstName,omitempty"`
LastName string `xml:"cas:lastName,omitempty"`
Title string `xml:"cas:title,omitempty"`
Email string `xml:"cas:email,omitempty"`
Affiliation string `xml:"cas:affiliation,omitempty"`
Avatar string `xml:"cas:avatar,omitempty"`
Phone string `xml:"cas:phone,omitempty"`
DisplayName string `xml:"cas:displayName,omitempty"`
UserAttributes *CasUserAttributes
ExtraAttributes []*CasAnyAttribute `xml:",any"`
}
func (*CasAttributes) DeepCopy ¶
func (c *CasAttributes) DeepCopy() CasAttributes
type CasAuthenticationSuccess ¶
type CasAuthenticationSuccess struct {
XMLName xml.Name `xml:"cas:authenticationSuccess" json:"-"`
User string `xml:"cas:user"`
ProxyGrantingTicket string `xml:"cas:proxyGrantingTicket,omitempty"`
Proxies *CasProxies `xml:"cas:proxies"`
Attributes *CasAttributes `xml:"cas:attributes"`
ExtraAttributes []*CasAnyAttribute `xml:",any"`
}
func GetCasTokenByPgt ¶
func GetCasTokenByPgt(pgt string) (bool, *CasAuthenticationSuccess, string, string)
GetCasTokenByPgt * @ret1: whether a token is found @ret2: token, nil if not found @ret3: the service URL who requested to issue this token @ret4: userIf of user who requested to issue this token
func GetCasTokenByTicket ¶
func GetCasTokenByTicket(ticket string) (bool, *CasAuthenticationSuccess, string, string)
GetCasTokenByTicket * @ret1: whether a token is found @ret2: token, nil if not found @ret3: the service URL who requested to issue this token @ret4: userIf of user who requested to issue this token
func (*CasAuthenticationSuccess) DeepCopy ¶
func (c *CasAuthenticationSuccess) DeepCopy() CasAuthenticationSuccess
type CasAuthenticationSuccessWrapper ¶
type CasAuthenticationSuccessWrapper struct {
AuthenticationSuccess *CasAuthenticationSuccess // the token we issued
Service string // to which service this token is issued
UserId string
}
type CasNamedAttribute ¶
type CasProxies ¶
type CasProxies struct {
XMLName xml.Name `xml:"cas:proxies" json:"-"`
Proxies []string `xml:"cas:proxy"`
}
func (*CasProxies) DeepCopy ¶
func (c *CasProxies) DeepCopy() CasProxies
type CasProxyFailure ¶
type CasProxySuccess ¶
type CasServiceResponse ¶
type CasServiceResponse struct {
XMLName xml.Name `xml:"cas:serviceResponse" json:"-"`
Xmlns string `xml:"xmlns:cas,attr"`
Failure *CasAuthenticationFailure
Success *CasAuthenticationSuccess
ProxySuccess *CasProxySuccess
ProxyFailure *CasProxyFailure
}
type CasUserAttributes ¶
type CasUserAttributes struct {
XMLName xml.Name `xml:"cas:userAttributes" json:"-"`
Attributes []*CasNamedAttribute `xml:"cas:attribute"`
AnyAttributes []*CasAnyAttribute `xml:",any"`
}
func (*CasUserAttributes) DeepCopy ¶
func (c *CasUserAttributes) DeepCopy() CasUserAttributes
type Cert ¶
type Cert struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Scope string `xorm:"varchar(100)" json:"scope"`
Type string `xorm:"varchar(100)" json:"type"`
CryptoAlgorithm string `xorm:"varchar(100)" json:"cryptoAlgorithm"`
BitSize int `json:"bitSize"`
ExpireInYears int `json:"expireInYears"`
ExpireTime string `xorm:"varchar(100)" json:"expireTime"`
DomainExpireTime string `xorm:"varchar(100)" json:"domainExpireTime"`
Provider string `xorm:"varchar(100)" json:"provider"`
Account string `xorm:"varchar(100)" json:"account"`
AccessKey string `xorm:"varchar(100)" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
Certificate string `xorm:"mediumtext" json:"certificate"`
PrivateKey string `xorm:"mediumtext" json:"privateKey"`
}
func GetCertByDomain ¶
func GetDefaultCert ¶
func GetGlobalCerts ¶
func GetMaskedCert ¶
func GetPaginationCerts ¶
type Claims ¶
type Claims struct {
*User
TokenType string `json:"tokenType,omitempty"`
Nonce string `json:"nonce,omitempty"`
Tag string `json:"tag"`
Scope string `json:"scope,omitempty"`
// the `azp` (Authorized Party) claim. Optional. See https://openid.net/specs/openid-connect-core-1_0.html#IDToken
Azp string `json:"azp,omitempty"`
Provider string `json:"provider,omitempty"`
SigninMethod string `json:"signinMethod,omitempty"`
jwt.RegisteredClaims
}
func ParseJwtTokenByApplication ¶
func ParseJwtTokenByApplication(token string, application *Application) (*Claims, error)
func ValidateJwtAssertion ¶
type ClaimsShort ¶
type ClaimsShort struct {
*UserShort
TokenType string `json:"tokenType,omitempty"`
Nonce string `json:"nonce,omitempty"`
Scope string `json:"scope,omitempty"`
Azp string `json:"azp,omitempty"`
Provider string `json:"provider,omitempty"`
SigninMethod string `json:"signinMethod,omitempty"`
jwt.RegisteredClaims
}
type ClaimsStandard ¶
type ClaimsStandard struct {
*UserStandard
EmailVerified bool `json:"email_verified,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
PhoneNumberVerified bool `json:"phone_number_verified,omitempty"`
Gender string `json:"gender,omitempty"`
TokenType string `json:"tokenType,omitempty"`
Nonce string `json:"nonce,omitempty"`
Scope string `json:"scope,omitempty"`
Address OIDCAddress `json:"address,omitempty"`
Azp string `json:"azp,omitempty"`
Provider string `json:"provider,omitempty"`
jwt.RegisteredClaims
}
func ParseStandardJwtToken ¶
func ParseStandardJwtToken(token string, cert *Cert) (*ClaimsStandard, error)
func ParseStandardJwtTokenByApplication ¶
func ParseStandardJwtTokenByApplication(token string, application *Application) (*ClaimsStandard, error)
type ClaimsWithoutThirdIdp ¶
type ClaimsWithoutThirdIdp struct {
*UserWithoutThirdIdp
TokenType string `json:"tokenType,omitempty"`
Nonce string `json:"nonce,omitempty"`
Tag string `json:"tag"`
Scope string `json:"scope,omitempty"`
Azp string `json:"azp,omitempty"`
Provider string `json:"provider,omitempty"`
SigninMethod string `json:"signinMethod,omitempty"`
jwt.RegisteredClaims
}
type Code ¶
type ConsentRecord ¶
type ConsentRecord struct {
// owner/name
Application string `json:"application"`
GrantedScopes []string `json:"grantedScopes"`
}
ConsentRecord represents the data for OAuth consent API requests/responses
type Credential ¶
type DashboardDateItem ¶
type DashboardDateItem struct {
CreatedTime string `json:"createTime"`
}
type DashboardMapItem ¶
type DashboardMapItem struct {
// contains filtered or unexported fields
}
type DatabaseSyncerProvider ¶
type DatabaseSyncerProvider struct {
Syncer *Syncer
}
DatabaseSyncerProvider implements SyncerProvider for database-based syncers
func (*DatabaseSyncerProvider) AddUser ¶
func (p *DatabaseSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to the database
func (*DatabaseSyncerProvider) Close ¶
func (p *DatabaseSyncerProvider) Close() error
Close closes the database connection and SSH tunnel
func (*DatabaseSyncerProvider) GetOriginalGroups ¶
func (p *DatabaseSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Database (not implemented yet)
func (*DatabaseSyncerProvider) GetOriginalUserGroups ¶
func (p *DatabaseSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*DatabaseSyncerProvider) GetOriginalUsers ¶
func (p *DatabaseSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from the database
func (*DatabaseSyncerProvider) InitAdapter ¶
func (p *DatabaseSyncerProvider) InitAdapter() error
InitAdapter initializes the database adapter
func (*DatabaseSyncerProvider) TestConnection ¶
func (p *DatabaseSyncerProvider) TestConnection() error
TestConnection tests the database connection
func (*DatabaseSyncerProvider) UpdateUser ¶
func (p *DatabaseSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in the database
type DcrError ¶
type DcrError struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description,omitempty"`
}
DcrError represents an RFC 7591 error response
type DeviceAuthCache ¶
type DeviceAuthResponse ¶
type DeviceAuthResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationUri string `json:"verification_uri"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
}
func GetDeviceAuthResponse ¶
func GetDeviceAuthResponse(deviceCode string, userCode string, host string) DeviceAuthResponse
type DingtalkAccessTokenResp ¶
type DingtalkDepartment ¶
type DingtalkDeptDetailResp ¶
type DingtalkDeptDetailResp struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Result *DingtalkDepartment `json:"result"`
RequestId string `json:"request_id"`
}
type DingtalkDeptListResp ¶
type DingtalkResult ¶
type DingtalkResult struct {
List []*DingtalkUser `json:"list"`
HasMore bool `json:"has_more"`
NextCursor int64 `json:"next_cursor"`
}
type DingtalkSyncerProvider ¶
type DingtalkSyncerProvider struct {
Syncer *Syncer
}
DingtalkSyncerProvider implements SyncerProvider for DingTalk API-based syncers
func (*DingtalkSyncerProvider) AddUser ¶
func (p *DingtalkSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to DingTalk (not supported for read-only API)
func (*DingtalkSyncerProvider) Close ¶
func (p *DingtalkSyncerProvider) Close() error
Close closes any open connections (no-op for DingTalk API-based syncer)
func (*DingtalkSyncerProvider) GetOriginalGroups ¶
func (p *DingtalkSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups (departments) from DingTalk
func (*DingtalkSyncerProvider) GetOriginalUserGroups ¶
func (p *DingtalkSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group (department) IDs that a user belongs to
func (*DingtalkSyncerProvider) GetOriginalUsers ¶
func (p *DingtalkSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from DingTalk API
func (*DingtalkSyncerProvider) InitAdapter ¶
func (p *DingtalkSyncerProvider) InitAdapter() error
InitAdapter initializes the DingTalk syncer (no database adapter needed)
func (*DingtalkSyncerProvider) TestConnection ¶
func (p *DingtalkSyncerProvider) TestConnection() error
TestConnection tests the DingTalk API connection
func (*DingtalkSyncerProvider) UpdateUser ¶
func (p *DingtalkSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in DingTalk (not supported for read-only API)
type DingtalkUser ¶
type DingtalkUser struct {
UserId string `json:"userid"`
UnionId string `json:"unionid"`
Name string `json:"name"`
Department []int `json:"dept_id_list"`
Position string `json:"title"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Avatar string `json:"avatar"`
JobNumber string `json:"job_number"`
Active bool `json:"active"`
}
type DingtalkUserListResp ¶
type DingtalkUserListResp struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
Result *DingtalkResult `json:"result"`
RequestId string `json:"request_id"`
}
type DomainPromotion ¶ added in v1.18.1
type DomainPromotion struct {
// Org is the user's resulting owner field after promotion.
Org string
// GlobalAdmin reports whether the rule confers global-admin status
// (i.e. Org == conf.AdminOrg).
GlobalAdmin bool
}
DomainPromotion describes the effect of an email-domain auto-promotion rule. It carries the target org (where the user is moved) and whether the user should become a global admin (i.e. owner == conf.AdminOrg) on promotion.
In this IAM the global-admin status is computed from user.Owner == conf.AdminOrg. "global admin + home-org membership" is therefore expressed as Owner=AdminOrg for domains that should manage everything (hanzo, lux, zoo) and Owner=<homeOrg> + IsAdmin=true for org-scoped admins (pars).
func LookupDomainPromotion ¶ added in v1.18.1
func LookupDomainPromotion(email string) (DomainPromotion, bool)
LookupDomainPromotion returns the promotion outcome for an email's domain (case-insensitive), or (zero, false) if the domain is not configured.
Pure (modulo brand.json read): no DB access. Safe for unit tests.
Rule source: conf.LoadBrand() reads /etc/brand/brand.json (or $IAM_BRAND_FILE). White-label deployments override the rule list there — IAM itself ships no hardcoded brand-specific list.
type DynamicClientRegistrationRequest ¶
type DynamicClientRegistrationRequest struct {
ClientName string `json:"client_name,omitempty"`
RedirectUris []string `json:"redirect_uris,omitempty"`
GrantTypes []string `json:"grant_types,omitempty"`
ResponseTypes []string `json:"response_types,omitempty"`
TokenEndpointAuthMethod string `json:"token_endpoint_auth_method,omitempty"`
ApplicationType string `json:"application_type,omitempty"`
Contacts []string `json:"contacts,omitempty"`
LogoUri string `json:"logo_uri,omitempty"`
ClientUri string `json:"client_uri,omitempty"`
PolicyUri string `json:"policy_uri,omitempty"`
TosUri string `json:"tos_uri,omitempty"`
Scope string `json:"scope,omitempty"`
}
DynamicClientRegistrationRequest represents an RFC 7591 client registration request
type DynamicClientRegistrationResponse ¶
type DynamicClientRegistrationResponse struct {
ClientId string `json:"client_id"`
ClientSecret string `json:"client_secret,omitempty"`
ClientIdIssuedAt int64 `json:"client_id_issued_at,omitempty"`
ClientSecretExpiresAt int64 `json:"client_secret_expires_at,omitempty"`
ClientName string `json:"client_name,omitempty"`
RedirectUris []string `json:"redirect_uris,omitempty"`
GrantTypes []string `json:"grant_types,omitempty"`
ResponseTypes []string `json:"response_types,omitempty"`
TokenEndpointAuthMethod string `json:"token_endpoint_auth_method,omitempty"`
ApplicationType string `json:"application_type,omitempty"`
Contacts []string `json:"contacts,omitempty"`
LogoUri string `json:"logo_uri,omitempty"`
ClientUri string `json:"client_uri,omitempty"`
PolicyUri string `json:"policy_uri,omitempty"`
TosUri string `json:"tos_uri,omitempty"`
Scope string `json:"scope,omitempty"`
RegistrationClientUri string `json:"registration_client_uri,omitempty"`
RegistrationAccessToken string `json:"registration_access_token,omitempty"`
}
DynamicClientRegistrationResponse represents an RFC 7591 client registration response
type Enforcer ¶
type Enforcer struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100) updated" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Description string `xorm:"varchar(100)" json:"description"`
Model string `xorm:"varchar(100)" json:"model"`
Adapter string `xorm:"varchar(100)" json:"adapter"`
ModelCfg map[string]string `xorm:"-" json:"modelCfg"`
*authz.Enforcer
}
func GetEnforcer ¶
func GetEnforcers ¶
func GetInitializedEnforcer ¶
func GetPaginationEnforcers ¶
func (*Enforcer) GetModelAndAdapter ¶
func (*Enforcer) InitEnforcer ¶
func (*Enforcer) LoadModelCfg ¶
type Expression ¶
type Filter ¶
type Filter struct {
Ptype string `json:"ptype,omitempty"`
FieldIndex *int `json:"fieldIndex,omitempty"`
FieldValues []string `json:"fieldValues"`
}
Filter represents filter criteria with optional policy type
type Form ¶
type Form struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Type string `xorm:"varchar(100)" json:"type"`
Tag string `xorm:"varchar(100)" json:"tag"`
FormItems []*FormItem `xorm:"mediumtext" json:"formItems"`
}
func GetGlobalForms ¶
func GetMaskedForm ¶
func GetMaskedForms ¶
func GetPaginationForms ¶
type GaugeVecInfo ¶
type GoogleWorkspaceSyncerProvider ¶
type GoogleWorkspaceSyncerProvider struct {
Syncer *Syncer
}
GoogleWorkspaceSyncerProvider implements SyncerProvider for Google Workspace API-based syncers
func (*GoogleWorkspaceSyncerProvider) AddUser ¶
func (p *GoogleWorkspaceSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to Google Workspace (not supported for read-only API)
func (*GoogleWorkspaceSyncerProvider) Close ¶
func (p *GoogleWorkspaceSyncerProvider) Close() error
Close closes any open connections (no-op for Google Workspace API-based syncer)
func (*GoogleWorkspaceSyncerProvider) GetOriginalGroups ¶
func (p *GoogleWorkspaceSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Google Workspace
func (*GoogleWorkspaceSyncerProvider) GetOriginalUserGroups ¶
func (p *GoogleWorkspaceSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to
func (*GoogleWorkspaceSyncerProvider) GetOriginalUsers ¶
func (p *GoogleWorkspaceSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Google Workspace API
func (*GoogleWorkspaceSyncerProvider) InitAdapter ¶
func (p *GoogleWorkspaceSyncerProvider) InitAdapter() error
InitAdapter initializes the Google Workspace syncer (no database adapter needed)
func (*GoogleWorkspaceSyncerProvider) TestConnection ¶
func (p *GoogleWorkspaceSyncerProvider) TestConnection() error
TestConnection tests the Google Workspace API connection
func (*GoogleWorkspaceSyncerProvider) UpdateUser ¶
func (p *GoogleWorkspaceSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in Google Workspace (not supported for read-only API)
type Group ¶
type Group struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk unique index" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Manager string `xorm:"varchar(100)" json:"manager"`
ContactEmail string `xorm:"varchar(100)" json:"contactEmail"`
Type string `xorm:"varchar(100)" json:"type"`
ParentId string `xorm:"varchar(100)" json:"parentId"`
ParentName string `xorm:"-" json:"parentName"`
IsTopGroup bool `xorm:"bool" json:"isTopGroup"`
Users []string `xorm:"-" json:"users"`
Title string `json:"title,omitempty"`
Key string `json:"key,omitempty"`
HaveChildren bool `xorm:"-" json:"haveChildren"`
Children []*Group `json:"children,omitempty"`
IsEnabled bool `json:"isEnabled"`
}
func ConvertToTreeData ¶
func GetGlobalGroups ¶
func GetPaginationGroups ¶
type HistogramVecInfo ¶
type HttpProvider ¶
type HttpProvider struct {
// contains filtered or unexported fields
}
type HttpSmsClient ¶
type HttpSmsClient struct {
// contains filtered or unexported fields
}
func (*HttpSmsClient) SendMessage ¶
func (c *HttpSmsClient) SendMessage(param map[string]string, targetPhoneNumber ...string) error
type IdpEntityDescriptor ¶
type IdpEntityDescriptor struct {
XMLName xml.Name `xml:"EntityDescriptor"`
DS string `xml:"xmlns:ds,attr"`
XMLNS string `xml:"xmlns,attr"`
MD string `xml:"xmlns:md,attr"`
EntityId string `xml:"entityID,attr"`
IdpSSODescriptor IdpSSODescriptor `xml:"IDPSSODescriptor"`
}
IdpEntityDescriptor SAML METADATA
func GetSamlMeta ¶
func GetSamlMeta(application *Application, host string, enablePostBinding bool) (*IdpEntityDescriptor, error)
type IdpSSODescriptor ¶
type IdpSSODescriptor struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata IDPSSODescriptor"`
ProtocolSupportEnumeration string `xml:"protocolSupportEnumeration,attr"`
SigningKeyDescriptor KeyDescriptor
NameIDFormats []NameIDFormat `xml:"NameIDFormat"`
SingleSignOnService SingleSignOnService `xml:"SingleSignOnService"`
Attribute []Attribute `xml:"Attribute"`
}
type InitData ¶
type InitData struct {
Organizations []*Organization `json:"organizations"`
Applications []*Application `json:"applications"`
Users []*User `json:"users"`
Certs []*Cert `json:"certs"`
Providers []*Provider `json:"providers"`
Ldaps []*Ldap `json:"ldaps"`
Models []*Model `json:"models"`
Permissions []*Permission `json:"permissions"`
Resources []*Resource `json:"resources"`
Roles []*Role `json:"roles"`
Syncers []*Syncer `json:"syncers"`
Tokens []*Token `json:"tokens"`
Webhooks []*Webhook `json:"webhooks"`
Groups []*Group `json:"groups"`
Adapters []*Adapter `json:"adapters"`
Enforcers []*Enforcer `json:"enforcers"`
Invitations []*Invitation `json:"invitations"`
Records []*Record `json:"records"`
Sessions []*Session `json:"sessions"`
Sites []*Site `json:"sites"`
Rules []*Rule `json:"rules"`
EnforcerPolicies map[string][][]string `json:"enforcerPolicies"`
}
type IntrospectionResponse ¶
type IntrospectionResponse struct {
Active bool `json:"active"`
Scope string `json:"scope,omitempty"`
ClientId string `json:"client_id,omitempty"`
Username string `json:"username,omitempty"`
TokenType string `json:"token_type,omitempty"`
Exp int64 `json:"exp,omitempty"`
Iat int64 `json:"iat,omitempty"`
Nbf int64 `json:"nbf,omitempty"`
Sub string `json:"sub,omitempty"`
Aud []string `json:"aud,omitempty"`
Iss string `json:"iss,omitempty"`
Jti string `json:"jti,omitempty"`
}
type Invitation ¶
type Invitation struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Code string `xorm:"varchar(100) index" json:"code"`
IsRegexp bool `json:"isRegexp"`
Quota int `json:"quota"`
UsedCount int `json:"usedCount"`
Application string `xorm:"varchar(100)" json:"application"`
Username string `xorm:"varchar(100)" json:"username"`
Email string `xorm:"varchar(100)" json:"email"`
Phone string `xorm:"varchar(100)" json:"phone"`
SignupGroup string `xorm:"varchar(100)" json:"signupGroup"`
DefaultCode string `xorm:"varchar(100)" json:"defaultCode"`
State string `xorm:"varchar(100)" json:"state"`
}
func CheckInvitationCode ¶
func CheckInvitationCode(application *Application, organization *Organization, authForm *form.AuthForm, lang string) (*Invitation, string)
func GetInvitation ¶
func GetInvitation(id string) (*Invitation, error)
func GetInvitationByCode ¶
func GetInvitationByCode(code string, organizationName string, lang string) (*Invitation, string)
func GetInvitations ¶
func GetInvitations(owner string) ([]*Invitation, error)
func GetMaskedInvitation ¶
func GetMaskedInvitation(invitation *Invitation) *Invitation
func GetPaginationInvitations ¶
func GetPaginationInvitations(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Invitation, error)
func (*Invitation) GetId ¶
func (invitation *Invitation) GetId() string
func (*Invitation) GetInvitationLink ¶
func (invitation *Invitation) GetInvitationLink(host string, application string) string
func (*Invitation) IsInvitationCodeValid ¶
func (invitation *Invitation) IsInvitationCodeValid(application *Application, invitationCode string, username string, email string, phone string, lang string) (bool, string)
func (*Invitation) SimpleCheckInvitationCode ¶
func (invitation *Invitation) SimpleCheckInvitationCode(invitationCode string, lang string) (bool, string)
type JsonWebKeySet ¶
type JsonWebKeySet struct {
Keys []interface{} `json:"keys"`
}
JsonWebKeySet is a JWKS container that supports both traditional (RSA/EC) and post-quantum (ML-DSA-65) keys. Traditional keys use go-jose serialization; ML-DSA-65 keys use the IETF draft format (kty=MLDSA, alg=MLDSA65).
func GetJsonWebKeySet ¶
func GetJsonWebKeySet(applicationName string) (JsonWebKeySet, error)
type Key ¶
type Key struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
// Type indicates the scope this key belongs to: "Organization", "Application", "User", or "General"
Type string `xorm:"varchar(100)" json:"type"`
Organization string `xorm:"varchar(100)" json:"organization"`
Application string `xorm:"varchar(100)" json:"application"`
User string `xorm:"varchar(100)" json:"user"`
AccessKey string `xorm:"varchar(100) index" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
ExpireTime string `xorm:"varchar(100)" json:"expireTime"`
State string `xorm:"varchar(100)" json:"state"`
}
func GetGlobalKeys ¶
func GetKeyByAccessKey ¶
GetKeyByAccessKey resolves a key by its AccessKey (pk-) field. For sk- prefixed tokens, use GetKeyBySecretKey instead.
func GetKeyBySecretKey ¶
GetKeyBySecretKey resolves a key by its AccessSecret (sk-) field. Used when a backend sends a secret key for full API access.
func GetMaskedKey ¶
func GetPaginationGlobalKeys ¶
func GetPaginationKeys ¶
func ResolveAnyKey ¶
ResolveAnyKey resolves a token that could be pk-, sk-, or legacy (hk-/bare UUID). Returns the Key and whether it's a publishable key.
type KeyDescriptor ¶
type KeycloakSyncerProvider ¶
type KeycloakSyncerProvider struct {
DatabaseSyncerProvider
}
KeycloakSyncerProvider implements SyncerProvider for Keycloak database syncers Keycloak syncer extends DatabaseSyncerProvider with special handling for Keycloak schema
func (*KeycloakSyncerProvider) GetOriginalGroups ¶
func (p *KeycloakSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Keycloak (not implemented yet)
func (*KeycloakSyncerProvider) GetOriginalUserGroups ¶
func (p *KeycloakSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*KeycloakSyncerProvider) GetOriginalUsers ¶
func (p *KeycloakSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Keycloak database This method overrides the base implementation to handle Keycloak-specific logic
type LarkAccessTokenResp ¶
type LarkAvatar ¶
type LarkDeptListResp ¶
type LarkStatus ¶
type LarkSyncerProvider ¶
type LarkSyncerProvider struct {
Syncer *Syncer
}
LarkSyncerProvider implements SyncerProvider for Lark API-based syncers
func (*LarkSyncerProvider) AddUser ¶
func (p *LarkSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to Lark (not supported for read-only API)
func (*LarkSyncerProvider) Close ¶
func (p *LarkSyncerProvider) Close() error
Close closes any open connections (no-op for Lark API-based syncer)
func (*LarkSyncerProvider) GetOriginalGroups ¶
func (p *LarkSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Lark (not implemented yet)
func (*LarkSyncerProvider) GetOriginalUserGroups ¶
func (p *LarkSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*LarkSyncerProvider) GetOriginalUsers ¶
func (p *LarkSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Lark API
func (*LarkSyncerProvider) InitAdapter ¶
func (p *LarkSyncerProvider) InitAdapter() error
InitAdapter initializes the Lark syncer (no database adapter needed)
func (*LarkSyncerProvider) TestConnection ¶
func (p *LarkSyncerProvider) TestConnection() error
TestConnection tests the Lark API connection
func (*LarkSyncerProvider) UpdateUser ¶
func (p *LarkSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in Lark (not supported for read-only API)
type LarkUser ¶
type LarkUser struct {
UserId string `json:"user_id"`
UnionId string `json:"union_id"`
OpenId string `json:"open_id"`
Name string `json:"name"`
EnName string `json:"en_name"`
Email string `json:"email"`
Mobile string `json:"mobile"`
Gender int `json:"gender"`
Avatar *LarkAvatar `json:"avatar"`
Status *LarkStatus `json:"status"`
DepartmentIds []string `json:"department_ids"`
JobTitle string `json:"job_title"`
}
type LarkUserListResp ¶
type Ldap ¶
type Ldap struct {
Id string `xorm:"varchar(100) notnull pk" json:"id"`
Owner string `xorm:"varchar(100)" json:"owner"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
ServerName string `xorm:"varchar(100)" json:"serverName"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `xorm:"int" json:"port"`
EnableSsl bool `xorm:"bool" json:"enableSsl"`
AllowSelfSignedCert bool `xorm:"bool" json:"allowSelfSignedCert"`
Username string `xorm:"varchar(100)" json:"username"`
Password string `xorm:"varchar(100)" json:"password"`
BaseDn string `xorm:"varchar(500)" json:"baseDn"`
Filter string `xorm:"varchar(200)" json:"filter"`
FilterFields []string `xorm:"mediumtext" json:"filterFields"`
DefaultGroup string `xorm:"varchar(100)" json:"defaultGroup"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
CustomAttributes map[string]string `json:"customAttributes"`
AutoSync int `json:"autoSync"`
LastSync string `xorm:"varchar(100)" json:"lastSync"`
EnableGroups bool `xorm:"bool" json:"enableGroups"`
}
func (*Ldap) GetLdapConn ¶
type LdapAutoSynchronizer ¶
func GetLdapAutoSynchronizer ¶
func GetLdapAutoSynchronizer() *LdapAutoSynchronizer
func NewLdapAutoSynchronizer ¶
func NewLdapAutoSynchronizer() *LdapAutoSynchronizer
func (*LdapAutoSynchronizer) LdapAutoSynchronizerStartUpAll ¶
func (l *LdapAutoSynchronizer) LdapAutoSynchronizerStartUpAll() error
LdapAutoSynchronizerStartUpAll start all autosync goroutine for existing ldap servers in each organizations
func (*LdapAutoSynchronizer) StartAutoSync ¶
func (l *LdapAutoSynchronizer) StartAutoSync(ldapId string) error
StartAutoSync start autosync for specified ldap, old existing autosync goroutine will be ceased
func (*LdapAutoSynchronizer) StopAutoSync ¶
func (l *LdapAutoSynchronizer) StopAutoSync(ldapId string)
type LdapConn ¶
func (*LdapConn) GetLdapGroups ¶
GetLdapGroups fetches LDAP groups and organizational units
type LdapUser ¶
type LdapUser struct {
UidNumber string `json:"uidNumber"`
Uid string `json:"uid"`
Cn string `json:"cn"`
GidNumber string `json:"gidNumber"`
// Gcn string
Uuid string `json:"uuid"`
UserPrincipalName string `json:"userPrincipalName"`
DisplayName string `json:"displayName"`
Mail string
Email string `json:"email"`
EmailAddress string
TelephoneNumber string
Mobile string `json:"mobile"`
MobileTelephoneNumber string
RegisteredAddress string
PostalAddress string
Country string `json:"country"`
CountryName string `json:"countryName"`
GroupId string `json:"groupId"`
Address string `json:"address"`
MemberOf []string `json:"memberOf"`
Attributes map[string]string `json:"attributes"`
}
func AutoAdjustLdapUser ¶
func (*LdapUser) GetLdapUuid ¶
type MLDSA65WebKey ¶
type MLDSA65WebKey struct {
Kty string `json:"kty"`
Alg string `json:"alg"`
Use string `json:"use"`
Kid string `json:"kid"`
X string `json:"x"` // base64url-encoded raw public key
}
MLDSA65WebKey is the JWK representation of an ML-DSA-65 public key, following the IETF draft convention for post-quantum JWK.
type ManagedAccount ¶
type MfaAccount ¶
type MfaInterface ¶
type MfaInterface interface {
Initiate(userId string, issuer string) (*MfaProps, error)
SetupVerify(passcode string) error
Enable(user *User) error
Verify(passcode string) error
}
func GetMfaUtil ¶
func GetMfaUtil(mfaType string, config *MfaProps) MfaInterface
type MfaProps ¶
type MfaProps struct {
Enabled bool `json:"enabled"`
IsPreferred bool `json:"isPreferred"`
MfaType string `json:"mfaType" form:"mfaType"`
Secret string `json:"secret,omitempty"`
CountryCode string `json:"countryCode,omitempty"`
URL string `json:"url,omitempty"`
RecoveryCodes []string `json:"recoveryCodes,omitempty"`
MfaRememberInHours int `json:"mfaRememberInHours"`
}
func GetAllMfaProps ¶
type Model ¶
type Model struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Description string `xorm:"varchar(100)" json:"description"`
ModelText string `xorm:"mediumtext" json:"modelText"`
authzmodel.Model `xorm:"-" json:"-"`
}
func GetPaginationModels ¶
type NameIDFormat ¶
type NameIDFormat struct {
// XMLName xml.Name
Value string `xml:",innerxml"`
}
type OIDCAddress ¶
type OauthProtectedResourceMetadata ¶
type OauthProtectedResourceMetadata struct {
Resource string `json:"resource"`
AuthorizationServers []string `json:"authorization_servers"`
BearerMethodsSupported []string `json:"bearer_methods_supported,omitempty"`
ScopesSupported []string `json:"scopes_supported,omitempty"`
ResourceSigningAlg []string `json:"resource_signing_alg_values_supported,omitempty"`
ResourceDocumentation string `json:"resource_documentation,omitempty"`
}
OauthProtectedResourceMetadata represents RFC 9728 OAuth 2.0 Protected Resource Metadata
func GetOauthProtectedResourceMetadata ¶
func GetOauthProtectedResourceMetadata(host string) OauthProtectedResourceMetadata
GetOauthProtectedResourceMetadata returns RFC 9728 Protected Resource Metadata for global discovery
func GetOauthProtectedResourceMetadataByApplication ¶
func GetOauthProtectedResourceMetadataByApplication(host string, applicationName string) OauthProtectedResourceMetadata
GetOauthProtectedResourceMetadataByApplication returns RFC 9728 Protected Resource Metadata for application-specific discovery
type OidcDiscovery ¶
type OidcDiscovery struct {
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
UserinfoEndpoint string `json:"userinfo_endpoint"`
DeviceAuthorizationEndpoint string `json:"device_authorization_endpoint"`
RegistrationEndpoint string `json:"registration_endpoint,omitempty"`
JwksUri string `json:"jwks_uri"`
IntrospectionEndpoint string `json:"introspection_endpoint"`
RevocationEndpoint string `json:"revocation_endpoint"`
ResponseTypesSupported []string `json:"response_types_supported"`
ResponseModesSupported []string `json:"response_modes_supported"`
GrantTypesSupported []string `json:"grant_types_supported"`
SubjectTypesSupported []string `json:"subject_types_supported"`
IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"`
ScopesSupported []string `json:"scopes_supported"`
TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
IntrospectionEndpointAuthMethodsSupported []string `json:"introspection_endpoint_auth_methods_supported"`
RevocationEndpointAuthMethodsSupported []string `json:"revocation_endpoint_auth_methods_supported"`
CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"`
ClaimsSupported []string `json:"claims_supported"`
RequestParameterSupported bool `json:"request_parameter_supported"`
RequestObjectSigningAlgValuesSupported []string `json:"request_object_signing_alg_values_supported"`
EndSessionEndpoint string `json:"end_session_endpoint"`
}
func GetOidcDiscovery ¶
func GetOidcDiscovery(host string, applicationName string) OidcDiscovery
type OktaSyncerProvider ¶
type OktaSyncerProvider struct {
Syncer *Syncer
}
OktaSyncerProvider implements SyncerProvider for Okta API-based syncers
func (*OktaSyncerProvider) AddUser ¶
func (p *OktaSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to Okta (not supported for read-only API)
func (*OktaSyncerProvider) Close ¶
func (p *OktaSyncerProvider) Close() error
Close closes any open connections (no-op for Okta API-based syncer)
func (*OktaSyncerProvider) GetOriginalGroups ¶
func (p *OktaSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from Okta (not implemented yet)
func (*OktaSyncerProvider) GetOriginalUserGroups ¶
func (p *OktaSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*OktaSyncerProvider) GetOriginalUsers ¶
func (p *OktaSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from Okta API
func (*OktaSyncerProvider) InitAdapter ¶
func (p *OktaSyncerProvider) InitAdapter() error
InitAdapter initializes the Okta syncer (no database adapter needed)
func (*OktaSyncerProvider) TestConnection ¶
func (p *OktaSyncerProvider) TestConnection() error
TestConnection tests the Okta API connection
func (*OktaSyncerProvider) UpdateUser ¶
func (p *OktaSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in Okta (not supported for read-only API)
type OktaUser ¶
type OktaUser struct {
Id string `json:"id"`
Status string `json:"status"`
Created string `json:"created"`
Profile struct {
Login string `json:"login"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
DisplayName string `json:"displayName"`
MobilePhone string `json:"mobilePhone"`
PrimaryPhone string `json:"primaryPhone"`
StreetAddress string `json:"streetAddress"`
City string `json:"city"`
State string `json:"state"`
ZipCode string `json:"zipCode"`
CountryCode string `json:"countryCode"`
PostalAddress string `json:"postalAddress"`
PreferredLanguage string `json:"preferredLanguage"`
Locale string `json:"locale"`
Timezone string `json:"timezone"`
Title string `json:"title"`
Department string `json:"department"`
Organization string `json:"organization"`
} `json:"profile"`
}
OktaUser represents a user from Okta API
type OrgDBManager ¶
type OrgDBManager struct {
// contains filtered or unexported fields
}
OrgDBManager manages per-org SQLite databases for IAM.
Directory layout:
{DataDir}/platform.db ← Cross-org: certs, syncer, system config
{DataDir}/orgs/{orgSlug}/iam.db ← Per-org: users, apps, providers, tokens
When orgIsolation is "none" (default), this manager is nil and all queries go through the global ormer.Engine as before.
func NewOrgDBManager ¶
func NewOrgDBManager(dataDir string) (*OrgDBManager, error)
NewOrgDBManager creates a new per-org database manager. Per-org databases use modernc.org/sqlite (pure Go). Directory-level isolation separates org data; file permissions are set to 0700.
func (*OrgDBManager) DeleteOrg ¶
func (m *OrgDBManager) DeleteOrg(orgSlug string) error
DeleteOrg removes an org's engine from the pool and deletes its directory.
func (*OrgDBManager) GetEngine ¶
func (m *OrgDBManager) GetEngine(orgSlug string) (*xorm.Engine, error)
GetEngine returns the xorm engine for an org, creating it on demand.
func (*OrgDBManager) ListOrgs ¶
func (m *OrgDBManager) ListOrgs() ([]string, error)
ListOrgs returns all provisioned org slugs by scanning the orgs directory.
func (*OrgDBManager) ProvisionOrg ¶
func (m *OrgDBManager) ProvisionOrg(orgSlug string) error
ProvisionOrg creates the org directory, database, and syncs org-scoped tables.
func (*OrgDBManager) ReleasePools ¶
func (m *OrgDBManager) ReleasePools()
ReleasePools closes all org engines. Call on shutdown.
type Organization ¶
type Organization struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
WebsiteUrl string `xorm:"varchar(100)" json:"websiteUrl"`
Logo string `xorm:"varchar(200)" json:"logo"`
LogoDark string `xorm:"varchar(200)" json:"logoDark"`
Favicon string `xorm:"varchar(200)" json:"favicon"`
HasPrivilegeConsent bool `xorm:"bool" json:"hasPrivilegeConsent"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
PasswordOptions []string `xorm:"mediumtext" json:"passwordOptions"`
PasswordObfuscatorType string `xorm:"varchar(100)" json:"passwordObfuscatorType"`
PasswordObfuscatorKey string `xorm:"varchar(100)" json:"passwordObfuscatorKey"`
PasswordExpireDays int `json:"passwordExpireDays"`
CountryCodes []string `xorm:"mediumtext" json:"countryCodes"`
DefaultAvatar string `xorm:"varchar(200)" json:"defaultAvatar"`
UsePermanentAvatar bool `xorm:"bool" json:"usePermanentAvatar"`
DefaultApplication string `xorm:"varchar(100)" json:"defaultApplication"`
UserTypes []string `xorm:"mediumtext" json:"userTypes"`
Tags []string `xorm:"mediumtext" json:"tags"`
Languages []string `xorm:"mediumtext" json:"languages"`
ThemeData *ThemeData `xorm:"json" json:"themeData"`
MasterPassword string `xorm:"varchar(200)" json:"masterPassword"`
DefaultPassword string `xorm:"varchar(200)" json:"defaultPassword"`
MasterVerificationCode string `xorm:"varchar(100)" json:"masterVerificationCode"`
IpWhitelist string `xorm:"varchar(200)" json:"ipWhitelist"`
InitScore int `json:"initScore"`
EnableSoftDeletion bool `json:"enableSoftDeletion"`
IsProfilePublic bool `json:"isProfilePublic"`
UseEmailAsUsername bool `json:"useEmailAsUsername"`
EnableTour bool `json:"enableTour"`
DisableSignin bool `json:"disableSignin"`
IpRestriction string `json:"ipRestriction"`
WidgetItems []string `xorm:"mediumtext" json:"widgetItems"`
MfaItems []*MfaItem `xorm:"mediumtext" json:"mfaItems"`
MfaRememberInHours int `json:"mfaRememberInHours"`
AccountMenu string `xorm:"varchar(20)" json:"accountMenu"`
AccountItems []*AccountItem `xorm:"mediumtext" json:"accountItems"`
// Per-org signin rate limiting. Overrides the application-level defaults.
// 0 = use the application setting (which defaults to 5 attempts / 15 min).
FailedSigninLimit int `json:"failedSigninLimit"`
FailedSigninFrozenTime int `json:"failedSigninFrozenTime"`
DcrPolicy string `xorm:"varchar(100)" json:"dcrPolicy"`
LdapAttributes []string `xorm:"mediumtext" json:"ldapAttributes"`
KerberosRealm string `xorm:"varchar(200)" json:"kerberosRealm"`
KerberosKdcHost string `xorm:"varchar(200)" json:"kerberosKdcHost"`
KerberosKeytab string `xorm:"mediumtext" json:"kerberosKeytab"`
KerberosServiceName string `xorm:"varchar(100)" json:"kerberosServiceName"`
// DEPRECATED: Balance is managed by Commerce (billing.hanzo.ai). Do not write to these fields.
OrgBalance float64 `json:"orgBalance"`
UserBalance float64 `json:"userBalance"`
BalanceCredit float64 `json:"balanceCredit"`
BalanceCurrency string `xorm:"varchar(100)" json:"balanceCurrency"`
IsPersonal bool `xorm:"bool" json:"isPersonal"`
}
func CreatePersonalOrganization ¶
func CreatePersonalOrganization(username, displayName string) (*Organization, error)
CreatePersonalOrganization creates a personal organization and default application for a new user. Uses a database transaction for atomicity — if either insert fails, both are rolled back.
func GetMaskedOrganization ¶
func GetMaskedOrganization(organization *Organization, errs ...error) (*Organization, error)
func GetMaskedOrganizations ¶
func GetMaskedOrganizations(organizations []*Organization, errs ...error) ([]*Organization, error)
func GetOrganization ¶
func GetOrganization(id string) (*Organization, error)
func GetOrganizationByUser ¶
func GetOrganizationByUser(user *User) (*Organization, error)
func GetOrganizations ¶
func GetOrganizations(owner string, name ...string) ([]*Organization, error)
func GetOrganizationsByFields ¶
func GetOrganizationsByFields(owner string, fields ...string) ([]*Organization, error)
func NewAdminOrg ¶ added in v1.14.21
func NewAdminOrg() *Organization
NewAdminOrg returns the admin organization placeholder (owner=name=admin).
func NewOrg ¶ added in v1.14.21
func NewOrg(name string) *Organization
NewOrg returns an *Organization placeholder owned by the admin org with the given name. Useful for non-admin orgs that the admin user creates.
func (*Organization) GetInitScore ¶
func (org *Organization) GetInitScore() (int, error)
type OriginalGroup ¶
type OriginalGroup struct {
Id string
Name string
DisplayName string
Description string
Type string
Manager string
Email string
}
OriginalGroup represents a group from an external system
type OriginalUser ¶
type OriginalUser = User
type Ormer ¶
type Ormer struct {
Db *sql.DB
Engine *xorm.Engine
OrgDBManager *OrgDBManager // nil when orgIsolation != "sqlite"
// contains filtered or unexported fields
}
Ormer represents the MySQL adapter for policy storage.
func NewAdapter ¶
NewAdapter is the constructor for Ormer.
func NewAdapterFromDb ¶
func NewAdapterFromDb(driverName string, dataSourceName string, dbName string, db *sql.DB) (*Ormer, error)
NewAdapterFromDb is the constructor for Ormer.
func (*Ormer) CreateDatabase ¶
type PK ¶
type PK = []interface{}
PK is a composite primary key type. Composite primary key type for hanzoai/xorm compatibility.
type Permission ¶
type Permission struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Description string `xorm:"varchar(100)" json:"description"`
Users []string `xorm:"mediumtext" json:"users"`
Groups []string `xorm:"mediumtext" json:"groups"`
Roles []string `xorm:"mediumtext" json:"roles"`
Domains []string `xorm:"mediumtext" json:"domains"`
Model string `xorm:"varchar(100)" json:"model"`
Adapter string `xorm:"varchar(100)" json:"adapter"`
ResourceType string `xorm:"varchar(100)" json:"resourceType"`
Resources []string `xorm:"mediumtext" json:"resources"`
Actions []string `xorm:"mediumtext" json:"actions"`
Effect string `xorm:"varchar(100)" json:"effect"`
IsEnabled bool `json:"isEnabled"`
Submitter string `xorm:"varchar(100)" json:"submitter"`
Approver string `xorm:"varchar(100)" json:"approver"`
ApproveTime string `xorm:"varchar(100)" json:"approveTime"`
State string `xorm:"varchar(100)" json:"state"`
}
func GetMaskedPermissions ¶
func GetMaskedPermissions(permissions []*Permission) []*Permission
func GetPaginationPermissions ¶
func GetPaginationPermissions(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Permission, error)
func GetPermission ¶
func GetPermission(id string) (*Permission, error)
func GetPermissions ¶
func GetPermissions(owner string) ([]*Permission, error)
func GetPermissionsByModel ¶
func GetPermissionsByModel(owner string, model string) ([]*Permission, error)
func GetPermissionsByResource ¶
func GetPermissionsByResource(resourceId string) ([]*Permission, error)
func GetPermissionsByRole ¶
func GetPermissionsByRole(roleId string) ([]*Permission, error)
func GetPermissionsBySubmitter ¶
func GetPermissionsBySubmitter(owner string, submitter string) ([]*Permission, error)
func (*Permission) GetId ¶
func (p *Permission) GetId() string
func (*Permission) GetModelAndAdapter ¶
func (p *Permission) GetModelAndAdapter() string
type PnvsSmsClient ¶
type PnvsSmsClient struct {
// contains filtered or unexported fields
}
func (*PnvsSmsClient) SendMessage ¶
func (c *PnvsSmsClient) SendMessage(param map[string]string, targetPhoneNumber ...string) error
type ProductInfo ¶
type ProductInfo struct {
Owner string `json:"owner"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Price float64 `json:"price"`
Quantity int `json:"quantity,omitempty"`
}
DEPRECATED: ProductInfo is retained for backward compatibility with the Cart column. Billing is now managed by Commerce (billing.hanzo.ai).
type Project ¶
type Project struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Description string `xorm:"varchar(500)" json:"description"`
Organization string `xorm:"varchar(100) index" json:"organization"`
Tags []string `xorm:"mediumtext" json:"tags"`
Metadata string `xorm:"mediumtext" json:"metadata"`
IsDefault bool `json:"isDefault"`
}
Project represents a project within an organization. Organizations contain projects, which scope applications and usage tracking.
func GetOrganizationProjects ¶
func GetPaginationProjects ¶
func GetProject ¶
func GetProjects ¶
type PrometheusInfo ¶
type PrometheusInfo struct {
ApiThroughput []GaugeVecInfo `json:"apiThroughput"`
ApiLatency []HistogramVecInfo `json:"apiLatency"`
TotalThroughput float64 `json:"totalThroughput"`
}
func GetPrometheusInfo ¶
func GetPrometheusInfo() (*PrometheusInfo, error)
type Provider ¶
type Provider struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk unique" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
SubType string `xorm:"varchar(100)" json:"subType"`
Method string `xorm:"varchar(100)" json:"method"`
ClientId string `xorm:"varchar(200)" json:"clientId"`
ClientSecret string `xorm:"varchar(3000)" json:"clientSecret"`
ClientId2 string `xorm:"varchar(100)" json:"clientId2"`
ClientSecret2 string `xorm:"varchar(500)" json:"clientSecret2"`
Cert string `xorm:"varchar(100)" json:"cert"`
CustomAuthUrl string `xorm:"varchar(200)" json:"customAuthUrl"`
CustomTokenUrl string `xorm:"varchar(200)" json:"customTokenUrl"`
CustomUserInfoUrl string `xorm:"varchar(200)" json:"customUserInfoUrl"`
CustomLogo string `xorm:"varchar(200)" json:"customLogo"`
Scopes string `xorm:"varchar(100)" json:"scopes"`
UserMapping map[string]string `xorm:"varchar(500)" json:"userMapping"`
HttpHeaders map[string]string `xorm:"varchar(500)" json:"httpHeaders"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
DisableSsl bool `json:"disableSsl"` // Deprecated: Use SslMode instead. If the provider type is WeChat, DisableSsl means EnableQRCode, if type is Google, it means sync phone number
SslMode string `xorm:"varchar(100)" json:"sslMode"` // "Auto" (empty means Auto), "Enable", "Disable"
Title string `xorm:"varchar(100)" json:"title"`
Content string `xorm:"varchar(2000)" json:"content"` // If provider type is WeChat, Content means QRCode string by Base64 encoding
Receiver string `xorm:"varchar(100)" json:"receiver"`
RegionId string `xorm:"varchar(100)" json:"regionId"`
SignName string `xorm:"varchar(100)" json:"signName"`
TemplateCode string `xorm:"varchar(100)" json:"templateCode"`
AppId string `xorm:"varchar(100)" json:"appId"`
Endpoint string `xorm:"varchar(1000)" json:"endpoint"`
IntranetEndpoint string `xorm:"varchar(100)" json:"intranetEndpoint"`
Domain string `xorm:"varchar(100)" json:"domain"`
Bucket string `xorm:"varchar(100)" json:"bucket"`
PathPrefix string `xorm:"varchar(100)" json:"pathPrefix"`
Metadata string `xorm:"mediumtext" json:"metadata"`
IdP string `xorm:"mediumtext" json:"idP"`
IssuerUrl string `xorm:"varchar(100)" json:"issuerUrl"`
EnableSignAuthnRequest bool `json:"enableSignAuthnRequest"`
EmailRegex string `xorm:"varchar(200)" json:"emailRegex"`
ProviderUrl string `xorm:"varchar(200)" json:"providerUrl"`
EnableProxy bool `json:"enableProxy"`
EnablePkce bool `json:"enablePkce"`
}
func GetGlobalProviders ¶
func GetMaskedProvider ¶
func GetMaskedProviders ¶
func GetPaginationProviders ¶
func GetProvider ¶
func GetProviders ¶
func GetProvidersByCategory ¶
func GetWechatMiniProgramProvider ¶
func GetWechatMiniProgramProvider(application *Application) *Provider
type ProviderItem ¶
type ProviderItem struct {
Owner string `json:"owner"`
Name string `json:"name"`
CanSignUp bool `json:"canSignUp"`
CanSignIn bool `json:"canSignIn"`
CanUnlink bool `json:"canUnlink"`
BindingRule *[]string `json:"bindingRule"`
CountryCodes []string `json:"countryCodes"`
Prompted bool `json:"prompted"`
SignupGroup string `json:"signupGroup"`
Rule string `json:"rule"`
Provider *Provider `json:"provider"`
}
func (*ProviderItem) IsProviderVisible ¶
func (pi *ProviderItem) IsProviderVisible() bool
type PushMfa ¶
type PushMfa struct {
*MfaProps
// contains filtered or unexported fields
}
func NewPushMfaUtil ¶
func (*PushMfa) SetupVerify ¶
type RadiusAccounting ¶
type RadiusAccounting struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime time.Time `json:"createdTime"`
Username string `xorm:"index" json:"username"`
ServiceType int64 `json:"serviceType"` // e.g. LoginUser (1)
NasId string `json:"nasId"` // String identifying the network access server originating the Access-Request.
NasIpAddr string `json:"nasIpAddr"` // e.g. "192.168.0.10"
NasPortId string `json:"nasPortId"` // Contains a text string which identifies the port of the NAS that is authenticating the user. e.g."eth.0"
NasPortType int64 `json:"nasPortType"` // Indicates the type of physical port the network access server is using to authenticate the user. e.g.Ethernet(15)
NasPort int64 `json:"nasPort"` // Indicates the physical port number of the network access server that is authenticating the user. e.g. 233
FramedIpAddr string `json:"framedIpAddr"` // Indicates the IP address to be configured for the user by sending the IP address of a user to the RADIUS server.
FramedIpNetmask string `json:"framedIpNetmask"` // Indicates the IP netmask to be configured for the user when the user is using a device on a network.
AcctSessionId string `xorm:"index" json:"acctSessionId"`
AcctSessionTime int64 `json:"acctSessionTime"` // Indicates how long (in seconds) the user has received service.
AcctInputTotal int64 `json:"acctInputTotal"`
AcctOutputTotal int64 `json:"acctOutputTotal"`
AcctInputPackets int64 `json:"acctInputPackets"` // Indicates how many packets have been received from the port over the course of this service being provided to a framed user.
AcctOutputPackets int64 `json:"acctOutputPackets"` // Indicates how many packets have been sent to the port in the course of delivering this service to a framed user.
AcctTerminateCause int64 `json:"acctTerminateCause"` // e.g. Lost-Carrier (2)
LastUpdate time.Time `json:"lastUpdate"`
AcctStartTime time.Time `xorm:"index" json:"acctStartTime"`
AcctStopTime time.Time `xorm:"index" json:"acctStopTime"`
}
func GetRadiusAccounting ¶
func GetRadiusAccounting(id string) (*RadiusAccounting, error)
func GetRadiusAccountingBySessionId ¶
func GetRadiusAccountingBySessionId(sessionId string) (*RadiusAccounting, error)
func (*RadiusAccounting) GetId ¶
func (ra *RadiusAccounting) GetId() string
type RadiusMfa ¶
type RadiusMfa struct {
*MfaProps
// contains filtered or unexported fields
}
func NewRadiusMfaUtil ¶
func (*RadiusMfa) SetupVerify ¶
type Record ¶
type Record struct {
Id int `xorm:"int notnull pk autoincr" json:"id"`
Owner string `xorm:"varchar(100) index" json:"owner"`
Name string `xorm:"varchar(100) index" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Organization string `xorm:"varchar(100)" json:"organization"`
ClientIp string `xorm:"varchar(100)" json:"clientIp"`
User string `xorm:"varchar(100)" json:"user"`
Method string `xorm:"varchar(100)" json:"method"`
RequestUri string `xorm:"varchar(1000)" json:"requestUri"`
Action string `xorm:"varchar(1000)" json:"action"`
Language string `xorm:"varchar(100)" json:"language"`
Object string `xorm:"mediumtext" json:"object"`
Response string `xorm:"mediumtext" json:"response"`
StatusCode int `json:"statusCode"`
IsTriggered bool `json:"isTriggered"`
}
func CopyRecord ¶
func GetPaginationRecords ¶
func GetRecords ¶
func GetRecordsByField ¶
type Resource ¶
type Resource struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(180) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
User string `xorm:"varchar(100)" json:"user"`
Provider string `xorm:"varchar(100)" json:"provider"`
Application string `xorm:"varchar(100)" json:"application"`
Tag string `xorm:"varchar(100)" json:"tag"`
Parent string `xorm:"varchar(100)" json:"parent"`
FileName string `xorm:"varchar(255)" json:"fileName"`
FileType string `xorm:"varchar(100)" json:"fileType"`
FileFormat string `xorm:"varchar(100)" json:"fileFormat"`
FileSize int `json:"fileSize"`
Url string `xorm:"varchar(500)" json:"url"`
Description string `xorm:"varchar(255)" json:"description"`
}
func GetDirectResources ¶
func GetPaginationResources ¶
func GetResource ¶
type RevokedToken ¶
type RevokedToken struct {
Id int64 `xorm:"pk autoincr" json:"id"`
TokenHash string `xorm:"varchar(100) notnull unique index" json:"tokenHash"`
TokenType string `xorm:"varchar(20)" json:"tokenType"` // "access_token" or "refresh_token"
RevokedAt string `xorm:"varchar(100)" json:"revokedAt"`
RevokedBy string `xorm:"varchar(100)" json:"revokedBy"` // User who revoked the token
ClientId string `xorm:"varchar(100)" json:"clientId"`
ExpiresAt string `xorm:"varchar(100)" json:"expiresAt"` // Original token expiration for cleanup
Owner string `xorm:"varchar(100)" json:"owner"`
Application string `xorm:"varchar(100)" json:"application"`
}
RevokedToken represents a revoked OAuth2 token (RFC 7009). Tokens are stored by their hash for security.
func GetRevokedTokens ¶
func GetRevokedTokens(owner string, application string) ([]*RevokedToken, error)
GetRevokedTokens returns all revoked tokens for an application.
type Role ¶
type Role struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Description string `xorm:"varchar(100)" json:"description"`
Users []string `xorm:"mediumtext" json:"users"`
Groups []string `xorm:"mediumtext" json:"groups"`
Roles []string `xorm:"mediumtext" json:"roles"`
Domains []string `xorm:"mediumtext" json:"domains"`
IsEnabled bool `json:"isEnabled"`
}
func GetAncestorRoles ¶
GetAncestorRoles returns a list of roles that contain the given roleIds
func GetMaskedRoles ¶
func GetPaginationRoles ¶
type Rule ¶
type Rule struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100) notnull" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100) notnull" json:"updatedTime"`
Type string `xorm:"varchar(100) notnull" json:"type"`
Expressions []*Expression `xorm:"mediumtext" json:"expressions"`
Action string `xorm:"varchar(100) notnull" json:"action"`
StatusCode int `xorm:"int notnull" json:"statusCode"`
Reason string `xorm:"varchar(100) notnull" json:"reason"`
IsVerbose bool `xorm:"bool" json:"isVerbose"`
}
func GetGlobalRules ¶
func GetPaginationRules ¶
func GetRulesByRuleIds ¶
type SCIMAddress ¶
type SCIMAddress struct {
StreetAddress string `json:"streetAddress"`
Locality string `json:"locality"`
Region string `json:"region"`
PostalCode string `json:"postalCode"`
Country string `json:"country"`
Formatted string `json:"formatted"`
Type string `json:"type"`
Primary bool `json:"primary"`
}
SCIMAddress represents a SCIM user address structure
type SCIMEmail ¶
type SCIMEmail struct {
Value string `json:"value"`
Type string `json:"type"`
Primary bool `json:"primary"`
}
SCIMEmail represents a SCIM user email structure
type SCIMListResponse ¶
type SCIMListResponse struct {
TotalResults int `json:"totalResults"`
ItemsPerPage int `json:"itemsPerPage"`
StartIndex int `json:"startIndex"`
Resources []*SCIMUser `json:"Resources"`
}
SCIMListResponse represents a SCIM list response
type SCIMName ¶
type SCIMName struct {
FamilyName string `json:"familyName"`
GivenName string `json:"givenName"`
Formatted string `json:"formatted"`
}
SCIMName represents a SCIM user name structure
type SCIMPhoneNumber ¶
type SCIMPhoneNumber struct {
Value string `json:"value"`
Type string `json:"type"`
Primary bool `json:"primary"`
}
SCIMPhoneNumber represents a SCIM user phone number structure
type SCIMSyncerProvider ¶
type SCIMSyncerProvider struct {
Syncer *Syncer
}
SCIMSyncerProvider implements SyncerProvider for SCIM 2.0 API-based syncers
func (*SCIMSyncerProvider) AddUser ¶
func (p *SCIMSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to SCIM (not supported for read-only API)
func (*SCIMSyncerProvider) Close ¶
func (p *SCIMSyncerProvider) Close() error
Close closes any open connections (no-op for SCIM API-based syncer)
func (*SCIMSyncerProvider) GetOriginalGroups ¶
func (p *SCIMSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from SCIM (not implemented yet)
func (*SCIMSyncerProvider) GetOriginalUserGroups ¶
func (p *SCIMSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*SCIMSyncerProvider) GetOriginalUsers ¶
func (p *SCIMSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from SCIM API
func (*SCIMSyncerProvider) InitAdapter ¶
func (p *SCIMSyncerProvider) InitAdapter() error
InitAdapter initializes the SCIM syncer (no database adapter needed)
func (*SCIMSyncerProvider) TestConnection ¶
func (p *SCIMSyncerProvider) TestConnection() error
TestConnection tests the SCIM API connection
func (*SCIMSyncerProvider) UpdateUser ¶
func (p *SCIMSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in SCIM (not supported for read-only API)
type SCIMUser ¶
type SCIMUser struct {
ID string `json:"id"`
ExternalID string `json:"externalId"`
UserName string `json:"userName"`
Name SCIMName `json:"name"`
DisplayName string `json:"displayName"`
NickName string `json:"nickName"`
ProfileURL string `json:"profileUrl"`
Title string `json:"title"`
UserType string `json:"userType"`
PreferredLan string `json:"preferredLanguage"`
Locale string `json:"locale"`
Timezone string `json:"timezone"`
Active bool `json:"active"`
Emails []SCIMEmail `json:"emails"`
PhoneNumbers []SCIMPhoneNumber `json:"phoneNumbers"`
Addresses []SCIMAddress `json:"addresses"`
}
SCIMUser represents a SCIM 2.0 user resource
type SafeAdapter ¶
type SafeAdapter struct {
*authzstore.Adapter
// contains filtered or unexported fields
}
SafeAdapter wraps an authzstore.Adapter and overrides RemovePolicy / RemovePolicies with versions that force-include the zero-valued V columns in the WHERE clause via MustCols. The base adapter already does this for single-row deletes; SafeAdapter exists because the authz library's bulk remove path used to call RemovePolicies, which the original xorm-adapter did NOT MustCols, leading to over-broad deletes in production. We keep the override here for parity with historical behavior.
func NewSafeAdapter ¶
func NewSafeAdapter(a *Adapter) *SafeAdapter
func (*SafeAdapter) RemovePolicies ¶
func (a *SafeAdapter) RemovePolicies(sec string, ptype string, rules [][]string) error
func (*SafeAdapter) RemovePolicy ¶
func (a *SafeAdapter) RemovePolicy(sec string, ptype string, rule []string) error
type Saml11AssertionArtifact ¶
type Saml11Request ¶
type Saml11Request struct {
XMLName xml.Name `xml:"Request"`
SAMLP string `xml:"samlp,attr"`
MajorVersion string `xml:"MajorVersion,attr"`
MinorVersion string `xml:"MinorVersion,attr"`
RequestID string `xml:"RequestID,attr"`
IssueInstant string `xml:"IssueInstance,attr"`
AssertionArtifact Saml11AssertionArtifact
}
type ScopeDescription ¶
type ScopeDescription struct {
Scope string `json:"scope"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
}
ScopeDescription represents a human-readable description of an OAuth scope
type Server ¶
type Server struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Url string `xorm:"varchar(500)" json:"url"`
Token string `xorm:"varchar(500)" json:"-"`
Application string `xorm:"varchar(100)" json:"application"`
Tools []*Tool `xorm:"mediumtext" json:"tools"`
}
func GetPaginationServers ¶
func GetServers ¶
type Session ¶
type Session struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
Application string `xorm:"varchar(100) notnull pk" json:"application"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
SessionId []string `json:"sessionId"`
ExclusiveSignin bool `xorm:"-"`
}
func GetPaginationSessions ¶
func GetSessions ¶
func GetSingleSession ¶
func GetUserAppSessions ¶
type SigninItem ¶
type SigninMethod ¶
type SignupItem ¶
type SignupItem struct {
Name string `json:"name"`
Visible bool `json:"visible"`
Required bool `json:"required"`
Prompted bool `json:"prompted"`
Type string `json:"type"`
CustomCss string `json:"customCss"`
Label string `json:"label"`
Placeholder string `json:"placeholder"`
Options []string `json:"options"`
Regex string `json:"regex"`
Rule string `json:"rule"`
}
type SingleSignOnService ¶
type Site ¶
type Site struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Tag string `xorm:"varchar(100)" json:"tag"`
Domain string `xorm:"varchar(100)" json:"domain"`
OtherDomains []string `xorm:"varchar(500)" json:"otherDomains"`
NeedRedirect bool `json:"needRedirect"`
DisableVerbose bool `json:"disableVerbose"`
Rules []string `xorm:"varchar(500)" json:"rules"`
EnableAlert bool `json:"enableAlert"`
AlertInterval int `json:"alertInterval"`
AlertTryTimes int `json:"alertTryTimes"`
AlertProviders []string `xorm:"varchar(500)" json:"alertProviders"`
Challenges []string `xorm:"mediumtext" json:"challenges"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
Hosts []string `xorm:"varchar(1000)" json:"hosts"`
SslMode string `xorm:"varchar(100)" json:"sslMode"`
SslCert string `xorm:"-" json:"sslCert"`
PublicIp string `xorm:"varchar(100)" json:"publicIp"`
Node string `xorm:"varchar(100)" json:"node"`
IsSelf bool `json:"isSelf"`
Status string `xorm:"varchar(100)" json:"status"`
Nodes []*NodeItem `xorm:"mediumtext" json:"nodes"`
IamApplication string `xorm:"varchar(100)" json:"iamApplication"`
ApplicationObj *Application `xorm:"-" json:"applicationObj"`
}
func GetGlobalSites ¶
func GetMaskedSite ¶
func GetMaskedSites ¶
func GetPaginationSites ¶
func GetSiteByDomain ¶
func (*Site) GetChallengeMap ¶
type SmsMfa ¶
type SmsMfa struct {
*MfaProps
}
func NewEmailMfaUtil ¶
func NewSmsMfaUtil ¶
func (*SmsMfa) SetupVerify ¶
type SsoLogoutNotification ¶
type SsoLogoutNotification struct {
// User information
Owner string `json:"owner"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Email string `json:"email"`
Phone string `json:"phone"`
Id string `json:"id"`
// Event type
Event string `json:"event"`
// Session-level information for targeted logout
SessionIds []string `json:"sessionIds"` // List of session IDs being logged out
AccessTokenHashes []string `json:"accessTokenHashes"` // Hashes of access tokens being expired
// Authentication fields to prevent malicious logout requests
Nonce string `json:"nonce"` // Random nonce for replay protection
Timestamp int64 `json:"timestamp"` // Unix timestamp of the notification
Signature string `json:"signature"` // HMAC-SHA256 signature for verification
}
SsoLogoutNotification represents the structure of a session-level SSO logout notification This includes session information and a signature for authentication
type Syncer ¶
type Syncer struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Organization string `xorm:"varchar(100)" json:"organization"`
Type string `xorm:"varchar(100)" json:"type"`
DatabaseType string `xorm:"varchar(100)" json:"databaseType"`
SslMode string `xorm:"varchar(100)" json:"sslMode"`
SshType string `xorm:"varchar(100)" json:"sshType"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
User string `xorm:"varchar(100)" json:"user"`
Password string `xorm:"varchar(150)" json:"password"`
SshHost string `xorm:"varchar(100)" json:"sshHost"`
SshPort int `json:"sshPort"`
SshUser string `xorm:"varchar(100)" json:"sshUser"`
SshPassword string `xorm:"varchar(150)" json:"sshPassword"`
Cert string `xorm:"varchar(100)" json:"cert"`
Database string `xorm:"varchar(100)" json:"database"`
Table string `xorm:"varchar(100)" json:"table"`
TableColumns []*TableColumn `xorm:"mediumtext" json:"tableColumns"`
AffiliationTable string `xorm:"varchar(100)" json:"affiliationTable"`
AvatarBaseUrl string `xorm:"varchar(100)" json:"avatarBaseUrl"`
ErrorText string `xorm:"mediumtext" json:"errorText"`
SyncInterval int `json:"syncInterval"`
IsReadOnly bool `json:"isReadOnly"`
IsEnabled bool `json:"isEnabled"`
Ormer *Ormer `xorm:"-" json:"-"`
SshClient *ssh.Client `xorm:"-" json:"-"`
}
func GetOrganizationSyncers ¶
func GetPaginationSyncers ¶
func GetSyncers ¶
type SyncerProvider ¶
type SyncerProvider interface {
// InitAdapter initializes the connection to the external system
InitAdapter() error
// GetOriginalUsers retrieves all users from the external system
GetOriginalUsers() ([]*OriginalUser, error)
// GetOriginalGroups retrieves all groups from the external system
GetOriginalGroups() ([]*OriginalGroup, error)
// GetOriginalUserGroups retrieves the group IDs that a user belongs to
GetOriginalUserGroups(userId string) ([]string, error)
// AddUser adds a new user to the external system
AddUser(user *OriginalUser) (bool, error)
// UpdateUser updates an existing user in the external system
UpdateUser(user *OriginalUser) (bool, error)
// TestConnection tests the connection to the external system
TestConnection() error
// Close closes any open connections and releases resources
Close() error
}
SyncerProvider defines the interface that all syncer implementations must satisfy. Different syncer types (Database, Keycloak, WeCom, Azure AD) implement this interface.
func GetSyncerProvider ¶
func GetSyncerProvider(syncer *Syncer) SyncerProvider
GetSyncerProvider returns the appropriate SyncerProvider implementation based on syncer type
type TableColumn ¶
type Ticket ¶
type Ticket struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
User string `xorm:"varchar(100) index" json:"user"`
Title string `xorm:"varchar(200)" json:"title"`
Content string `xorm:"mediumtext" json:"content"`
State string `xorm:"varchar(50)" json:"state"`
Messages []*TicketMessage `xorm:"mediumtext json" json:"messages"`
}
func GetPaginationTickets ¶
func GetTickets ¶
func GetUserTickets ¶
type TicketMessage ¶
type Token ¶
type Token struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Application string `xorm:"varchar(100)" json:"application"`
Organization string `xorm:"varchar(100)" json:"organization"`
User string `xorm:"varchar(100)" json:"user"`
Code string `xorm:"varchar(100) index" json:"code"`
AccessToken string `xorm:"mediumtext" json:"accessToken"`
RefreshToken string `xorm:"mediumtext" json:"refreshToken"`
AccessTokenHash string `xorm:"varchar(100) index" json:"accessTokenHash"`
RefreshTokenHash string `xorm:"varchar(100) index" json:"refreshTokenHash"`
ExpiresIn int `json:"expiresIn"`
Scope string `xorm:"varchar(100)" json:"scope"`
TokenType string `xorm:"varchar(100)" json:"tokenType"`
CodeChallenge string `xorm:"varchar(100)" json:"codeChallenge"`
CodeChallengeMethod string `xorm:"varchar(10)" json:"codeChallengeMethod"`
CodeIsUsed bool `json:"codeIsUsed"`
CodeExpireIn int64 `json:"codeExpireIn"`
Resource string `xorm:"varchar(255)" json:"resource"` // RFC 8707 Resource Indicator
}
func GetPaginationTokens ¶
func GetTokenByAccessToken ¶
func GetTokenByRefreshToken ¶
func GetTokenByTokenValue ¶
func GetTokenByUser ¶
func GetTokenByUser(application *Application, user *User, scope string, nonce string, host string) (*Token, error)
GetTokenByUser Implicit flow
func GetTokensByUser ¶
GetTokensByUser retrieves all tokens for a specific user
type TokenError ¶
type TokenWrapper ¶
type TotpMfa ¶
type TotpMfa struct {
*MfaProps
// contains filtered or unexported fields
}
func NewTotpMfaUtil ¶
func (*TotpMfa) SetupVerify ¶
type User ¶
type User struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(255) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100) index" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DeletedTime string `xorm:"varchar(100)" json:"deletedTime"`
Id string `xorm:"varchar(100) index" json:"id"`
ExternalId string `xorm:"varchar(100) index" json:"externalId"`
Type string `xorm:"varchar(100)" json:"type"`
Password string `xorm:"varchar(150)" json:"password"`
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
FirstName string `xorm:"varchar(100)" json:"firstName"`
LastName string `xorm:"varchar(100)" json:"lastName"`
Avatar string `xorm:"text" json:"avatar"`
AvatarType string `xorm:"varchar(100)" json:"avatarType"`
PermanentAvatar string `xorm:"varchar(500)" json:"permanentAvatar"`
Email string `xorm:"varchar(100) index" json:"email"`
EmailVerified bool `json:"emailVerified"`
Phone string `xorm:"varchar(100) index" json:"phone"`
CountryCode string `xorm:"varchar(6)" json:"countryCode"`
Region string `xorm:"varchar(100)" json:"region"`
Location string `xorm:"varchar(100)" json:"location"`
Address []string `json:"address"`
Addresses []*Address `xorm:"addresses blob" json:"addresses"`
Affiliation string `xorm:"varchar(100)" json:"affiliation"`
Title string `xorm:"varchar(100)" json:"title"`
IdCardType string `xorm:"varchar(100)" json:"idCardType"`
IdCard string `xorm:"varchar(100) index" json:"idCard"`
RealName string `xorm:"varchar(100)" json:"realName"`
IsVerified bool `json:"isVerified"`
Homepage string `xorm:"varchar(100)" json:"homepage"`
Bio string `xorm:"varchar(100)" json:"bio"`
Tag string `xorm:"varchar(100)" json:"tag"`
Language string `xorm:"varchar(100)" json:"language"`
Gender string `xorm:"varchar(100)" json:"gender"`
Birthday string `xorm:"varchar(100)" json:"birthday"`
Education string `xorm:"varchar(100)" json:"education"`
Score int `json:"score"`
Karma int `json:"karma"`
Ranking int `json:"ranking"`
// DEPRECATED: Balance is managed by Commerce (billing.hanzo.ai). Do not write to these fields.
Balance float64 `json:"balance"`
BalanceCredit float64 `json:"balanceCredit"`
Currency string `xorm:"varchar(100)" json:"currency"`
BalanceCurrency string `xorm:"varchar(100)" json:"balanceCurrency"`
IsDefaultAvatar bool `xorm:"bool default false" json:"isDefaultAvatar"`
IsOnline bool `xorm:"bool default false" json:"isOnline"`
IsAdmin bool `xorm:"bool default false" json:"isAdmin"`
IsForbidden bool `xorm:"bool default false" json:"isForbidden"`
IsDeleted bool `xorm:"bool default false" json:"isDeleted"`
SignupApplication string `xorm:"varchar(100)" json:"signupApplication"`
Hash string `xorm:"varchar(100)" json:"hash"`
PreHash string `xorm:"varchar(100)" json:"preHash"`
RegisterType string `xorm:"varchar(100)" json:"registerType"`
RegisterSource string `xorm:"varchar(100)" json:"registerSource"`
AccessKey string `xorm:"varchar(100)" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
AccessToken string `xorm:"mediumtext" json:"accessToken"`
OriginalToken string `xorm:"mediumtext" json:"originalToken"`
OriginalRefreshToken string `xorm:"mediumtext" json:"originalRefreshToken"`
CreatedIp string `xorm:"varchar(100)" json:"createdIp"`
LastSigninTime string `xorm:"varchar(100)" json:"lastSigninTime"`
LastSigninIp string `xorm:"varchar(100)" json:"lastSigninIp"`
GitHub string `xorm:"github varchar(100)" json:"github"`
Google string `xorm:"varchar(100)" json:"google"`
QQ string `xorm:"qq varchar(100)" json:"qq"`
WeChat string `xorm:"wechat varchar(100)" json:"wechat"`
Facebook string `xorm:"facebook varchar(100)" json:"facebook"`
DingTalk string `xorm:"dingtalk varchar(100)" json:"dingtalk"`
Weibo string `xorm:"weibo varchar(100)" json:"weibo"`
Gitee string `xorm:"gitee varchar(100)" json:"gitee"`
LinkedIn string `xorm:"linkedin varchar(100)" json:"linkedin"`
Wecom string `xorm:"wecom varchar(100)" json:"wecom"`
Lark string `xorm:"lark varchar(100)" json:"lark"`
Gitlab string `xorm:"gitlab varchar(100)" json:"gitlab"`
Adfs string `xorm:"adfs varchar(100)" json:"adfs"`
Baidu string `xorm:"baidu varchar(100)" json:"baidu"`
Alipay string `xorm:"alipay varchar(100)" json:"alipay"`
Iam string `xorm:"iam varchar(100)" json:"iam"`
Infoflow string `xorm:"infoflow varchar(100)" json:"infoflow"`
Apple string `xorm:"apple varchar(100)" json:"apple"`
AzureAD string `xorm:"azuread varchar(100)" json:"azuread"`
AzureADB2c string `xorm:"azureadb2c varchar(100)" json:"azureadb2c"`
Slack string `xorm:"slack varchar(100)" json:"slack"`
Steam string `xorm:"steam varchar(100)" json:"steam"`
Bilibili string `xorm:"bilibili varchar(100)" json:"bilibili"`
Okta string `xorm:"okta varchar(100)" json:"okta"`
Douyin string `xorm:"douyin varchar(100)" json:"douyin"`
Kwai string `xorm:"kwai varchar(100)" json:"kwai"`
Line string `xorm:"line varchar(100)" json:"line"`
Amazon string `xorm:"amazon varchar(100)" json:"amazon"`
Auth0 string `xorm:"auth0 varchar(100)" json:"auth0"`
BattleNet string `xorm:"battlenet varchar(100)" json:"battlenet"`
Bitbucket string `xorm:"bitbucket varchar(100)" json:"bitbucket"`
Box string `xorm:"box varchar(100)" json:"box"`
CloudFoundry string `xorm:"cloudfoundry varchar(100)" json:"cloudfoundry"`
Dailymotion string `xorm:"dailymotion varchar(100)" json:"dailymotion"`
Deezer string `xorm:"deezer varchar(100)" json:"deezer"`
DigitalOcean string `xorm:"digitalocean varchar(100)" json:"digitalocean"`
Discord string `xorm:"discord varchar(100)" json:"discord"`
Dropbox string `xorm:"dropbox varchar(100)" json:"dropbox"`
EveOnline string `xorm:"eveonline varchar(100)" json:"eveonline"`
Fitbit string `xorm:"fitbit varchar(100)" json:"fitbit"`
Gitea string `xorm:"gitea varchar(100)" json:"gitea"`
Heroku string `xorm:"heroku varchar(100)" json:"heroku"`
InfluxCloud string `xorm:"influxcloud varchar(100)" json:"influxcloud"`
Instagram string `xorm:"instagram varchar(100)" json:"instagram"`
Intercom string `xorm:"intercom varchar(100)" json:"intercom"`
Kakao string `xorm:"kakao varchar(100)" json:"kakao"`
Lastfm string `xorm:"lastfm varchar(100)" json:"lastfm"`
Mailru string `xorm:"mailru varchar(100)" json:"mailru"`
Meetup string `xorm:"meetup varchar(100)" json:"meetup"`
MicrosoftOnline string `xorm:"microsoftonline varchar(100)" json:"microsoftonline"`
Nextcloud string `xorm:"nextcloud varchar(100)" json:"nextcloud"`
OneDrive string `xorm:"onedrive varchar(100)" json:"onedrive"`
Oura string `xorm:"oura varchar(100)" json:"oura"`
Patreon string `xorm:"patreon varchar(100)" json:"patreon"`
Paypal string `xorm:"paypal varchar(100)" json:"paypal"`
SalesForce string `xorm:"salesforce varchar(100)" json:"salesforce"`
Shopify string `xorm:"shopify varchar(100)" json:"shopify"`
Soundcloud string `xorm:"soundcloud varchar(100)" json:"soundcloud"`
Spotify string `xorm:"spotify varchar(100)" json:"spotify"`
Strava string `xorm:"strava varchar(100)" json:"strava"`
Stripe string `xorm:"stripe varchar(100)" json:"stripe"`
Telegram string `xorm:"telegram varchar(100)" json:"telegram"`
TikTok string `xorm:"tiktok varchar(100)" json:"tiktok"`
Tumblr string `xorm:"tumblr varchar(100)" json:"tumblr"`
Twitch string `xorm:"twitch varchar(100)" json:"twitch"`
Twitter string `xorm:"twitter varchar(100)" json:"twitter"`
Typetalk string `xorm:"typetalk varchar(100)" json:"typetalk"`
Uber string `xorm:"uber varchar(100)" json:"uber"`
VK string `xorm:"vk varchar(100)" json:"vk"`
Wepay string `xorm:"wepay varchar(100)" json:"wepay"`
Xero string `xorm:"xero varchar(100)" json:"xero"`
Yahoo string `xorm:"yahoo varchar(100)" json:"yahoo"`
Yammer string `xorm:"yammer varchar(100)" json:"yammer"`
Yandex string `xorm:"yandex varchar(100)" json:"yandex"`
Zoom string `xorm:"zoom varchar(100)" json:"zoom"`
MetaMask string `xorm:"metamask varchar(100)" json:"metamask"`
Web3Onboard string `xorm:"web3onboard varchar(100)" json:"web3onboard"`
Custom string `xorm:"custom varchar(100)" json:"custom"`
Custom2 string `xorm:"custom2 text" json:"custom2"`
Custom3 string `xorm:"custom3 text" json:"custom3"`
Custom4 string `xorm:"custom4 text" json:"custom4"`
Custom5 string `xorm:"custom5 text" json:"custom5"`
Custom6 string `xorm:"custom6 text" json:"custom6"`
Custom7 string `xorm:"custom7 text" json:"custom7"`
Custom8 string `xorm:"custom8 text" json:"custom8"`
Custom9 string `xorm:"custom9 text" json:"custom9"`
Custom10 string `xorm:"custom10 text" json:"custom10"`
WebauthnCredentials []webauthn.Credential `xorm:"webauthnCredentials blob" json:"webauthnCredentials"`
PreferredMfaType string `xorm:"varchar(100)" json:"preferredMfaType"`
RecoveryCodes []string `xorm:"mediumtext" json:"recoveryCodes"`
TotpSecret string `xorm:"varchar(100)" json:"totpSecret"`
VerificationCode string `xorm:"varchar(20)" json:"verificationCode"` // Per-user pinned OTP (test/sandbox users)
MfaPhoneEnabled bool `json:"mfaPhoneEnabled"`
MfaEmailEnabled bool `json:"mfaEmailEnabled"`
MfaRadiusEnabled bool `json:"mfaRadiusEnabled"`
MfaRadiusUsername string `xorm:"varchar(100)" json:"mfaRadiusUsername"`
MfaRadiusProvider string `xorm:"varchar(100)" json:"mfaRadiusProvider"`
MfaPushEnabled bool `json:"mfaPushEnabled"`
MfaPushReceiver string `xorm:"varchar(100)" json:"mfaPushReceiver"`
MfaPushProvider string `xorm:"varchar(100)" json:"mfaPushProvider"`
MultiFactorAuths []*MfaProps `xorm:"-" json:"multiFactorAuths,omitempty"`
Invitation string `xorm:"varchar(100) index" json:"invitation"`
InvitationCode string `xorm:"varchar(100) index" json:"invitationCode"`
FaceIds []*FaceId `json:"faceIds"`
Cart []ProductInfo `xorm:"mediumtext" json:"cart"`
Ldap string `xorm:"ldap varchar(100)" json:"ldap"`
Properties map[string]string `json:"properties"`
Roles []*Role `json:"roles"`
Permissions []*Permission `json:"permissions"`
Groups []string `xorm:"mediumtext" json:"groups"`
LastChangePasswordTime string `xorm:"varchar(100)" json:"lastChangePasswordTime"`
LastSigninWrongTime string `xorm:"varchar(100)" json:"lastSigninWrongTime"`
SigninWrongTimes int `json:"signinWrongTimes"`
ManagedAccounts []ManagedAccount `xorm:"managedAccounts blob" json:"managedAccounts"`
MfaAccounts []MfaAccount `xorm:"mfaAccounts blob" json:"mfaAccounts"`
MfaItems []*MfaItem `xorm:"mediumtext" json:"mfaItems"`
MfaRememberDeadline string `xorm:"varchar(100)" json:"mfaRememberDeadline"`
NeedUpdatePassword bool `json:"needUpdatePassword"`
IpWhitelist string `xorm:"varchar(200)" json:"ipWhitelist"`
ApplicationScopes []ConsentRecord `xorm:"mediumtext" json:"applicationScopes"`
}
func CheckUserPassword ¶
func GetFilteredUser ¶
func GetGlobalUsers ¶
func GetGroupUsers ¶
func GetMaskedUser ¶
func GetPaginationGroupUsers ¶
func GetPaginationUsers ¶
func GetUserByAccessKey ¶
func GetUserByEmailOnly ¶
func GetUserByField ¶
func GetUserByFieldCrossOrg ¶
GetUserByFieldCrossOrg looks up a user by field across ALL organizations. Used as a fallback when the org-scoped lookup fails, enabling multi-tenant login where users may belong to a different org than the app's org.
With orgIsolation=sqlite each org's user rows live in a separate DB file, so a single global query cannot see them. We iterate per-org engines for the configured tenant orgs; the global engine still answers when isolation is disabled.
func GetUserByInvitationCode ¶
func GetUserByKerberosName ¶
GetUserByKerberosName looks up a user by their Kerberos principal name. It strips the realm part (e.g., "user@REALM.COM" -> "user") and searches by username.
func GetUserByPhoneOnly ¶
func GetUserByUserIdOnly ¶
func GetUserByWebauthID ¶
func GetUserNoCheck ¶
func GetUsersByTagWithFilter ¶
func NewAdminUser ¶ added in v1.14.21
func NewAdminUser() *User
NewAdminUser returns the bootstrap admin user placeholder.
func (*User) AddCredentials ¶
func (*User) CheckUserFace ¶
func (*User) CredentialExcludeList ¶
func (user *User) CredentialExcludeList() []protocol.CredentialDescriptor
CredentialExcludeList returns a CredentialDescriptor array filled with all the user's credentials
func (*User) DeleteCredentials ¶
func (*User) GetCountryCode ¶
func (*User) GetFriendlyName ¶
func (*User) GetPreferredMfaProps ¶
func (*User) GetUserFullGroupPath ¶
func (*User) IsAdminUser ¶
func (*User) IsApplicationAdmin ¶
func (user *User) IsApplicationAdmin(application *Application) bool
func (*User) IsGlobalAdmin ¶
func (*User) IsMfaEnabled ¶
func (*User) UpdateUserHash ¶
func (*User) UpdateUserPassword ¶
func (user *User) UpdateUserPassword(organization *Organization)
func (*User) WebAuthnCredentials ¶
func (user *User) WebAuthnCredentials() []webauthn.Credential
func (*User) WebAuthnDisplayName ¶
func (*User) WebAuthnID ¶
WebAuthnID implementation of webauthn.User interface
func (*User) WebAuthnIcon ¶
func (*User) WebAuthnName ¶
type UserGroupEnforcer ¶
type UserGroupEnforcer struct {
// contains filtered or unexported fields
}
func NewUserGroupEnforcer ¶
func NewUserGroupEnforcer(enforcer *authz.Enforcer) *UserGroupEnforcer
func (*UserGroupEnforcer) AddGroupForUser ¶
func (e *UserGroupEnforcer) AddGroupForUser(user string, group string) (bool, error)
func (*UserGroupEnforcer) AddGroupsForUser ¶
func (e *UserGroupEnforcer) AddGroupsForUser(user string, groups []string) (bool, error)
func (*UserGroupEnforcer) DeleteGroupForUser ¶
func (e *UserGroupEnforcer) DeleteGroupForUser(user string, group string) (bool, error)
func (*UserGroupEnforcer) DeleteGroupsForUser ¶
func (e *UserGroupEnforcer) DeleteGroupsForUser(user string) (bool, error)
func (*UserGroupEnforcer) GetAllUsersByGroup ¶
func (e *UserGroupEnforcer) GetAllUsersByGroup(group string) ([]string, error)
func (*UserGroupEnforcer) GetGroupsForUser ¶
func (e *UserGroupEnforcer) GetGroupsForUser(user string) ([]string, error)
func (*UserGroupEnforcer) GetUserNamesByGroupName ¶
func (e *UserGroupEnforcer) GetUserNamesByGroupName(groupName string) ([]string, error)
func (*UserGroupEnforcer) UpdateGroupsForUser ¶
func (e *UserGroupEnforcer) UpdateGroupsForUser(user string, groups []string) (bool, error)
type UserShort ¶
type UserShort struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
Id string `xorm:"varchar(100) index" json:"id"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Avatar string `xorm:"varchar(500)" json:"avatar"`
Email string `xorm:"varchar(100) index" json:"email"`
EmailVerified bool `json:"email_verified,omitempty"`
Phone string `xorm:"varchar(100) index" json:"phone"`
}
type UserStandard ¶
type UserStandard struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"preferred_username,omitempty"`
Id string `xorm:"varchar(100) index" json:"id"`
DisplayName string `xorm:"varchar(100)" json:"name,omitempty"`
Avatar string `xorm:"varchar(500)" json:"picture,omitempty"`
Email string `xorm:"varchar(100) index" json:"email,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Phone string `xorm:"varchar(100) index" json:"phone,omitempty"`
}
type UserWithoutThirdIdp ¶
type UserWithoutThirdIdp struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100) index" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DeletedTime string `xorm:"varchar(100)" json:"deletedTime"`
Id string `xorm:"varchar(100) index" json:"id"`
Type string `xorm:"varchar(100)" json:"type"`
Password string `xorm:"varchar(150)" json:"password"`
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
FirstName string `xorm:"varchar(100)" json:"firstName"`
LastName string `xorm:"varchar(100)" json:"lastName"`
Avatar string `xorm:"varchar(500)" json:"avatar"`
AvatarType string `xorm:"varchar(100)" json:"avatarType"`
PermanentAvatar string `xorm:"varchar(500)" json:"permanentAvatar"`
Email string `xorm:"varchar(100) index" json:"email"`
EmailVerified bool `json:"email_verified"`
Phone string `xorm:"varchar(100) index" json:"phone"`
CountryCode string `xorm:"varchar(6)" json:"countryCode"`
Region string `xorm:"varchar(100)" json:"region"`
Location string `xorm:"varchar(100)" json:"location"`
Address []string `json:"address"`
Affiliation string `xorm:"varchar(100)" json:"affiliation"`
Title string `xorm:"varchar(100)" json:"title"`
IdCardType string `xorm:"varchar(100)" json:"idCardType"`
IdCard string `xorm:"varchar(100) index" json:"idCard"`
Homepage string `xorm:"varchar(100)" json:"homepage"`
Bio string `xorm:"varchar(100)" json:"bio"`
Tag string `xorm:"varchar(100)" json:"tag"`
Language string `xorm:"varchar(100)" json:"language"`
Gender string `xorm:"varchar(100)" json:"gender"`
Birthday string `xorm:"varchar(100)" json:"birthday"`
Education string `xorm:"varchar(100)" json:"education"`
Score int `json:"score"`
Karma int `json:"karma"`
Ranking int `json:"ranking"`
IsDefaultAvatar bool `json:"isDefaultAvatar"`
IsOnline bool `json:"isOnline"`
IsAdmin bool `json:"isAdmin"`
IsForbidden bool `json:"isForbidden"`
IsDeleted bool `json:"isDeleted"`
SignupApplication string `xorm:"varchar(100)" json:"signupApplication"`
Hash string `xorm:"varchar(100)" json:"hash"`
PreHash string `xorm:"varchar(100)" json:"preHash"`
RegisterType string `xorm:"varchar(100)" json:"registerType"`
RegisterSource string `xorm:"varchar(100)" json:"registerSource"`
GitHub string `xorm:"github varchar(100)" json:"github"`
Google string `xorm:"varchar(100)" json:"google"`
QQ string `xorm:"qq varchar(100)" json:"qq"`
WeChat string `xorm:"wechat varchar(100)" json:"wechat"`
Facebook string `xorm:"facebook varchar(100)" json:"facebook"`
DingTalk string `xorm:"dingtalk varchar(100)" json:"dingtalk"`
Weibo string `xorm:"weibo varchar(100)" json:"weibo"`
Gitee string `xorm:"gitee varchar(100)" json:"gitee"`
LinkedIn string `xorm:"linkedin varchar(100)" json:"linkedin"`
Wecom string `xorm:"wecom varchar(100)" json:"wecom"`
Lark string `xorm:"lark varchar(100)" json:"lark"`
Gitlab string `xorm:"gitlab varchar(100)" json:"gitlab"`
CreatedIp string `xorm:"varchar(100)" json:"createdIp"`
LastSigninTime string `xorm:"varchar(100)" json:"lastSigninTime"`
LastSigninIp string `xorm:"varchar(100)" json:"lastSigninIp"`
// WebauthnCredentials []webauthn.Credential `xorm:"webauthnCredentials blob" json:"webauthnCredentials"`
PreferredMfaType string `xorm:"varchar(100)" json:"preferredMfaType"`
RecoveryCodes []string `xorm:"mediumtext" json:"recoveryCodes"`
TotpSecret string `xorm:"varchar(100)" json:"totpSecret"`
MfaPhoneEnabled bool `json:"mfaPhoneEnabled"`
MfaEmailEnabled bool `json:"mfaEmailEnabled"`
Ldap string `xorm:"ldap varchar(100)" json:"ldap"`
Properties map[string]string `json:"properties"`
Roles []*Role `json:"roles"`
Permissions []*Permission `json:"permissions"`
Groups []string `xorm:"groups varchar(1000)" json:"groups"`
LastSigninWrongTime string `xorm:"varchar(100)" json:"lastSigninWrongTime"`
SigninWrongTimes int `json:"signinWrongTimes"`
ManagedAccounts []ManagedAccount `xorm:"managedAccounts blob" json:"managedAccounts"`
}
type Userinfo ¶
type Userinfo struct {
Sub string `json:"sub"`
Iss string `json:"iss"`
Aud string `json:"aud"`
Name string `json:"preferred_username,omitempty"`
DisplayName string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Avatar string `json:"picture,omitempty"`
Address string `json:"address,omitempty"`
Phone string `json:"phone,omitempty"`
RealName string `json:"real_name,omitempty"`
IsVerified bool `json:"is_verified,omitempty"`
Groups []string `json:"groups,omitempty"`
Roles []string `json:"roles,omitempty"`
Permissions []string `json:"permissions,omitempty"`
}
type ValidatorFunc ¶
type VerificationRecord ¶
type VerificationRecord struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
RemoteAddr string `xorm:"varchar(100)" json:"remoteAddr"`
Type string `xorm:"varchar(10)" json:"type"`
User string `xorm:"varchar(100) notnull" json:"user"`
Provider string `xorm:"varchar(100) notnull" json:"provider"`
Receiver string `xorm:"varchar(100) index notnull" json:"receiver"`
Code string `xorm:"varchar(10) notnull" json:"code"`
Time int64 `xorm:"notnull" json:"time"`
IsUsed bool `xorm:"notnull" json:"isUsed"`
}
func GetPaginationVerifications ¶
func GetPaginationVerifications(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*VerificationRecord, error)
func GetUserVerifications ¶
func GetUserVerifications(owner, user string) ([]*VerificationRecord, error)
func GetVerification ¶
func GetVerification(id string) (*VerificationRecord, error)
func GetVerifications ¶
func GetVerifications(owner string) ([]*VerificationRecord, error)
type VerifyResult ¶
func CheckVerificationCode ¶
func CheckVerificationCode(dest string, code string, lang string) (*VerifyResult, error)
type ViaSSHDialer ¶
func (*ViaSSHDialer) DialContext ¶
func (*ViaSSHDialer) DialTimeout ¶
type WebFinger ¶
type WebFinger struct {
Subject string `json:"subject"`
Links []WebFingerLink `json:"links"`
Aliases *[]string `json:"aliases,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
type WebFingerLink ¶
type Webhook ¶
type Webhook struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Organization string `xorm:"varchar(100) index" json:"organization"`
Url string `xorm:"varchar(200)" json:"url"`
Method string `xorm:"varchar(100)" json:"method"`
ContentType string `xorm:"varchar(100)" json:"contentType"`
Headers []*Header `xorm:"mediumtext" json:"headers"`
Events []string `xorm:"mediumtext" json:"events"`
TokenFields []string `xorm:"mediumtext" json:"tokenFields"`
ObjectFields []string `xorm:"mediumtext" json:"objectFields"`
IsUserExtended bool `json:"isUserExtended"`
SingleOrgOnly bool `json:"singleOrgOnly"`
IsEnabled bool `json:"isEnabled"`
}
func GetPaginationWebhooks ¶
func GetWebhook ¶
type WecomAccessTokenResp ¶
type WecomDeptListResp ¶
type WecomSyncerProvider ¶
type WecomSyncerProvider struct {
Syncer *Syncer
}
WecomSyncerProvider implements SyncerProvider for WeCom (WeChat Work) API-based syncers
func (*WecomSyncerProvider) AddUser ¶
func (p *WecomSyncerProvider) AddUser(user *OriginalUser) (bool, error)
AddUser adds a new user to WeCom (not supported for read-only API)
func (*WecomSyncerProvider) Close ¶
func (p *WecomSyncerProvider) Close() error
Close closes any open connections (no-op for WeCom API-based syncer)
func (*WecomSyncerProvider) GetOriginalGroups ¶
func (p *WecomSyncerProvider) GetOriginalGroups() ([]*OriginalGroup, error)
GetOriginalGroups retrieves all groups from WeCom (not implemented yet)
func (*WecomSyncerProvider) GetOriginalUserGroups ¶
func (p *WecomSyncerProvider) GetOriginalUserGroups(userId string) ([]string, error)
GetOriginalUserGroups retrieves the group IDs that a user belongs to (not implemented yet)
func (*WecomSyncerProvider) GetOriginalUsers ¶
func (p *WecomSyncerProvider) GetOriginalUsers() ([]*OriginalUser, error)
GetOriginalUsers retrieves all users from WeCom API
func (*WecomSyncerProvider) InitAdapter ¶
func (p *WecomSyncerProvider) InitAdapter() error
InitAdapter initializes the WeCom syncer (no database adapter needed)
func (*WecomSyncerProvider) TestConnection ¶
func (p *WecomSyncerProvider) TestConnection() error
TestConnection tests the WeCom API connection
func (*WecomSyncerProvider) UpdateUser ¶
func (p *WecomSyncerProvider) UpdateUser(user *OriginalUser) (bool, error)
UpdateUser updates an existing user in WeCom (not supported for read-only API)
type WecomUser ¶
type WecomUser struct {
UserId string `json:"userid"`
Name string `json:"name"`
Department []int `json:"department"`
Position string `json:"position"`
Mobile string `json:"mobile"`
Gender string `json:"gender"`
Email string `json:"email"`
Avatar string `json:"avatar"`
Status int `json:"status"`
Enable int `json:"enable"`
}
type WecomUserListResp ¶
type X509Certificate ¶
type X509Data ¶
type X509Data struct {
XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# X509Data"`
X509Certificate X509Certificate `xml:",innerxml"`
}
Source Files
¶
- adapter.go
- adapter_safe.go
- admin.go
- application.go
- application_cache.go
- application_item.go
- authz_engine.go
- avatar.go
- captcha.go
- cert.go
- cert_cache.go
- cert_whois.go
- check.go
- check_ip.go
- check_password_complexity.go
- check_password_expired.go
- check_util.go
- email.go
- enforcer.go
- form.go
- get-dashboard.go
- group.go
- group_upload.go
- init.go
- init_data.go
- init_data_dump.go
- invitation.go
- jwks_cache.go
- jwt_mldsa65.go
- kerberos.go
- key.go
- kms.go
- ldap.go
- ldap_autosync.go
- ldap_conn.go
- ldap_password_type.go
- mfa.go
- mfa_push.go
- mfa_radius.go
- mfa_sms.go
- mfa_totp.go
- model.go
- notification.go
- oauth_dcr.go
- organization.go
- organization_cache.go
- orgdb.go
- orgdb_middleware.go
- ormer.go
- ormer_session.go
- permission.go
- permission_enforcer.go
- permission_upload.go
- project.go
- prometheus.go
- provider.go
- provider_item.go
- radius.go
- record.go
- resource.go
- resource_direct.go
- role.go
- role_upload.go
- rule.go
- rule_cache.go
- saml_idp.go
- saml_sp.go
- server.go
- session.go
- site.go
- site_cache.go
- site_cert.go
- site_cert_account.go
- site_cert_ecc.go
- site_cert_http.go
- site_timer.go
- site_timer_health.go
- sms.go
- sms_custom_http.go
- sms_pnvs.go
- storage.go
- syncer.go
- syncer_activedirectory.go
- syncer_affiliation.go
- syncer_awsiam.go
- syncer_azuread.go
- syncer_cron.go
- syncer_database.go
- syncer_dingtalk.go
- syncer_googleworkspace.go
- syncer_group.go
- syncer_interface.go
- syncer_keycloak.go
- syncer_lark.go
- syncer_okta.go
- syncer_public_api.go
- syncer_scim.go
- syncer_sync.go
- syncer_user.go
- syncer_util.go
- syncer_wecom.go
- ticket.go
- token.go
- token_cas.go
- token_cleanup.go
- token_jwt.go
- token_jwt_key.go
- token_oauth.go
- token_revocation.go
- token_standard_jwt.go
- user.go
- user_avatar.go
- user_avatar_favicon.go
- user_avatar_gravatar.go
- user_avatar_identicon.go
- user_cache.go
- user_cred.go
- user_enforcer.go
- user_scope.go
- user_upload.go
- user_util.go
- user_webauthn.go
- util.go
- verification.go
- viaSSHDialer.go
- webhook.go
- webhook_util.go
- wellknown_oauth_prm.go
- wellknown_oidc_discovery.go
- xorm_compat.go