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 AddGroup(group *Group) (bool, error)
- func AddGroups(groups []*Group) (bool, error)
- func AddInvitation(invitation *Invitation, lang string) (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 AddProvider(provider *Provider) (bool, error)
- func AddRadiusAccounting(ra *RadiusAccounting) error
- func AddRecord(record *casvisorsdk.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 AddSession(session *Session) (bool, error)
- func AddSyncer(syncer *Syncer) (bool, error)
- func AddToVerificationRecord(user *User, provider *Provider, remoteAddr, recordType, dest, code string) error
- func AddToken(token *Token) (bool, error)
- func AddUser(user *User) (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 BatchEnforce(permission *Permission, requests [][]string, permissionIds ...string) ([]bool, error)
- func CheckAccountItemModifyRule(accountItem *AccountItem, isAdmin bool, lang string) (bool, string)
- func CheckCasLogin(application *Application, lang string, service string) error
- func CheckFaceId(user *User, faceId []float64, lang string) error
- func CheckInvitationDefaultCode(code string, defaultCode string, lang string) error
- func CheckLdapExist(ldap *Ldap) (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) string
- func CheckPasswordComplexityByOrg(organization *Organization, password string) string
- func CheckPermissionForUpdateUser(oldUser, newUser *User, isAdmin bool, lang string) (bool, string)
- func CheckSigninCode(user *User, dest, code, lang string) error
- func CheckToEnableCaptcha(application *Application, organization, username string) (bool, error)
- func CheckUpdateUser(oldUser, user *User, lang string) string
- 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 ClearThroughputPerSecond()
- func ClearUserOAuthProperties(user *User, providerType string) (bool, error)
- func CopyRecord(record *casvisorsdk.Record) *casvisorsdk.Record
- func CreateTables()
- func DailSmtpServer(provider *Provider) error
- func DeleteAdapter(adapter *Adapter) (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 DeleteGroup(group *Group) (bool, error)
- func DeleteGroupForUser(user string, group string) (bool, error)
- func DeleteInvitation(invitation *Invitation) (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 DeleteProvider(provider *Provider) (bool, error)
- func DeleteRadiusAccounting(ra *RadiusAccounting) error
- func DeleteResource(resource *Resource) (bool, error)
- func DeleteRole(role *Role) (bool, error)
- func DeleteSession(id string) (bool, error)
- func DeleteSessionId(id string, sessionId string) (bool, error)
- func DeleteSyncer(syncer *Syncer) (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 ExpireTokenByAccessToken(accessToken string) (bool, *Application, *Token, 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
- 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 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 GetApplicationCount(owner, field, value string) (int64, error)
- func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string) (*Token, *TokenError, error)
- func GetBuiltInModel(modelText string) (model.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 GetEnforcerCount(owner, field, value string) (int64, error)
- func GetExistUuids(owner string, uuids []string) ([]string, error)
- func GetFailedSigninConfigByUser(user *User) (int, int, error)
- func GetFaviconUrl(htmlStr string) (string, error)
- func GetGlobalCertsCount(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 GetImplicitToken(application *Application, username string, scope string, nonce string, ...) (*Token, *TokenError, error)
- func GetInvitationCount(owner, field, value string) (int64, error)
- func GetJsonWebKeySet() (jose.JSONWebKeySet, 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 GetOrganizationApplicationCount(owner, organization, field, value string) (int64, error)
- func GetOrganizationCount(owner, field, value string) (int64, error)
- func GetPaginationRecords(offset, limit int, field, value, sortField, sortOrder string, ...) ([]*casvisorsdk.Record, 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) ([]*xormadapter.CasbinRule, error)
- func GetProviderCount(owner, field, value string) (int64, error)
- func GetRecordCount(field, value string, filterRecord *casvisorsdk.Record) (int64, error)
- func GetRecords() ([]*casvisorsdk.Record, error)
- func GetRecordsByField(record *casvisorsdk.Record) ([]*casvisorsdk.Record, error)
- func GetResourceCount(owner, user, field, value string) (int64, error)
- func GetRoleCount(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 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 GetSyncerCount(owner, organization, field, value string) (int64, error)
- func GetTokenCount(owner, organization, field, value string) (int64, 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 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 model.Model) bool
- func HasUserByField(organizationName string, field string, value string) bool
- func InitAdapter()
- func InitCasvisorConfig()
- func InitConfig()
- func InitDb()
- func InitDefaultStorageProvider()
- func InitFlag()
- func InitFromFile()
- func InitLdapAutoSynchronizer()
- func InitUserManager()
- func InterimUpdateRadiusAccounting(oldRa *RadiusAccounting, newRa *RadiusAccounting, stop bool) error
- func IsAllowSend(user *User, remoteAddr, recordType string) 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 IsSessionDuplicated(id string, sessionId string) (bool, error)
- func LinkUserAccount(user *User, field string, value string) (bool, error)
- func MfaRecover(user *User, recoveryCode string) error
- func NewRecord(ctx *context.Context) (*casvisorsdk.Record, 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 ParseSamlResponse(samlResponse string, provider *Provider, host string) (*idp.UserInfo, error)
- func RefreshToken(grantType string, refreshToken string, scope string, clientId string, ...) (interface{}, error)
- func RemovePolicy(id string, ptype string, policy []string) (bool, 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 SendVerificationCodeToEmail(organization *Organization, user *User, provider *Provider, remoteAddr string, ...) error
- func SendVerificationCodeToPhone(organization *Organization, user *User, provider *Provider, remoteAddr string, ...) error
- func SendWebhooks(record *casvisorsdk.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 StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
- func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
- func SyncLdapUsers(owner string, syncUsers []LdapUser, ldapId string) (existUsers []LdapUser, failedUsers []LdapUser, err error)
- func TestSyncerDb(syncer Syncer) error
- func UpdateAdapter(id string, adapter *Adapter) (bool, error)
- func UpdateApplication(id string, application *Application) (bool, error)
- func UpdateCert(id string, cert *Cert) (bool, error)
- func UpdateEnforcer(id string, enforcer *Enforcer) (bool, error)
- func UpdateGroup(id string, group *Group) (bool, error)
- func UpdateInvitation(id string, invitation *Invitation, lang string) (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) (bool, error)
- func UpdatePermission(id string, permission *Permission) (bool, error)
- func UpdatePolicy(id string, ptype string, oldPolicy []string, newPolicy []string) (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 UpdateSession(id string, session *Session) (bool, error)
- func UpdateSyncer(id string, syncer *Syncer) (bool, error)
- func UpdateToken(id string, token *Token) (bool, error)
- func UpdateUser(id string, user *User, columns []string, isAdmin bool) (bool, error)
- func UpdateUserBalance(owner string, name string, balance float64) error
- func UpdateUserForAllFields(id string, user *User) (bool, error)
- func UpdateUserToOriginalDatabase(user *User) error
- func UpdateWebhook(id string, webhook *Webhook) (bool, error)
- func UploadFileSafe(provider *Provider, fullFilePath string, fileBuffer *bytes.Buffer, lang string) (string, string, error)
- func UploadPermissions(owner string, path string) (bool, error)
- func UploadRoles(owner string, path string) (bool, error)
- func UploadUsers(owner string, path string) (bool, error)
- func VerifyCaptcha(id string, digits string) bool
- func VerifyInvitation(id string) (attachInfo map[string]interface{}, err error)
- type AccountItem
- type Adapter
- type Affiliation
- type Application
- func CheckOAuthLogin(clientId string, responseType string, redirectUri string, scope string, ...) (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 (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 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 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 Credential
- type Dashboard
- type Enforcer
- type FaceId
- type GaugeVecInfo
- type Group
- type GroupNode
- type Header
- type HistogramVecInfo
- 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) IsInvitationCodeValid(application *Application, invitationCode string, username string, email string, ...) (bool, string)
- func (invitation *Invitation) SimpleCheckInvitationCode(invitationCode string, lang string) (bool, string)
- type KeyDescriptor
- type KeyInfo
- type Ldap
- type LdapAutoSynchronizer
- type LdapConn
- type LdapUser
- type Link
- type ManagedAccount
- type MfaAccount
- type MfaInterface
- type MfaItem
- type MfaProps
- type Model
- type NameIDFormat
- type OIDCAddress
- type OidcDiscovery
- type Organization
- 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)
- type OriginalUser
- type Ormer
- 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 PrometheusInfo
- type Provider
- func GetCaptchaProviderByApplication(applicationId, isCurrentProvider, lang string) (*Provider, error)
- func GetCaptchaProviderByOwnerName(applicationId, lang string) (*Provider, error)
- func GetGlobalProviders() ([]*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 GetWechatMiniProgramProvider(application *Application) *Provider
- type ProviderItem
- type RadiusAccounting
- type Record
- 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 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 Saml11AssertionArtifact
- type Saml11Request
- type SamlItem
- type Session
- type SigninItem
- type SigninMethod
- type SignupItem
- type SingleSignOnService
- type SmsMfa
- 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 TableColumn
- type ThemeData
- 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)
- type TokenError
- type TokenWrapper
- type TotpMfa
- type User
- func CheckUserPassword(organization string, username string, password string, lang string, ...) (*User, error)
- func ExtendManagedAccountsWithUser(user *User) (*User, error)
- func GetGlobalUsers() ([]*User, error)
- func GetGlobalUsersWithFilter(cond builder.Cond) ([]*User, error)
- func GetGroupUsers(groupId string) ([]*User, error)
- 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 GetUserByFields(organization string, field string) (*User, error)
- func GetUserByInvitationCode(owner string, invitationCode 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 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 (user *User) AddCredentials(credential webauthn.Credential, isGlobalAdmin bool) (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) 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 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 Webhook
- type X509Certificate
- type X509Data
- type X509Key
Constants ¶
const ( DefaultFailedSigninLimit = 5 DefaultFailedSigninFrozenTime = 15 )
const ( EmailType = "email" SmsType = "sms" TotpType = "app" )
const ( MfaSessionUserId = "MfaSessionUserId" NextMfa = "NextMfa" RequiredMfa = "RequiredMfa" )
const ( ProviderTypeGoogleCloudStorage = "Google Cloud Storage" ProviderTypeTencentCloudCOS = "Tencent Cloud COS" ProviderTypeAzureBlob = "Azure Blob" ProviderTypeLocalFileSystem = "Local File System" )
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 (
MfaTotpPeriodInSeconds = 30
)
const UserEnforcerId = "built-in/user-enforcer-built-in"
const (
VerificationSuccess = iota
)
Variables ¶
var ( ApiThroughput = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "casdoor_api_throughput", Help: "The throughput of each api access", }, []string{"path", "method"}) ApiLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "casdoor_api_latency", Help: "API processing latency in milliseconds", }, []string{"path", "method"}) CpuUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "casdoor_cpu_usage", Help: "Casdoor cpu usage", }, []string{"cpuNum"}) MemoryUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "casdoor_memory_usage", Help: "Casdoor memory usage in Byte", }, []string{"type"}) TotalThroughput = promauto.NewGauge(prometheus.GaugeOpts{ Name: "casdoor_total_throughput", Help: "The total throughput of casdoor", }) )
var ( CasdoorApplication = "app-built-in" CasdoorOrganization = "built-in" )
Functions ¶
func AddAdapter ¶
func AddApplication ¶
func AddApplication(application *Application) (bool, error)
func AddEnforcer ¶
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 AddProvider ¶
func AddRadiusAccounting ¶
func AddRadiusAccounting(ra *RadiusAccounting) error
func AddRecord ¶
func AddRecord(record *casvisorsdk.Record) bool
func AddResource ¶
func AddRolesInBatch ¶
func AddSession ¶
func AddToVerificationRecord ¶
func AddUsersInBatch ¶
func AddWebhook ¶
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 CheckCasLogin ¶
func CheckCasLogin(application *Application, lang string, service string) error
func CheckLdapExist ¶
func CheckLoginPermission ¶
func CheckLoginPermission(userId string, application *Application) (bool, error)
func CheckPassword ¶
func CheckPasswordComplexity ¶
func CheckPasswordComplexityByOrg ¶
func CheckPasswordComplexityByOrg(organization *Organization, password string) string
func CheckSigninCode ¶
func CheckToEnableCaptcha ¶
func CheckToEnableCaptcha(application *Application, organization, username string) (bool, error)
func CheckUpdateUser ¶
func CheckUserPermission ¶
func CheckUserSignup ¶
func CheckUserSignup(application *Application, organization *Organization, authForm *form.AuthForm, lang string) string
func CheckUsername ¶
func ClearThroughputPerSecond ¶
func ClearThroughputPerSecond()
func CopyRecord ¶
func CopyRecord(record *casvisorsdk.Record) *casvisorsdk.Record
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 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 DeleteProvider ¶
func DeleteRadiusAccounting ¶
func DeleteRadiusAccounting(ra *RadiusAccounting) error
func DeleteResource ¶
func DeleteRole ¶
func DeleteSession ¶
func DeleteSyncer ¶
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 ExpireTokenByAccessToken ¶
func ExpireTokenByAccessToken(accessToken string) (bool, *Application, *Token, error)
func ExtendGroupWithUsers ¶
func ExtendGroupsWithUsers ¶
func FromProviderToIdpInfo ¶
func FromProviderToIdpInfo(ctx *context.Context, provider *Provider) *idp.ProviderInfo
func GenerateId ¶
func GenerateId()
func GenerateIdForNewUser ¶
func GenerateIdForNewUser(application *Application) (string, error)
func GenerateSamlRequest ¶
func GetAdapterCount ¶
func GetAllActions ¶
func GetAllObjects ¶
func GetAllRoles ¶
func GetApplicationCount ¶
func GetAuthorizationCodeToken ¶
func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string) (*Token, *TokenError, error)
GetAuthorizationCodeToken Authorization code flow
func GetCaptcha ¶
func GetCertCount ¶
func GetClientCredentialsToken ¶
func GetClientCredentialsToken(application *Application, clientSecret string, scope string, host string) (*Token, *TokenError, error)
GetClientCredentialsToken Client Credentials flow
func GetEnforcerCount ¶
func GetFaviconUrl ¶
func GetGlobalCertsCount ¶
func GetGlobalProviderCount ¶
func GetGlobalUserCount ¶
func GetGroupCount ¶
func GetGroupWithPrefix ¶
func GetGroupWithoutPrefix ¶
func GetImplicitToken ¶
func GetImplicitToken(application *Application, username string, scope string, nonce string, host string) (*Token, *TokenError, error)
GetImplicitToken Implicit flow
func GetInvitationCount ¶
func GetJsonWebKeySet ¶
func GetJsonWebKeySet() (jose.JSONWebKeySet, error)
func GetModelCount ¶
func GetOAuthToken ¶
func GetOrganizationCount ¶
func GetPaginationRecords ¶
func GetPaginationRecords(offset, limit int, field, value, sortField, sortOrder string, filterRecord *casvisorsdk.Record) ([]*casvisorsdk.Record, error)
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 GetPolicies ¶
func GetPolicies(id string) ([]*xormadapter.CasbinRule, error)
func GetProviderCount ¶
func GetRecordCount ¶
func GetRecordCount(field, value string, filterRecord *casvisorsdk.Record) (int64, error)
func GetRecords ¶
func GetRecords() ([]*casvisorsdk.Record, error)
func GetRecordsByField ¶
func GetRecordsByField(record *casvisorsdk.Record) ([]*casvisorsdk.Record, error)
func GetResourceCount ¶
func GetRoleCount ¶
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 GetSession ¶
func GetSessionCount ¶
func GetSessionForUser ¶
func GetSyncerCount ¶
func GetTokenCount ¶
func GetTruncatedPath ¶
func GetUploadFileUrl ¶
func GetUserField ¶
func GetUserFieldStringValue ¶
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 InitAdapter ¶
func InitAdapter()
func InitCasvisorConfig ¶
func InitCasvisorConfig()
func InitConfig ¶
func InitConfig()
func InitDefaultStorageProvider ¶
func InitDefaultStorageProvider()
func InitFromFile ¶
func InitFromFile()
func InitLdapAutoSynchronizer ¶
func InitLdapAutoSynchronizer()
func InitUserManager ¶
func InitUserManager()
func InterimUpdateRadiusAccounting ¶
func InterimUpdateRadiusAccounting(oldRa *RadiusAccounting, newRa *RadiusAccounting, stop bool) error
func IsAllowSend ¶
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 MfaRecover ¶
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 ParseSamlResponse ¶
func RefreshToken ¶
func RunSyncUsersJob ¶
func RunSyncUsersJob()
func SendNotification ¶
func SendWebhooks ¶
func SendWebhooks(record *casvisorsdk.Record) error
func SetUserOAuthProperties ¶
func StoreCasTokenForPgt ¶
func StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
func StoreCasTokenForProxyTicket ¶
func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
func SyncLdapUsers ¶
func TestSyncerDb ¶
func UpdateApplication ¶
func UpdateApplication(id string, application *Application) (bool, error)
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) (bool, error)
func UpdatePermission ¶
func UpdatePermission(id string, permission *Permission) (bool, error)
func UpdatePolicy ¶
func UpdateRadiusAccounting ¶
func UpdateRadiusAccounting(id string, ra *RadiusAccounting) error
func UpdateUser ¶
func UploadFileSafe ¶
func VerifyCaptcha ¶
func VerifyInvitation ¶
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"`
}
func GetAccountItemByName ¶
func GetAccountItemByName(name string, organization *Organization) *AccountItem
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"`
*xormadapter.Adapter `xorm:"-" json:"-"`
}
func GetAdapter ¶
func GetAdapters ¶
func GetPaginationAdapters ¶
func (*Adapter) InitAdapter ¶
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"`
Logo string `xorm:"varchar(200)" json:"logo"`
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"`
HeaderHtml string `xorm:"mediumtext" json:"headerHtml"`
EnablePassword bool `json:"enablePassword"`
EnableSignUp bool `json:"enableSignUp"`
EnableSigninSession bool `json:"enableSigninSession"`
EnableAutoSignin bool `json:"enableAutoSignin"`
EnableCodeSignin bool `json:"enableCodeSignin"`
EnableSamlCompress bool `json:"enableSamlCompress"`
EnableSamlC14n10 bool `json:"enableSamlC14n10"`
EnableSamlPostBinding bool `json:"enableSamlPostBinding"`
UseEmailAsSamlNameId bool `json:"useEmailAsSamlNameId"`
EnableWebAuthn bool `json:"enableWebAuthn"`
EnableLinkWithEmail bool `json:"enableLinkWithEmail"`
OrgChoiceMode string `json:"orgChoiceMode"`
SamlReplyUrl string `xorm:"varchar(100)" json:"samlReplyUrl"`
Providers []*ProviderItem `xorm:"mediumtext" json:"providers"`
SigninMethods []*SigninMethod `xorm:"varchar(2000)" json:"signinMethods"`
SignupItems []*SignupItem `xorm:"varchar(2000)" json:"signupItems"`
SigninItems []*SigninItem `xorm:"mediumtext" json:"signinItems"`
GrantTypes []string `xorm:"varchar(1000)" json:"grantTypes"`
OrganizationObj *Organization `xorm:"-" json:"organizationObj"`
CertPublicKey string `xorm:"-" json:"certPublicKey"`
Tags []string `xorm:"mediumtext" json:"tags"`
SamlAttributes []*SamlItem `xorm:"varchar(1000)" json:"samlAttributes"`
ClientId string `xorm:"varchar(100)" json:"clientId"`
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
RedirectUris []string `xorm:"varchar(1000)" json:"redirectUris"`
TokenFormat string `xorm:"varchar(100)" json:"tokenFormat"`
TokenSigningMethod string `xorm:"varchar(100)" json:"tokenSigningMethod"`
TokenFields []string `xorm:"varchar(1000)" json:"tokenFields"`
ExpireInHours int `json:"expireInHours"`
RefreshExpireInHours int `json:"refreshExpireInHours"`
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"`
TermsOfUse string `xorm:"varchar(100)" 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"`
FailedSigninLimit int `json:"failedSigninLimit"`
FailedSigninFrozenTime int `json:"failedSigninFrozenTime"`
}
func CheckOAuthLogin ¶
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 (*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 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"`
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"`
Certificate string `xorm:"mediumtext" json:"certificate"`
PrivateKey string `xorm:"mediumtext" json:"privateKey"`
}
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"`
jwt.RegisteredClaims
}
func ParseJwtTokenByApplication ¶
func ParseJwtTokenByApplication(token string, application *Application) (*Claims, error)
type ClaimsShort ¶
type ClaimsStandard ¶
type ClaimsStandard struct {
*UserShort
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"`
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"`
jwt.RegisteredClaims
}
type Code ¶
type Credential ¶
type Dashboard ¶
type Dashboard struct {
OrganizationCounts []int `json:"organizationCounts"`
UserCounts []int `json:"userCounts"`
ProviderCounts []int `json:"providerCounts"`
ApplicationCounts []int `json:"applicationCounts"`
}
func GetDashboard ¶
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"`
*casbin.Enforcer
}
func GetEnforcer ¶
func GetEnforcers ¶
func GetInitializedEnforcer ¶
func GetPaginationEnforcers ¶
func (*Enforcer) GetModelAndAdapter ¶
func (*Enforcer) InitEnforcer ¶
func (*Enforcer) LoadModelCfg ¶
type GaugeVecInfo ¶
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"`
IsTopGroup bool `xorm:"bool" json:"isTopGroup"`
Users []string `xorm:"-" json:"users"`
Title string `json:"title,omitempty"`
Key string `json:"key,omitempty"`
Children []*Group `json:"children,omitempty"`
IsEnabled bool `json:"isEnabled"`
}
func ConvertToTreeData ¶
func GetPaginationGroups ¶
type HistogramVecInfo ¶
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 []*casvisorsdk.Record `json:"records"`
Sessions []*Session `json:"sessions"`
}
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) 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 KeyDescriptor ¶
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"`
Username string `xorm:"varchar(100)" json:"username"`
Password string `xorm:"varchar(100)" json:"password"`
BaseDn string `xorm:"varchar(100)" json:"baseDn"`
Filter string `xorm:"varchar(200)" json:"filter"`
FilterFields []string `xorm:"varchar(100)" json:"filterFields"`
DefaultGroup string `xorm:"varchar(100)" json:"defaultGroup"`
AutoSync int `json:"autoSync"`
LastSync string `xorm:"varchar(100)" json:"lastSync"`
}
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 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
GroupId string `json:"groupId"`
Address string `json:"address"`
MemberOf string `json:"memberOf"`
}
func AutoAdjustLdapUser ¶
func (*LdapUser) GetLdapUuid ¶
type ManagedAccount ¶
type MfaAccount ¶
type MfaInterface ¶
type MfaInterface interface {
Initiate(userId 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"`
}
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"`
model.Model `xorm:"-" json:"-"`
}
func GetModelEx ¶
func GetPaginationModels ¶
type NameIDFormat ¶
type NameIDFormat struct {
// XMLName xml.Name
Value string `xml:",innerxml"`
}
type OIDCAddress ¶
type OidcDiscovery ¶
type OidcDiscovery struct {
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
UserinfoEndpoint string `json:"userinfo_endpoint"`
JwksUri string `json:"jwks_uri"`
IntrospectionEndpoint string `json:"introspection_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"`
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) OidcDiscovery
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(100)" json:"favicon"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
PasswordOptions []string `xorm:"varchar(100)" json:"passwordOptions"`
CountryCodes []string `xorm:"varchar(200)" json:"countryCodes"`
DefaultAvatar string `xorm:"varchar(200)" json:"defaultAvatar"`
DefaultApplication string `xorm:"varchar(100)" json:"defaultApplication"`
Tags []string `xorm:"mediumtext" json:"tags"`
Languages []string `xorm:"varchar(255)" json:"languages"`
ThemeData *ThemeData `xorm:"json" json:"themeData"`
MasterPassword string `xorm:"varchar(100)" json:"masterPassword"`
DefaultPassword string `xorm:"varchar(100)" json:"defaultPassword"`
MasterVerificationCode string `xorm:"varchar(100)" json:"masterVerificationCode"`
InitScore int `json:"initScore"`
EnableSoftDeletion bool `json:"enableSoftDeletion"`
IsProfilePublic bool `json:"isProfilePublic"`
UseEmailAsUsername bool `json:"useEmailAsUsername"`
EnableTour bool `json:"enableTour"`
MfaItems []*MfaItem `xorm:"varchar(300)" json:"mfaItems"`
AccountItems []*AccountItem `xorm:"varchar(5000)" json:"accountItems"`
}
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 (*Organization) GetInitScore ¶
func (org *Organization) GetInitScore() (int, error)
type OriginalUser ¶
type OriginalUser = User
type Ormer ¶
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 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 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"`
Host string `xorm:"varchar(100)" json:"host"`
Port int `json:"port"`
DisableSsl bool `json:"disableSsl"` // If the provider type is WeChat, DisableSsl means EnableQRCode, if type is Google, it means sync phone number
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"`
ProviderUrl string `xorm:"varchar(200)" json:"providerUrl"`
}
func GetGlobalProviders ¶
func GetMaskedProvider ¶
func GetMaskedProviders ¶
func GetPaginationProviders ¶
func GetProvider ¶
func GetProviders ¶
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"`
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 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 Record ¶
type Record struct {
casvisorsdk.Record
}
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 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 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 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"`
}
func GetPaginationSessions ¶
func GetSessions ¶
func GetSingleSession ¶
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"`
CustomCss string `json:"customCss"`
Label string `json:"label"`
Placeholder string `json:"placeholder"`
Regex string `json:"regex"`
Rule string `json:"rule"`
}
type SingleSignOnService ¶
type SmsMfa ¶
type SmsMfa struct {
*MfaProps
}
func NewEmailMfaUtil ¶
func NewSmsMfaUtil ¶
func (*SmsMfa) SetupVerify ¶
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:"-"`
}
func GetOrganizationSyncers ¶
func GetPaginationSyncers ¶
func GetSyncers ¶
type TableColumn ¶
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"`
CodeIsUsed bool `json:"codeIsUsed"`
CodeExpireIn int64 `json:"codeExpireIn"`
}
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
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(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"`
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:"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:"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"`
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"`
Balance float64 `json:"balance"`
Currency string `xorm:"varchar(100)" json:"currency"`
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"`
AccessKey string `xorm:"varchar(100)" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
AccessToken string `xorm:"mediumtext" json:"accessToken"`
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"`
Casdoor string `xorm:"casdoor varchar(100)" json:"casdoor"`
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"`
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"`
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"`
WebauthnCredentials []webauthn.Credential `xorm:"webauthnCredentials blob" json:"webauthnCredentials"`
PreferredMfaType string `xorm:"varchar(100)" json:"preferredMfaType"`
RecoveryCodes []string `xorm:"varchar(1000)" json:"recoveryCodes"`
TotpSecret string `xorm:"varchar(100)" json:"totpSecret"`
MfaPhoneEnabled bool `json:"mfaPhoneEnabled"`
MfaEmailEnabled bool `json:"mfaEmailEnabled"`
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"`
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"`
MfaAccounts []MfaAccount `xorm:"mfaAccounts blob" json:"mfaAccounts"`
NeedUpdatePassword bool `json:"needUpdatePassword"`
}
func CheckUserPassword ¶
func GetGlobalUsers ¶
func GetGroupUsers ¶
func GetMaskedUser ¶
func GetPaginationGroupUsers ¶
func GetPaginationUsers ¶
func GetUserByAccessKey ¶
func GetUserByEmailOnly ¶
func GetUserByField ¶
func GetUserByInvitationCode ¶
func GetUserByPhoneOnly ¶
func GetUserByUserIdOnly ¶
func GetUserNoCheck ¶
func GetUsersByTagWithFilter ¶
func (*User) AddCredentials ¶
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) 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 *casbin.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"`
Phone string `xorm:"varchar(100) index" json:"phone"`
}
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:"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"`
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"`
AccessKey string `xorm:"varchar(100)" json:"accessKey"`
AccessSecret string `xorm:"varchar(100)" json:"accessSecret"`
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:"varchar(1000)" 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"`
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
}
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 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:"varchar(1000)" json:"events"`
IsUserExtended bool `json:"isUserExtended"`
SingleOrgOnly bool `json:"singleOrgOnly"`
IsEnabled bool `json:"isEnabled"`
}
func GetPaginationWebhooks ¶
func GetWebhook ¶
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
- application.go
- application_item.go
- avatar.go
- captcha.go
- cert.go
- check.go
- check_password_complexity.go
- check_util.go
- email.go
- enforcer.go
- get-dashboard.go
- group.go
- init.go
- init_data.go
- init_data_dump.go
- invitation.go
- ldap.go
- ldap_autosync.go
- ldap_conn.go
- mfa.go
- mfa_sms.go
- mfa_totp.go
- model.go
- notification.go
- oidc_discovery.go
- organization.go
- ormer.go
- ormer_session.go
- permission.go
- permission_enforcer.go
- permission_upload.go
- prometheus.go
- provider.go
- provider_item.go
- radius.go
- record.go
- record_casvisor.go
- resource.go
- resource_direct.go
- role.go
- role_upload.go
- saml_idp.go
- saml_sp.go
- session.go
- sms.go
- sms_custom_http.go
- storage.go
- syncer.go
- syncer_affiliation.go
- syncer_cron.go
- syncer_public_api.go
- syncer_sync.go
- syncer_user.go
- syncer_util.go
- token.go
- token_cas.go
- token_jwt.go
- token_jwt_key.go
- token_oauth.go
- token_standard_jwt.go
- user.go
- user_avatar.go
- user_avatar_favicon.go
- user_avatar_gravatar.go
- user_avatar_identicon.go
- user_cred.go
- user_enforcer.go
- user_upload.go
- user_util.go
- user_webauthn.go
- verification.go
- viaSSHDialer.go
- webhook.go
- webhook_util.go