casdoor

package
v0.0.0-...-ac0283c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MulanPSL-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountItem

type AccountItem struct {
	Name       string `json:"name"`
	Visible    bool   `json:"visible"`
	ViewRule   string `json:"viewRule"`
	ModifyRule string `json:"modifyRule"`
}

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"`
	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"`
	FormBackgroundUrl    string   `xorm:"varchar(200)" json:"formBackgroundUrl"`
}

Application has the same definition as https://github.com/casdoor/casdoor/blob/master/object/application.go#L24

type AuthConfig

type AuthConfig struct {
	Endpoint         string
	ClientId         string
	ClientSecret     string
	Certificate      string
	OrganizationName string
	ApplicationName  string
}

AuthConfig is the core configuration. The first step to use this SDK is to use the InitConfig function to initialize the global authConfig.

type Claims

type Claims struct {
	User
	AccessToken string `json:"accessToken"`
	jwt.RegisteredClaims
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg AuthConfig) *Client

func (*Client) AddApplication

func (c *Client) AddApplication(application *Application) (bool, error)

func (*Client) AddOrganization

func (c *Client) AddOrganization(organization *Organization) (bool, error)

func (*Client) AddPermission

func (c *Client) AddPermission(permission *Permission) (bool, error)

func (*Client) AddRecord

func (c *Client) AddRecord(record *Record) (bool, error)

func (*Client) AddRole

func (c *Client) AddRole(role *Role) (bool, error)

func (*Client) AddUser

func (c *Client) AddUser(user *User) (bool, error)

func (*Client) BatchEnforce

func (c *Client) BatchEnforce(permissionRules []PermissionRule) ([]bool, error)

func (*Client) CheckUserPassword

func (c *Client) CheckUserPassword(user *User) (bool, error)

func (*Client) DeleteApplication

func (c *Client) DeleteApplication(name string) (bool, error)

func (*Client) DeleteOrganization

func (c *Client) DeleteOrganization(name string) (bool, error)

func (*Client) DeletePermission

func (c *Client) DeletePermission(permission *Permission) (bool, error)

func (*Client) DeleteResource

func (c *Client) DeleteResource(name string) (bool, error)

func (*Client) DeleteRole

func (c *Client) DeleteRole(role *Role) (bool, error)

func (*Client) DeleteUser

func (c *Client) DeleteUser(user *User) (bool, error)

func (*Client) DoGetBytes

func (c *Client) DoGetBytes(url string) ([]byte, error)

DoGetBytes is a general function to get response data in bytes from param url through HTTP Get method.

func (*Client) DoGetBytesRaw

func (c *Client) DoGetBytesRaw(url string) ([]byte, error)

DoGetBytesRaw is a general function to get response from param url through HTTP Get method.

func (*Client) DoGetResponse

func (c *Client) DoGetResponse(url string) (*Response, error)

DoGetResponse is a general function to get response from param url through HTTP Get method.

func (*Client) DoPost

func (c *Client) DoPost(action string, queryMap map[string]string, postBytes []byte, isForm, isFile bool) (*Response, error)

func (*Client) DoPostBytesRaw

func (c *Client) DoPostBytesRaw(url string, contentType string, body io.Reader) ([]byte, error)

DoPostBytesRaw is a general function to post a request from url, body through HTTP Post method.

func (*Client) Enforce

func (c *Client) Enforce(permissionRule *PermissionRule) (bool, error)

func (*Client) GetId

func (c *Client) GetId(name string) string

func (*Client) GetMyProfileUrl

func (c *Client) GetMyProfileUrl(accessToken string) string

func (*Client) GetOAuthToken

func (c *Client) GetOAuthToken(code string, state string) (*oauth2.Token, error)

GetOAuthToken gets the pivotal and necessary secret to interact with the Casdoor server

func (*Client) GetPaginationPermissions

func (c *Client) GetPaginationPermissions(p int, pageSize int, queryMap map[string]string) ([]*Permission, int, error)

func (*Client) GetPaginationRoles

func (c *Client) GetPaginationRoles(p int, pageSize int, queryMap map[string]string) ([]*Role, int, error)

func (*Client) GetPaginationUsers

func (c *Client) GetPaginationUsers(p int, pageSize int, queryMap map[string]string) ([]*User, int, error)

func (*Client) GetPermission

func (c *Client) GetPermission(name string) (*Permission, error)

func (*Client) GetPermissions

func (c *Client) GetPermissions() ([]*Permission, error)

func (*Client) GetPermissionsByRole

func (c *Client) GetPermissionsByRole(name string) ([]*Permission, error)

func (*Client) GetRole

func (c *Client) GetRole(name string) (*Role, error)

func (*Client) GetRoles

func (c *Client) GetRoles() ([]*Role, error)

func (*Client) GetSigninUrl

func (c *Client) GetSigninUrl(redirectUri string) string

func (*Client) GetSignupUrl

func (c *Client) GetSignupUrl(enablePassword bool, redirectUri string) string

func (*Client) GetSortedUsers

func (c *Client) GetSortedUsers(sorter string, limit int) ([]*User, error)

func (*Client) GetUrl

func (c *Client) GetUrl(action string, queryMap map[string]string) string

func (*Client) GetUser

func (c *Client) GetUser(name string) (*User, error)

func (*Client) GetUserByEmail

func (c *Client) GetUserByEmail(email string) (*User, error)

func (*Client) GetUserByPhone

func (c *Client) GetUserByPhone(phone string) (*User, error)

