60 lines
2.8 KiB
Go
60 lines
2.8 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
const (
|
|
TenantIdPDingTalk = "dingtalk"
|
|
TenantIdPFeishu = "feishu"
|
|
TenantIdPWeWork = "wework"
|
|
TenantIdPOIDC = "oidc"
|
|
TenantIdPSAML = "saml"
|
|
)
|
|
|
|
type AuthTenantIdp struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
Tid uint64 `orm:"column(tid)" json:"tid"`
|
|
Provider string `orm:"column(provider);size(32)" json:"provider"`
|
|
Name *string `orm:"column(name);size(128);null" json:"name"`
|
|
AppID *string `orm:"column(app_id);size(128);null" json:"app_id"`
|
|
AppSecret *string `orm:"column(app_secret);size(512);null" json:"-"`
|
|
Issuer *string `orm:"column(issuer);size(500);null" json:"issuer"`
|
|
AuthURL *string `orm:"column(auth_url);size(500);null" json:"auth_url"`
|
|
TokenURL *string `orm:"column(token_url);size(500);null" json:"token_url"`
|
|
UserinfoURL *string `orm:"column(userinfo_url);size(500);null" json:"userinfo_url"`
|
|
JwksURL *string `orm:"column(jwks_url);size(500);null" json:"jwks_url"`
|
|
Scopes *string `orm:"column(scopes);size(255);null" json:"scopes"`
|
|
AttrMap *string `orm:"column(attr_map);type(text);null" json:"attr_map"`
|
|
ProxyURL *string `orm:"column(proxy_url);size(500);null" json:"proxy_url"`
|
|
Status int8 `orm:"column(status);default(1)" json:"status"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
|
}
|
|
|
|
func (m *AuthTenantIdp) TableName() string {
|
|
return "yz_auth_tenant_idp"
|
|
}
|
|
|
|
const (
|
|
KickStrategyKickOld = 1
|
|
KickStrategyReject = 2
|
|
)
|
|
|
|
type AuthTenantAuthConfig struct {
|
|
Tid uint64 `orm:"column(tid);pk" json:"tid"`
|
|
VerifyType string `orm:"column(verify_type);size(20);default(captcha)" json:"verify_type"`
|
|
OpenVerify int8 `orm:"column(open_verify);default(1)" json:"open_verify"`
|
|
PwdMinLen int `orm:"column(pwd_min_len);default(8)" json:"pwd_min_len"`
|
|
PwdComplexity int8 `orm:"column(pwd_complexity);default(0)" json:"pwd_complexity"`
|
|
SessionTTL int `orm:"column(session_ttl);default(7200)" json:"session_ttl"`
|
|
MaxSession int `orm:"column(max_session);default(1)" json:"max_session"`
|
|
KickStrategy int8 `orm:"column(kick_strategy);default(1)" json:"kick_strategy"`
|
|
MfaRequired int8 `orm:"column(mfa_required);default(0)" json:"mfa_required"`
|
|
IPWhitelist *string `orm:"column(ip_whitelist);type(text);null" json:"ip_whitelist"`
|
|
AllowThird *string `orm:"column(allow_third);size(255);null" json:"allow_third"`
|
|
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
|
}
|
|
|
|
func (m *AuthTenantAuthConfig) TableName() string {
|
|
return "yz_auth_tenant_auth_config"
|
|
}
|