Documentation ¶
Index ¶
- Constants
- func AddApplication(application *Application) bool
- func AddCasbinAdapter(casbinAdapter *CasbinAdapter) bool
- func AddCert(cert *Cert) bool
- func AddLdap(ldap *Ldap) bool
- func AddModel(model *Model) bool
- func AddOrUpdateResource(resource *Resource) bool
- func AddOrganization(organization *Organization) bool
- func AddPayment(payment *Payment) bool
- func AddPermission(permission *Permission) bool
- func AddPolicy(policy []string, casbinAdapter *CasbinAdapter) (bool, error)
- func AddProduct(product *Product) bool
- func AddProvider(provider *Provider) bool
- func AddRecord(record *Record) bool
- func AddResource(resource *Resource) bool
- func AddRole(role *Role) bool
- func AddSyncer(syncer *Syncer) bool
- func AddToVerificationRecord(user *User, provider *Provider, remoteAddr, recordType, dest, code string) error
- func AddToken(token *Token) bool
- func AddUser(user *User) bool
- func AddUserToOriginalDatabase(user *User)
- func AddUsers(users []*User) bool
- func AddUsersInBatch(users []*User) bool
- func AddWebhook(webhook *Webhook) bool
- func BatchEnforce(permissionRules []PermissionRule) []bool
- func BuyProduct(id string, providerName string, user *User, host string) (string, error)
- func CheckAccessPermission(userId string, application *Application) (bool, error)
- func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string)
- func CheckLdapExist(ldap *Ldap) bool
- func CheckLdapUuidExist(owner string, uuids []string) []string
- func CheckPassword(user *User, password string, lang string) string
- func CheckRedirectUriValid(application *Application, redirectUri string) bool
- func CheckToEnableCaptcha(application *Application) bool
- func CheckUserPermission(requestUserId, userId, userOwner string, strict bool, lang string) (bool, error)
- func CheckUserSignup(application *Application, organization *Organization, username string, ...) string
- func CheckUsername(username string, lang string) string
- func CheckVerificationCode(dest, code, lang string) string
- func ClearUserOAuthProperties(user *User, providerType string) bool
- func ContainsAsterisk(userId string, users []string) bool
- func DailSmtpServer(provider *Provider) error
- func DeleteApplication(application *Application) bool
- func DeleteCasbinAdapter(casbinAdapter *CasbinAdapter) bool
- func DeleteCert(cert *Cert) bool
- func DeleteFile(provider *Provider, objectKey string, lang string) error
- func DeleteLdap(ldap *Ldap) bool
- func DeleteModel(model *Model) bool
- func DeleteOrganization(organization *Organization) bool
- func DeletePayment(payment *Payment) bool
- func DeletePermission(permission *Permission) bool
- func DeleteProduct(product *Product) bool
- func DeleteProvider(provider *Provider) bool
- func DeleteResource(resource *Resource) bool
- func DeleteRole(role *Role) bool
- func DeleteSyncer(syncer *Syncer) bool
- func DeleteToken(token *Token) bool
- func DeleteUser(user *User) bool
- func DeleteWebhook(webhook *Webhook) bool
- func DisableVerificationCode(dest string)
- func DownloadAndUpload(url string, fullFilePath string)
- func Enforce(permissionRule *PermissionRule) bool
- func ExtendProductWithProviders(product *Product)
- func ExtendUserWithRolesAndPermissions(user *User)
- func GenerateCasToken(userId string, service string) (string, error)
- func GenerateId()
- func GenerateSamlLoginUrl(id, relayState, lang string) (string, string, error)
- func GetAllActions(userId string) []string
- func GetAllObjects(userId string) []string
- func GetAllRoles(userId string) []string
- func GetApplicationByUserId(userId string) (*Application, *User)
- func GetApplicationCount(owner, field, value string) int
- func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string) (*Token, *TokenError)
- func GetCaptcha() (string, []byte)
- func GetCasbinAdapterCount(owner, field, value string) int
- func GetCertCount(owner, field, value string) int
- func GetClientCredentialsToken(application *Application, clientSecret string, scope string, host string) (*Token, *TokenError)
- func GetGlobalProviderCount(field, value string) int
- func GetGlobalUserCount(field, value string) int
- func GetJsonWebKeySet() (jose.JSONWebKeySet, error)
- func GetLdapConn(host string, port int, adminUser string, adminPasswd string) (*ldapConn, error)
- func GetModelCount(owner, field, value string) int
- func GetNameAndOrgFromDN(DN string) (string, string, string)
- func GetOAuthToken(grantType string, clientId string, clientSecret string, code string, ...) interface{}
- func GetOnlineUserCount(owner string, isOnline int) int
- func GetOrganizationApplicationCount(owner, Organization, field, value string) int
- func GetOrganizationCount(owner, field, value string) int
- func GetPasswordToken(application *Application, username string, password string, scope string, ...) (*Token, *TokenError)
- func GetPaymentCount(owner, field, value string) int
- func GetPermissionCount(owner, field, value string) int
- func GetProductCount(owner, field, value string) int
- func GetProviderCount(owner, field, value string) int
- func GetRecordCount(field, value string, filterRecord *Record) int
- func GetResourceCount(owner, user, field, value string) int
- func GetRoleCount(owner, field, value string) int
- func GetSamlResponse(application *Application, user *User, samlRequest string, host string) (string, string, error)
- func GetSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session
- func GetSyncerCount(owner, field, value string) int
- func GetTokenCount(owner, field, value string) int
- func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool) (string, string)
- func GetUserCount(owner, field, value string) int
- func GetUserField(user *User, field string) string
- func GetUserNameAndOrgFromBaseDnAndFilter(baseDN, filter string) (string, string, int)
- func GetValidationBySaml(samlRequest string, host string) (string, string, error)
- func GetWebAuthnObject(host string) *webauthn.WebAuthn
- func GetWebhookCount(owner, field, value string) int
- func GetWechatMiniProgramToken(application *Application, code string, host string, username string, ...) (*Token, *TokenError)
- func HasUserByField(organizationName string, field string, value string) bool
- func InitAdapter(createDatabase bool)
- func InitConfig()
- func InitDb()
- func InitDefaultStorageProvider()
- func InitFromFile()
- func InitLdapAutoSynchronizer()
- func InvoicePayment(payment *Payment) (string, error)
- func IsAllowOrigin(origin string) bool
- func IsAllowSend(user *User, remoteAddr, recordType string) error
- func IsGrantTypeValid(method string, grantTypes []string) bool
- func LinkUserAccount(user *User, field string, value string) bool
- func MigratePermissionRule()
- func NewSamlResponse(user *User, host string, certificate string, destination string, iss string, ...) (*etree.Element, error)
- func NewSamlResponse11(user *User, requestID string, host string) *etree.Element
- func NotifyPayment(request *http.Request, body []byte, owner string, providerName string, ...) bool
- func ParseSamlResponse(samlResponse string, providerType string) (string, error)
- func RefreshToken(grantType string, refreshToken string, scope string, clientId string, ...) interface{}
- func RemovePolicy(policy []string, casbinAdapter *CasbinAdapter) (bool, error)
- func RunSyncUsersJob()
- func RunSyncer(syncer *Syncer)
- func SendEmail(provider *Provider, title string, content string, dest string, sender 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 *Record) error
- func SetUserField(user *User, field string, value string) bool
- func SetUserOAuthProperties(organization *Organization, user *User, providerType string, ...) bool
- func StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
- func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
- func SyncLdapUsers(owner string, users []LdapRespUser, ldapId string) (*[]LdapRespUser, *[]LdapRespUser)
- func SyncPolicies(casbinAdapter *CasbinAdapter) ([]*xormadapter.CasbinRule, error)
- func UpdateApplication(id string, application *Application) bool
- func UpdateCasbinAdapter(id string, casbinAdapter *CasbinAdapter) bool
- func UpdateCert(id string, cert *Cert) bool
- func UpdateLdap(ldap *Ldap) bool
- func UpdateLdapSyncTime(ldapId string)
- func UpdateModel(id string, modelObj *Model) bool
- func UpdateOrganization(id string, organization *Organization) bool
- func UpdatePayment(id string, payment *Payment) bool
- func UpdatePermission(id string, permission *Permission) bool
- func UpdatePolicy(oldPolicy, newPolicy []string, casbinAdapter *CasbinAdapter) (bool, error)
- func UpdateProduct(id string, product *Product) bool
- func UpdateProvider(id string, provider *Provider) bool
- func UpdateResource(id string, resource *Resource) bool
- func UpdateRole(id string, role *Role) bool
- func UpdateSyncer(id string, syncer *Syncer) bool
- func UpdateToken(id string, token *Token) bool
- func UpdateUser(id string, user *User, columns []string, isGlobalAdmin bool) bool
- func UpdateUserForAllFields(id string, user *User) bool
- func UpdateUserToOriginalDatabase(user *User)
- func UpdateWebhook(id string, webhook *Webhook) bool
- func UploadFileSafe(provider *Provider, fullFilePath string, fileBuffer *bytes.Buffer) (string, string, error)
- func UploadUsers(owner string, fileId string) bool
- func VerifyCaptcha(id string, digits string) bool
- type AccountItem
- type Adapter
- type Affiliation
- type Application
- func CheckOAuthLogin(clientId string, responseType string, redirectUri string, scope string, ...) (string, *Application)
- func DeleteTokenByAccessToken(accessToken string) (bool, *Application)
- func GetApplication(id string) *Application
- func GetApplicationByClientId(clientId string) *Application
- func GetApplicationByOrganizationName(organization string) *Application
- func GetApplicationByUser(user *User) *Application
- func GetApplications(owner string) []*Application
- 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
- func GetPaginationApplications(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Application
- func GetPaginationOrganizationApplications(owner, organization string, offset, limit int, ...) []*Application
- func (application *Application) GetEmailProvider() *Provider
- func (application *Application) GetId() string
- func (application *Application) GetProviderByCategory(category string) *Provider
- 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() *Provider
- func (application *Application) GetStorageProvider() *Provider
- func (application *Application) HasPromptPage() 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 CasbinAdapter
- type Cert
- type Claims
- type ClaimsShort
- type Code
- type Credential
- type Header
- type IdpEntityDescriptor
- type IdpSSODescriptor
- type InitData
- type IntrospectionResponse
- type KeyDescriptor
- type KeyInfo
- type Ldap
- type LdapAutoSynchronizer
- type LdapRespUser
- type ManagedAccount
- type Model
- type NameIDFormat
- type OidcDiscovery
- type Organization
- func GetMaskedOrganization(organization *Organization) *Organization
- func GetMaskedOrganizations(organizations []*Organization) []*Organization
- func GetOrganization(id string) *Organization
- func GetOrganizationByUser(user *User) *Organization
- func GetOrganizations(owner string) []*Organization
- func GetPaginationOrganizations(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Organization
- type OriginalUser
- type Payment
- type Permission
- func GetPaginationPermissions(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Permission
- func GetPermission(id string) *Permission
- func GetPermissions(owner string) []*Permission
- func GetPermissionsByRole(roleId string) []*Permission
- func GetPermissionsBySubmitter(owner string, submitter string) []*Permission
- func GetPermissionsByUser(userId string) []*Permission
- type PermissionRule
- type Product
- type Provider
- func GetCaptchaProviderByApplication(applicationId, isCurrentProvider, lang string) (*Provider, error)
- func GetCaptchaProviderByOwnerName(applicationId, lang string) (*Provider, error)
- func GetDefaultCaptchaProvider() *Provider
- func GetGlobalProviders() []*Provider
- func GetMaskedProvider(provider *Provider) *Provider
- func GetMaskedProviders(providers []*Provider) []*Provider
- func GetPaginationGlobalProviders(offset, limit int, field, value, sortField, sortOrder string) []*Provider
- func GetPaginationProviders(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Provider
- func GetProvider(id string) *Provider
- func GetProviders(owner string) []*Provider
- func GetWechatMiniProgramProvider(application *Application) *Provider
- type ProviderItem
- type Record
- type Resource
- type Role
- type Saml11AssertionArtifact
- type Saml11Request
- type SignupItem
- type SingleSignOnService
- type Syncer
- type TableColumn
- type Token
- func GetPaginationTokens(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Token
- func GetToken(id string) *Token
- func GetTokenByAccessToken(accessToken string) *Token
- func GetTokenByTokenAndApplication(token string, application string) *Token
- func GetTokenByUser(application *Application, user *User, scope string, host string) (*Token, error)
- func GetTokens(owner string) []*Token
- type TokenError
- type TokenWrapper
- type User
- func CheckUserPassword(organization string, username string, password string, lang string) (*User, string)
- func ExtendManagedAccountsWithUser(user *User) *User
- func GetFilteredUsers(m *ldapserver.Message, name, org string) ([]*User, int)
- func GetGlobalUsers() []*User
- func GetLastUser(owner string) *User
- func GetMaskedUser(user *User) *User
- func GetMaskedUsers(users []*User) []*User
- func GetPaginationGlobalUsers(offset, limit int, field, value, sortField, sortOrder string) []*User
- func GetPaginationUsers(owner string, offset, limit int, field, value, sortField, sortOrder string) []*User
- func GetSortedUsers(owner string, sorter string, limit int) []*User
- func GetUser(id string) *User
- func GetUserByEmail(owner string, email string) *User
- func GetUserByField(organizationName string, field string, value string) *User
- func GetUserByFields(organization string, field string) *User
- func GetUserByPhone(owner string, phone string) *User
- func GetUserByUserId(owner string, userId string) *User
- func GetUserNoCheck(id string) *User
- func GetUsers(owner string) []*User
- func (user *User) AddCredentials(credential webauthn.Credential, isGlobalAdmin bool) bool
- func (user *User) CredentialExcludeList() []protocol.CredentialDescriptor
- func (user *User) DeleteCredentials(credentialIdBase64 string) bool
- func (user *User) GetId() string
- func (user *User) UpdateUserHash()
- 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 UserShort
- type Userinfo
- type VerificationRecord
- type Webhook
- type X509Certificate
- type X509Data
- type X509Key
Constants ¶
const ( SigninWrongTimesLimit = 5 LastSignWrongTimeDuration = time.Minute * 15 )
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" )
Variables ¶
This section is empty.
Functions ¶
func AddApplication ¶
func AddApplication(application *Application) bool
func AddCasbinAdapter ¶ added in v1.117.0
func AddCasbinAdapter(casbinAdapter *CasbinAdapter) bool
func AddOrUpdateResource ¶
func AddOrganization ¶
func AddOrganization(organization *Organization) bool
func AddPayment ¶ added in v1.16.0
func AddPermission ¶
func AddPermission(permission *Permission) bool
func AddPolicy ¶ added in v1.166.0
func AddPolicy(policy []string, casbinAdapter *CasbinAdapter) (bool, error)
func AddProduct ¶ added in v1.23.0
func AddProvider ¶
func AddResource ¶
func AddToVerificationRecord ¶
func AddUserToOriginalDatabase ¶
func AddUserToOriginalDatabase(user *User)
func AddUsersInBatch ¶
func AddWebhook ¶
func BatchEnforce ¶ added in v1.83.0
func BatchEnforce(permissionRules []PermissionRule) []bool
func BuyProduct ¶ added in v1.27.6
func CheckAccessPermission ¶ added in v1.70.0
func CheckAccessPermission(userId string, application *Application) (bool, error)
func CheckAccountItemModifyRule ¶ added in v1.77.1
func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string)
func CheckLdapExist ¶
func CheckLdapUuidExist ¶
func CheckRedirectUriValid ¶ added in v1.25.0
func CheckRedirectUriValid(application *Application, redirectUri string) bool
func CheckToEnableCaptcha ¶ added in v1.145.0
func CheckToEnableCaptcha(application *Application) bool
func CheckUserPermission ¶ added in v1.42.0
func CheckUserSignup ¶
func CheckUsername ¶ added in v1.130.2
func CheckVerificationCode ¶
func ContainsAsterisk ¶ added in v1.106.0
func DailSmtpServer ¶ added in v1.59.0
DailSmtpServer Dail Smtp server
func DeleteApplication ¶
func DeleteApplication(application *Application) bool
func DeleteCasbinAdapter ¶ added in v1.117.0
func DeleteCasbinAdapter(casbinAdapter *CasbinAdapter) bool
func DeleteCert ¶
func DeleteLdap ¶
func DeleteModel ¶ added in v1.54.0
func DeleteOrganization ¶
func DeleteOrganization(organization *Organization) bool
func DeletePayment ¶ added in v1.16.0
func DeletePermission ¶
func DeletePermission(permission *Permission) bool
func DeleteProduct ¶ added in v1.23.0
func DeleteProvider ¶
func DeleteResource ¶
func DeleteRole ¶
func DeleteSyncer ¶
func DeleteToken ¶
func DeleteUser ¶
func DeleteWebhook ¶
func DisableVerificationCode ¶
func DisableVerificationCode(dest string)
func DownloadAndUpload ¶ added in v1.136.0
func Enforce ¶ added in v1.83.0
func Enforce(permissionRule *PermissionRule) bool
func ExtendProductWithProviders ¶ added in v1.82.1
func ExtendProductWithProviders(product *Product)
func ExtendUserWithRolesAndPermissions ¶ added in v1.102.0
func ExtendUserWithRolesAndPermissions(user *User)
func GenerateCasToken ¶ added in v1.36.0
func GenerateId ¶ added in v1.36.0
func GenerateId()
func GenerateSamlLoginUrl ¶
func GetAllActions ¶ added in v1.83.0
func GetAllObjects ¶ added in v1.83.0
func GetAllRoles ¶ added in v1.83.0
func GetApplicationByUserId ¶
func GetApplicationByUserId(userId string) (*Application, *User)
func GetApplicationCount ¶
func GetAuthorizationCodeToken ¶ added in v1.22.0
func GetAuthorizationCodeToken(application *Application, clientSecret string, code string, verifier string) (*Token, *TokenError)
GetAuthorizationCodeToken Authorization code flow
func GetCaptcha ¶
func GetCasbinAdapterCount ¶ added in v1.117.0
func GetCertCount ¶
func GetClientCredentialsToken ¶ added in v1.22.0
func GetClientCredentialsToken(application *Application, clientSecret string, scope string, host string) (*Token, *TokenError)
GetClientCredentialsToken Client Credentials flow
func GetGlobalProviderCount ¶ added in v1.151.0
func GetGlobalUserCount ¶
func GetJsonWebKeySet ¶
func GetJsonWebKeySet() (jose.JSONWebKeySet, error)
func GetLdapConn ¶
func GetModelCount ¶ added in v1.54.0
func GetNameAndOrgFromDN ¶ added in v1.120.0
func GetOAuthToken ¶
func GetOnlineUserCount ¶
func GetOrganizationApplicationCount ¶ added in v1.161.0
func GetOrganizationCount ¶
func GetPasswordToken ¶ added in v1.22.0
func GetPasswordToken(application *Application, username string, password string, scope string, host string) (*Token, *TokenError)
GetPasswordToken Resource Owner Password Credentials flow
func GetPaymentCount ¶ added in v1.16.0
func GetPermissionCount ¶
func GetProductCount ¶ added in v1.23.0
func GetProviderCount ¶
func GetRecordCount ¶
func GetResourceCount ¶
func GetRoleCount ¶
func GetSamlResponse ¶ added in v1.38.0
func GetSamlResponse(application *Application, user *User, samlRequest string, host string) (string, string, error)
GetSamlResponse generates a SAML2.0 response parameter samlRequest is saml request in base64 format
func GetSession ¶
func GetSyncerCount ¶
func GetTokenCount ¶
func GetUploadFileUrl ¶ added in v1.168.0
func GetUserCount ¶
func GetUserField ¶
func GetUserNameAndOrgFromBaseDnAndFilter ¶ added in v1.120.0
func GetValidationBySaml ¶ added in v1.39.0
GetValidationBySaml * @ret1: saml response @ret2: the service URL who requested to issue this token @ret3: error
func GetWebAuthnObject ¶ added in v1.68.0
func GetWebhookCount ¶
func GetWechatMiniProgramToken ¶ added in v1.41.0
func GetWechatMiniProgramToken(application *Application, code string, host string, username string, avatar string, lang string) (*Token, *TokenError)
GetWechatMiniProgramToken Wechat Mini Program flow
func InitAdapter ¶
func InitAdapter(createDatabase bool)
func InitConfig ¶
func InitConfig()
func InitDefaultStorageProvider ¶
func InitDefaultStorageProvider()
func InitFromFile ¶ added in v1.63.0
func InitFromFile()
func InitLdapAutoSynchronizer ¶
func InitLdapAutoSynchronizer()
func InvoicePayment ¶ added in v1.44.9
func IsAllowOrigin ¶ added in v1.60.0
func IsAllowSend ¶ added in v1.157.0
func IsGrantTypeValid ¶ added in v1.24.0
IsGrantTypeValid Check if grantType is allowed in the current application authorization_code is allowed by default
func MigratePermissionRule ¶ added in v1.108.0
func MigratePermissionRule()
func NewSamlResponse ¶ added in v1.38.0
func NewSamlResponse(user *User, host string, certificate string, destination string, iss string, requestId string, redirectUri []string) (*etree.Element, error)
NewSamlResponse returns a saml2 response
func NewSamlResponse11 ¶ added in v1.39.0
NewSamlResponse11 return a saml1.1 response(not 2.0)
func NotifyPayment ¶ added in v1.27.6
func ParseSamlResponse ¶
func RefreshToken ¶
func RemovePolicy ¶ added in v1.166.0
func RemovePolicy(policy []string, casbinAdapter *CasbinAdapter) (bool, error)
func RunSyncUsersJob ¶
func RunSyncUsersJob()
func SendWebhooks ¶
func SetUserOAuthProperties ¶
func StoreCasTokenForPgt ¶ added in v1.36.0
func StoreCasTokenForPgt(token *CasAuthenticationSuccess, service, userId string) string
func StoreCasTokenForProxyTicket ¶ added in v1.36.0
func StoreCasTokenForProxyTicket(token *CasAuthenticationSuccess, targetService, userId string) string
func SyncLdapUsers ¶
func SyncLdapUsers(owner string, users []LdapRespUser, ldapId string) (*[]LdapRespUser, *[]LdapRespUser)
func SyncPolicies ¶ added in v1.117.0
func SyncPolicies(casbinAdapter *CasbinAdapter) ([]*xormadapter.CasbinRule, error)
func UpdateApplication ¶
func UpdateApplication(id string, application *Application) bool
func UpdateCasbinAdapter ¶ added in v1.117.0
func UpdateCasbinAdapter(id string, casbinAdapter *CasbinAdapter) bool
func UpdateCert ¶
func UpdateLdap ¶
func UpdateLdapSyncTime ¶
func UpdateLdapSyncTime(ldapId string)
func UpdateModel ¶ added in v1.54.0
func UpdateOrganization ¶
func UpdateOrganization(id string, organization *Organization) bool
func UpdatePayment ¶ added in v1.16.0
func UpdatePermission ¶
func UpdatePermission(id string, permission *Permission) bool
func UpdatePolicy ¶ added in v1.166.0
func UpdatePolicy(oldPolicy, newPolicy []string, casbinAdapter *CasbinAdapter) (bool, error)
func UpdateProduct ¶ added in v1.23.0
func UpdateProvider ¶
func UpdateResource ¶
func UpdateRole ¶
func UpdateSyncer ¶
func UpdateToken ¶
func UpdateUserForAllFields ¶
func UpdateUserToOriginalDatabase ¶
func UpdateUserToOriginalDatabase(user *User)
func UpdateWebhook ¶
func UploadFileSafe ¶
func UploadUsers ¶
func VerifyCaptcha ¶
Types ¶
type AccountItem ¶ added in v1.57.0
type AccountItem struct { Name string `json:"name"` Visible bool `json:"visible"` ViewRule string `json:"viewRule"` ModifyRule string `json:"modifyRule"` }
func GetAccountItemByName ¶ added in v1.77.1
func GetAccountItemByName(name string, organization *Organization) *AccountItem
type Adapter ¶
Adapter represents the MySQL adapter for policy storage.
func NewAdapter ¶
NewAdapter is the constructor for Adapter.
func (*Adapter) CreateDatabase ¶
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(100)" 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"` EnablePassword bool `json:"enablePassword"` EnableSignUp bool `json:"enableSignUp"` EnableSigninSession bool `json:"enableSigninSession"` EnableAutoSignin bool `json:"enableAutoSignin"` EnableCodeSignin bool `json:"enableCodeSignin"` EnableSamlCompress bool `json:"enableSamlCompress"` EnableWebAuthn bool `json:"enableWebAuthn"` Providers []*ProviderItem `xorm:"mediumtext" json:"providers"` SignupItems []*SignupItem `xorm:"varchar(1000)" json:"signupItems"` GrantTypes []string `xorm:"varchar(1000)" json:"grantTypes"` OrganizationObj *Organization `xorm:"-" json:"organizationObj"` 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"` 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"` FormCss string `xorm:"text" json:"formCss"` FormOffset int `json:"formOffset"` FormSideHtml string `xorm:"mediumtext" json:"formSideHtml"` FormBackgroundUrl string `xorm:"varchar(200)" json:"formBackgroundUrl"` }
func CheckOAuthLogin ¶
func DeleteTokenByAccessToken ¶ added in v1.85.0
func DeleteTokenByAccessToken(accessToken string) (bool, *Application)
func GetApplication ¶
func GetApplication(id string) *Application
func GetApplicationByClientId ¶
func GetApplicationByClientId(clientId string) *Application
func GetApplicationByOrganizationName ¶
func GetApplicationByOrganizationName(organization string) *Application
func GetApplicationByUser ¶
func GetApplicationByUser(user *User) *Application
func GetApplications ¶
func GetApplications(owner string) []*Application
func GetDefaultApplication ¶ added in v1.114.0
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 ¶ added in v1.161.0
func GetOrganizationApplications(owner string, organization string) []*Application
func GetPaginationApplications ¶
func GetPaginationApplications(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Application
func GetPaginationOrganizationApplications ¶ added in v1.161.0
func GetPaginationOrganizationApplications(owner, organization string, offset, limit int, field, value, sortField, sortOrder string) []*Application
func (*Application) GetEmailProvider ¶
func (application *Application) GetEmailProvider() *Provider
func (*Application) GetId ¶
func (application *Application) GetId() string
func (*Application) GetProviderByCategory ¶
func (application *Application) GetProviderByCategory(category string) *Provider
func (*Application) GetProviderItem ¶
func (application *Application) GetProviderItem(providerName string) *ProviderItem
func (*Application) GetProviderItemByType ¶ added in v1.77.3
func (application *Application) GetProviderItemByType(providerType string) *ProviderItem
func (*Application) GetSignupItemRule ¶
func (application *Application) GetSignupItemRule(itemName string) string
func (*Application) GetSmsProvider ¶
func (application *Application) GetSmsProvider() *Provider
func (*Application) GetStorageProvider ¶
func (application *Application) GetStorageProvider() *Provider
func (*Application) HasPromptPage ¶
func (application *Application) HasPromptPage() bool
func (*Application) IsSignupItemRequired ¶
func (application *Application) IsSignupItemRequired(itemName string) bool
func (*Application) IsSignupItemVisible ¶
func (application *Application) IsSignupItemVisible(itemName string) bool
type CasAnyAttribute ¶ added in v1.36.0
type CasAttributes ¶ added in v1.36.0
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 ¶ added in v1.36.0
func (c *CasAttributes) DeepCopy() CasAttributes
type CasAuthenticationFailure ¶ added in v1.36.0
type CasAuthenticationSuccess ¶ added in v1.36.0
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 ¶ added in v1.36.0
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 ¶ added in v1.36.0
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 ¶ added in v1.36.0
func (c *CasAuthenticationSuccess) DeepCopy() CasAuthenticationSuccess
type CasAuthenticationSuccessWrapper ¶ added in v1.36.0
type CasAuthenticationSuccessWrapper struct { AuthenticationSuccess *CasAuthenticationSuccess // the token we issued Service string // to which service this token is issued UserId string }
type CasNamedAttribute ¶ added in v1.36.0
type CasProxies ¶ added in v1.36.0
type CasProxies struct { XMLName xml.Name `xml:"cas:proxies" json:"-"` Proxies []string `xml:"cas:proxy"` }
func (*CasProxies) DeepCopy ¶ added in v1.36.0
func (c *CasProxies) DeepCopy() CasProxies
type CasProxyFailure ¶ added in v1.36.0
type CasProxySuccess ¶ added in v1.36.0
type CasServiceResponse ¶ added in v1.36.0
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 ¶ added in v1.36.0
type CasUserAttributes struct { XMLName xml.Name `xml:"cas:userAttributes" json:"-"` Attributes []*CasNamedAttribute `xml:"cas:attribute"` AnyAttributes []*CasAnyAttribute `xml:",any"` }
func (*CasUserAttributes) DeepCopy ¶ added in v1.36.0
func (c *CasUserAttributes) DeepCopy() CasUserAttributes
type CasbinAdapter ¶ added in v1.117.0
type CasbinAdapter 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"` Model string `xorm:"varchar(100)" json:"model"` Host string `xorm:"varchar(100)" json:"host"` Port int `json:"port"` User string `xorm:"varchar(100)" json:"user"` Password string `xorm:"varchar(100)" json:"password"` DatabaseType string `xorm:"varchar(100)" json:"databaseType"` Database string `xorm:"varchar(100)" json:"database"` Table string `xorm:"varchar(100)" json:"table"` IsEnabled bool `json:"isEnabled"` Adapter *xormadapter.Adapter `xorm:"-" json:"-"` }
func GetCasbinAdapter ¶ added in v1.117.0
func GetCasbinAdapter(id string) *CasbinAdapter
func GetCasbinAdapters ¶ added in v1.117.0
func GetCasbinAdapters(owner string) []*CasbinAdapter
func GetPaginationCasbinAdapters ¶ added in v1.117.0
func GetPaginationCasbinAdapters(owner string, page, limit int, field, value, sort, order string) []*CasbinAdapter
func (*CasbinAdapter) GetId ¶ added in v1.117.0
func (casbinAdapter *CasbinAdapter) GetId() string
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"` AuthorityPublicKey string `xorm:"mediumtext" json:"authorityPublicKey"` AuthorityRootPublicKey string `xorm:"mediumtext" json:"authorityRootPublicKey"` }
func GetDefaultCert ¶
func GetDefaultCert() *Cert
func GetMaskedCert ¶
func GetMaskedCerts ¶
func GetPaginationCerts ¶
type Claims ¶
type Claims struct { *User TokenType string `json:"tokenType,omitempty"` Nonce string `json:"nonce,omitempty"` Tag string `json:"tag,omitempty"` Scope string `json:"scope,omitempty"` jwt.RegisteredClaims }
func ParseJwtTokenByApplication ¶ added in v1.26.0
func ParseJwtTokenByApplication(token string, application *Application) (*Claims, error)
type ClaimsShort ¶
type Code ¶
type Credential ¶ added in v1.37.0
type IdpEntityDescriptor ¶ added in v1.38.0
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 ¶ added in v1.38.0
func GetSamlMeta(application *Application, host string) (*IdpEntityDescriptor, error)
type IdpSSODescriptor ¶ added in v1.38.0
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 ¶ added in v1.63.0
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"` }
type IntrospectionResponse ¶ added in v1.26.0
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 KeyDescriptor ¶ added in v1.38.0
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 `json:"port"` Admin string `xorm:"varchar(100)" json:"admin"` Passwd string `xorm:"varchar(100)" json:"passwd"` BaseDn string `xorm:"varchar(100)" json:"baseDn"` AutoSync int `json:"autoSync"` LastSync string `xorm:"varchar(100)" json:"lastSync"` }
type LdapAutoSynchronizer ¶
func GetLdapAutoSynchronizer ¶
func GetLdapAutoSynchronizer() *LdapAutoSynchronizer
func NewLdapAutoSynchronizer ¶
func NewLdapAutoSynchronizer() *LdapAutoSynchronizer
func (*LdapAutoSynchronizer) LdapAutoSynchronizerStartUpAll ¶
func (l *LdapAutoSynchronizer) LdapAutoSynchronizerStartUpAll()
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 LdapRespUser ¶
type LdapRespUser struct { UidNumber string `json:"uidNumber"` Uid string `json:"uid"` Cn string `json:"cn"` GroupId string `json:"groupId"` // GroupName string `json:"groupName"` Uuid string `json:"uuid"` Email string `json:"email"` Phone string `json:"phone"` Address string `json:"address"` }
func LdapUsersToLdapRespUsers ¶
func LdapUsersToLdapRespUsers(users []ldapUser) []LdapRespUser
type ManagedAccount ¶ added in v1.98.1
type Model ¶ added in v1.54.0
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"` ModelText string `xorm:"mediumtext" json:"modelText"` IsEnabled bool `json:"isEnabled"` }
func GetPaginationModels ¶ added in v1.54.0
type NameIDFormat ¶ added in v1.38.0
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"` }
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"` Favicon string `xorm:"varchar(100)" json:"favicon"` PasswordType string `xorm:"varchar(100)" json:"passwordType"` PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"` PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"` DefaultAvatar string `xorm:"varchar(100)" json:"defaultAvatar"` DefaultApplication string `xorm:"varchar(100)" json:"defaultApplication"` Tags []string `xorm:"mediumtext" json:"tags"` Languages []string `xorm:"varchar(255)" json:"languages"` MasterPassword string `xorm:"varchar(100)" json:"masterPassword"` EnableSoftDeletion bool `json:"enableSoftDeletion"` IsProfilePublic bool `json:"isProfilePublic"` AccountItems []*AccountItem `xorm:"varchar(3000)" json:"accountItems"` }
func GetMaskedOrganization ¶
func GetMaskedOrganization(organization *Organization) *Organization
func GetMaskedOrganizations ¶
func GetMaskedOrganizations(organizations []*Organization) []*Organization
func GetOrganization ¶
func GetOrganization(id string) *Organization
func GetOrganizationByUser ¶
func GetOrganizationByUser(user *User) *Organization
func GetOrganizations ¶
func GetOrganizations(owner string) []*Organization
func GetPaginationOrganizations ¶
func GetPaginationOrganizations(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Organization
type OriginalUser ¶
type OriginalUser = User
type Payment ¶ added in v1.16.0
type Payment 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"` Provider string `xorm:"varchar(100)" json:"provider"` Type string `xorm:"varchar(100)" json:"type"` Organization string `xorm:"varchar(100)" json:"organization"` User string `xorm:"varchar(100)" json:"user"` ProductName string `xorm:"varchar(100)" json:"productName"` ProductDisplayName string `xorm:"varchar(100)" json:"productDisplayName"` Detail string `xorm:"varchar(255)" json:"detail"` Tag string `xorm:"varchar(100)" json:"tag"` Currency string `xorm:"varchar(100)" json:"currency"` Price float64 `json:"price"` PayUrl string `xorm:"varchar(2000)" json:"payUrl"` ReturnUrl string `xorm:"varchar(1000)" json:"returnUrl"` State string `xorm:"varchar(100)" json:"state"` Message string `xorm:"varchar(1000)" json:"message"` PersonName string `xorm:"varchar(100)" json:"personName"` PersonIdCard string `xorm:"varchar(100)" json:"personIdCard"` PersonEmail string `xorm:"varchar(100)" json:"personEmail"` PersonPhone string `xorm:"varchar(100)" json:"personPhone"` InvoiceType string `xorm:"varchar(100)" json:"invoiceType"` InvoiceTitle string `xorm:"varchar(100)" json:"invoiceTitle"` InvoiceTaxId string `xorm:"varchar(100)" json:"invoiceTaxId"` InvoiceRemark string `xorm:"varchar(100)" json:"invoiceRemark"` InvoiceUrl string `xorm:"varchar(255)" json:"invoiceUrl"` }
func GetPaginationPayments ¶ added in v1.16.0
func GetPayment ¶ added in v1.16.0
func GetPayments ¶ added in v1.16.0
func GetUserPayments ¶ added in v1.29.0
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"` Users []string `xorm:"mediumtext" json:"users"` 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 GetPaginationPermissions ¶
func GetPaginationPermissions(owner string, offset, limit int, field, value, sortField, sortOrder string) []*Permission
func GetPermission ¶
func GetPermission(id string) *Permission
func GetPermissions ¶
func GetPermissions(owner string) []*Permission
func GetPermissionsByRole ¶ added in v1.92.0
func GetPermissionsByRole(roleId string) []*Permission
func GetPermissionsBySubmitter ¶ added in v1.88.1
func GetPermissionsBySubmitter(owner string, submitter string) []*Permission
func GetPermissionsByUser ¶ added in v1.77.0
func GetPermissionsByUser(userId string) []*Permission
func (*Permission) GetId ¶
func (permission *Permission) GetId() string
type PermissionRule ¶ added in v1.69.0
type PermissionRule struct { Ptype string `xorm:"varchar(100) index not null default ''" json:"ptype"` V0 string `xorm:"varchar(100) index not null default ''" json:"v0"` V1 string `xorm:"varchar(100) index not null default ''" json:"v1"` V2 string `xorm:"varchar(100) index not null default ''" json:"v2"` V3 string `xorm:"varchar(100) index not null default ''" json:"v3"` V4 string `xorm:"varchar(100) index not null default ''" json:"v4"` V5 string `xorm:"varchar(100) index not null default ''" json:"v5"` Id string `xorm:"varchar(100) index not null default ''" json:"id"` }
type Product ¶ added in v1.23.0
type Product 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"` Image string `xorm:"varchar(100)" json:"image"` Detail string `xorm:"varchar(255)" json:"detail"` Tag string `xorm:"varchar(100)" json:"tag"` Currency string `xorm:"varchar(100)" json:"currency"` Price float64 `json:"price"` Quantity int `json:"quantity"` Sold int `json:"sold"` Providers []string `xorm:"varchar(100)" json:"providers"` ReturnUrl string `xorm:"varchar(1000)" json:"returnUrl"` State string `xorm:"varchar(100)" json:"state"` ProviderObjs []*Provider `xorm:"-" json:"providerObjs"` }
func GetPaginationProducts ¶ added in v1.23.0
func GetProduct ¶ added in v1.23.0
func GetProducts ¶ added in v1.23.0
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(100)" json:"clientId"` ClientSecret string `xorm:"varchar(2000)" json:"clientSecret"` ClientId2 string `xorm:"varchar(100)" json:"clientId2"` ClientSecret2 string `xorm:"varchar(100)" json:"clientSecret2"` Cert string `xorm:"varchar(100)" json:"cert"` CustomAuthUrl string `xorm:"varchar(200)" json:"customAuthUrl"` CustomScope string `xorm:"varchar(200)" json:"customScope"` CustomTokenUrl string `xorm:"varchar(200)" json:"customTokenUrl"` CustomUserInfoUrl string `xorm:"varchar(200)" json:"customUserInfoUrl"` CustomLogo string `xorm:"varchar(200)" json:"customLogo"` Host string `xorm:"varchar(100)" json:"host"` Port int `json:"port"` DisableSsl bool `json:"disableSsl"` // If the provider type is WeChat, DisableSsl means EnableQRCode Title string `xorm:"varchar(100)" json:"title"` Content string `xorm:"varchar(1000)" 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 GetCaptchaProviderByApplication ¶ added in v1.57.0
func GetCaptchaProviderByOwnerName ¶ added in v1.57.0
func GetDefaultCaptchaProvider ¶ added in v1.57.0
func GetDefaultCaptchaProvider() *Provider
func GetGlobalProviders ¶ added in v1.151.0
func GetGlobalProviders() []*Provider
func GetMaskedProvider ¶
func GetMaskedProviders ¶
func GetPaginationGlobalProviders ¶ added in v1.151.0
func GetPaginationProviders ¶
func GetProvider ¶
func GetProviders ¶
func GetWechatMiniProgramProvider ¶ added in v1.41.0
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"` Prompted bool `json:"prompted"` AlertType string `json:"alertType"` Rule string `json:"rule"` Provider *Provider `json:"provider"` }
func (*ProviderItem) IsProviderVisible ¶
func (pi *ProviderItem) IsProviderVisible() bool
type Record ¶
type Record struct { Id int `xorm:"int notnull pk autoincr" json:"id"` Owner string `xorm:"varchar(100) index" json:"owner"` Name string `xorm:"varchar(100) index" json:"name"` CreatedTime string `xorm:"varchar(100)" json:"createdTime"` Organization string `xorm:"varchar(100)" json:"organization"` ClientIp string `xorm:"varchar(100)" json:"clientIp"` User string `xorm:"varchar(100)" json:"user"` Method string `xorm:"varchar(100)" json:"method"` RequestUri string `xorm:"varchar(1000)" json:"requestUri"` Action string `xorm:"varchar(1000)" json:"action"` ExtendedUser *User `xorm:"-" json:"extendedUser"` IsTriggered bool `json:"isTriggered"` }
func GetPaginationRecords ¶
func GetRecords ¶
func GetRecords() []*Record
func GetRecordsByField ¶
type Resource ¶
type Resource 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"` 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(255)" json:"url"` Description string `xorm:"varchar(255)" json:"description"` }
func GetPaginationResources ¶
func GetResource ¶
func GetResources ¶
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"` Users []string `xorm:"mediumtext" json:"users"` Roles []string `xorm:"mediumtext" json:"roles"` Domains []string `xorm:"mediumtext" json:"domains"` IsEnabled bool `json:"isEnabled"` }
func GetPaginationRoles ¶
func GetRolesByUser ¶ added in v1.77.0
type Saml11AssertionArtifact ¶ added in v1.39.0
type Saml11Request ¶ added in v1.39.0
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 SignupItem ¶
type SingleSignOnService ¶ added in v1.38.0
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"` Host string `xorm:"varchar(100)" json:"host"` Port int `json:"port"` User string `xorm:"varchar(100)" json:"user"` Password string `xorm:"varchar(100)" json:"password"` DatabaseType string `xorm:"varchar(100)" json:"databaseType"` Database string `xorm:"varchar(100)" json:"database"` Table string `xorm:"varchar(100)" json:"table"` TablePrimaryKey string `xorm:"varchar(100)" json:"tablePrimaryKey"` 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"` IsEnabled bool `json:"isEnabled"` Adapter *Adapter `xorm:"-" json:"-"` }
func GetMaskedSyncer ¶
func GetMaskedSyncers ¶
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)" json:"code"` AccessToken string `xorm:"mediumtext" json:"accessToken"` RefreshToken string `xorm:"mediumtext" json:"refreshToken"` 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 ¶ added in v1.14.1
func GetTokenByTokenAndApplication ¶ added in v1.26.0
func GetTokenByUser ¶ added in v1.24.0
func GetTokenByUser(application *Application, user *User, scope string, host string) (*Token, error)
GetTokenByUser Implicit flow
type TokenError ¶ added in v1.62.5
type TokenWrapper ¶
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)" json:"createdTime"` UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"` Id string `xorm:"varchar(100) index" json:"id"` Type string `xorm:"varchar(100)" json:"type"` Password string `xorm:"varchar(100)" json:"password"` PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"` 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"` 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"` 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"` Region string `xorm:"varchar(100)" json:"region"` 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"` IsGlobalAdmin bool `json:"isGlobalAdmin"` 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"` 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"` 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"` Custom string `xorm:"custom varchar(100)" json:"custom"` WebauthnCredentials []webauthn.Credential `xorm:"webauthnCredentials blob" json:"webauthnCredentials"` Ldap string `xorm:"ldap varchar(100)" json:"ldap"` Properties map[string]string `json:"properties"` Roles []*Role `json:"roles"` Permissions []*Permission `json:"permissions"` LastSigninWrongTime string `xorm:"varchar(100)" json:"lastSigninWrongTime"` SigninWrongTimes int `json:"signinWrongTimes"` ManagedAccounts []ManagedAccount `xorm:"managedAccounts blob" json:"managedAccounts"` }
func CheckUserPassword ¶
func ExtendManagedAccountsWithUser ¶ added in v1.105.0
func GetFilteredUsers ¶ added in v1.120.0
func GetFilteredUsers(m *ldapserver.Message, name, org string) ([]*User, int)
func GetGlobalUsers ¶
func GetGlobalUsers() []*User
func GetLastUser ¶
func GetMaskedUser ¶
func GetMaskedUsers ¶
func GetPaginationUsers ¶
func GetUserByEmail ¶
func GetUserByField ¶
func GetUserByFields ¶
func GetUserByPhone ¶ added in v1.78.0
func GetUserByUserId ¶ added in v1.70.0
func GetUserNoCheck ¶
func (*User) AddCredentials ¶ added in v1.68.0
func (user *User) AddCredentials(credential webauthn.Credential, isGlobalAdmin bool) bool
func (*User) CredentialExcludeList ¶ added in v1.68.0
func (user *User) CredentialExcludeList() []protocol.CredentialDescriptor
CredentialExcludeList returns a CredentialDescriptor array filled with all the user's credentials
func (*User) DeleteCredentials ¶ added in v1.68.0
func (*User) UpdateUserHash ¶
func (user *User) UpdateUserHash()
func (*User) UpdateUserPassword ¶
func (user *User) UpdateUserPassword(organization *Organization)
func (*User) WebAuthnCredentials ¶ added in v1.68.0
func (user *User) WebAuthnCredentials() []webauthn.Credential
func (*User) WebAuthnDisplayName ¶ added in v1.68.0
func (*User) WebAuthnID ¶ added in v1.68.0
WebAuthnID implementation of webauthn.User interface
func (*User) WebAuthnIcon ¶ added in v1.68.0
func (*User) WebAuthnName ¶ added in v1.68.0
type Userinfo ¶ added in v1.19.1
type Userinfo struct { Sub string `json:"sub"` Iss string `json:"iss"` Aud string `json:"aud"` Name string `json:"name,omitempty"` DisplayName string `json:"preferred_username,omitempty"` Email string `json:"email,omitempty"` Avatar string `json:"picture,omitempty"` Address string `json:"address,omitempty"` Phone string `json:"phone,omitempty"` }
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)"` Type string `xorm:"varchar(10)"` User string `xorm:"varchar(100) notnull"` Provider string `xorm:"varchar(100) notnull"` Receiver string `xorm:"varchar(100) notnull"` Code string `xorm:"varchar(10) notnull"` Time int64 `xorm:"notnull"` IsUsed bool }
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(100)" 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"` IsEnabled bool `json:"isEnabled"` }
func GetPaginationWebhooks ¶
func GetWebhook ¶
func GetWebhooks ¶
type X509Certificate ¶ added in v1.38.0
type X509Data ¶ added in v1.38.0
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
- casbin_adapter.go
- cert.go
- check.go
- check_util.go
- email.go
- init.go
- init_data.go
- ldap.go
- ldap_autosync.go
- ldapserver.go
- model.go
- oidc_discovery.go
- organization.go
- payment.go
- permission.go
- permission_enforcer.go
- product.go
- provider.go
- provider_item.go
- record.go
- resource.go
- role.go
- saml_idp.go
- saml_sp.go
- sms.go
- storage.go
- syncer.go
- syncer_affiliation.go
- syncer_cron.go
- syncer_public_api.go
- syncer_sync.go
- syncer_user.go
- syncer_util.go
- syner_db_user.go
- token.go
- token_cas.go
- token_jwt.go
- token_jwt_key.go
- user.go
- user_cred.go
- user_upload.go
- user_util.go
- user_webauthn.go
- verification.go
- webhook.go
- webhook_util.go