func (*Client) GetUserByUserId

func (c *Client) GetUserByUserId(userId string) (*User, error)

func (*Client) GetUserCount

func (c *Client) GetUserCount(field, value string) (int, error)

func (*Client) GetUserProfileUrl

func (c *Client) GetUserProfileUrl(userName string, accessToken string) string

func (*Client) GetUsers

func (c *Client) GetUsers() ([]*User, error)

func (*Client) ParseJwtToken

func (c *Client) ParseJwtToken(token string) (*Claims, error)

func (*Client) RefreshOAuthToken

func (c *Client) RefreshOAuthToken(refreshToken string) (*oauth2.Token, error)

RefreshOAuthToken refreshes the OAuth token

func (*Client) SendEmail

func (c *Client) SendEmail(title string, content string, sender string, receivers ...string) error

func (*Client) SendSms

func (c *Client) SendSms(content string, receivers ...string) error

func (*Client) SetHttpClient

func (c *Client) SetHttpClient(httpClient HttpClient)

SetHttpClient sets custom http Client.

func (*Client) SetPassword

func (c *Client) SetPassword(owner, name, oldPassword, newPassword string) (bool, error)

note: oldPassword is not required, if you don't need, just pass a empty string

func (*Client) UpdatePermission

func (c *Client) UpdatePermission(permission *Permission) (bool, error)

func (*Client) UpdatePermissionForColumns

func (c *Client) UpdatePermissionForColumns(permission *Permission, columns []string) (bool, error)

func (*Client) UpdateRole

func (c *Client) UpdateRole(role *Role) (bool, error)

func (*Client) UpdateRoleForColumns

func (c *Client) UpdateRoleForColumns(role *Role, columns []string) (bool, error)

func (*Client) UpdateUser

func (c *Client) UpdateUser(user *User) (bool, error)

func (*Client) UpdateUserById

func (c *Client) UpdateUserById(id string, user *User, columns ...string) (bool, error)

func (*Client) UpdateUserForColumns

func (c *Client) UpdateUserForColumns(user *User, columns []string) (bool, error)

func (*Client) UploadResource

func (c *Client) UploadResource(user string, tag string, parent string, fullFilePath string, fileBytes []byte) (string, string, error)

func (*Client) UploadResourceEx

func (c *Client) UploadResourceEx(user string, tag string, parent string, fullFilePath string, fileBytes []byte, createdTime string, description string) (string, string, error)

type HttpClient

type HttpClient interface {
	Do(*http.Request) (*http.Response, error)
}

HttpClient interface has the method required to use a type as custom http client. The net/*http.Client type satisfies this interface.

type ManagedAccount

type ManagedAccount struct {
	Application string `xorm:"varchar(100)" json:"application"`
	Username    string `xorm:"varchar(100)" json:"username"`
	Password    string `xorm:"varchar(100)" json:"password"`
	SigninUrl   string `xorm:"varchar(200)" json:"signinUrl"`
}

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"`
	MasterPassword     string   `xorm:"varchar(100)" json:"masterPassword"`
	EnableSoftDeletion bool     `json:"enableSoftDeletion"`
	IsProfilePublic    bool     `json:"isProfilePublic"`

	AccountItems []*AccountItem `xorm:"varchar(3000)" json:"accountItems"`
}

Organization has the same definition as https://github.com/casdoor/casdoor/blob/master/object/organization.go#L25

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"`
}

type PermissionRule

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 Provider

type Provider struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName       string `xorm:"varchar(100)" json:"displayName"`
	Category          string `xorm:"varchar(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"`

	Host       string `xorm:"varchar(100)" json:"host"`
	Port       int    `json:"port"`
	DisableSsl bool   `json:"disableSsl"`
	Title      string `xorm:"varchar(100)" json:"title"`
	Content    string `xorm:"varchar(1000)" json:"content"`
	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"`

	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"`
}

type ProviderItem

type ProviderItem struct {
	Name      string    `json:"name"`
	CanSignUp bool      `json:"canSignUp"`
	CanSignIn bool      `json:"canSignIn"`
	CanUnlink bool      `json:"canUnlink"`
	Prompted  bool      `json:"prompted"`
	AlertType string    `json:"alertType"`
	Provider  *Provider `json:"provider"`
}

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"`
}

type Resource

type Resource struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(250) 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(1000)" json:"fileName"`
	FileType    string `xorm:"varchar(100)" json:"fileType"`
	FileFormat  string `xorm:"varchar(100)" json:"fileFormat"`
	FileSize    int    `json:"fileSize"`
	Url         string `xorm:"varchar(1000)" json:"url"`
	Description string `xorm:"varchar(1000)" json:"description"`
}

Resource has the same definition as https://github.com/casdoor/casdoor/blob/master/object/resource.go#L24

type Response

type Response struct {
	Status string      `json:"status"`
	Msg    string      `json:"msg"`
	Data   interface{} `json:"data"`
	Data2  interface{} `json:"data2"`
}

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"`
}

Role has the same definition as https://github.com/casdoor/casdoor/blob/master/object/role.go#L24

type SignupItem

type SignupItem struct {
	Name     string `json:"name"`
	Visible  bool   `json:"visible"`
	Required bool   `json:"required"`
	Prompted bool   `json:"prompted"`
	Rule     string `json:"rule"`
}

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"`

	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"`
}

User has the same definition as https://github.com/casdoor/casdoor/blob/master/object/user.go#L24

func (User) GetId

func (u User) GetId() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL