Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// 开启飞书认证
Enabled bool `json:"enabled" toml:"enabled" yaml:"enabled" env:"ENABLED"`
// 飞书应用凭证, Oauth2.0时 也叫client_id
AppId string `json:"app_id" toml:"app_id" yaml:"app_id" env:"API_ID"`
// 飞书应用凭证, Oauth2.0时 也叫client_secret
AppSecret string `json:"app_secret" toml:"app_secret" yaml:"app_secret" env:"API_SECRET"`
// Oauth2.0时, 应用服务地址页面
RedirectUri string `json:"redirect_uri" toml:"redirect_uri" yaml:"redirect_uri" env:"REDIRECT_URI"`
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig represents the default LDAP config.
func (*Config) MakeGetTokenFormRequest ¶
type Feishu ¶
type Feishu struct {
// contains filtered or unexported fields
}
飞书客户端
func NewFeishuClient ¶
func (*Feishu) GetUserInfo ¶
获取用户信息 https://open.feishu.cn/document/common-capabilities/sso/api/get-user-info
type User ¶
type User struct {
// sub 用户在应用内的唯一标识,等同于open_id string 是
Sub string `json:"sub"`
// name 用户姓名 string 是
Name string `json:"name"`
// picture 用户头像,等同于avatar_url string 是
Picture string `json:"picture"`
// open_id 用户在应用内的唯一标识, 等同于sub string 是
OpenId string `json:"open_id"`
// union_id 用户统一ID,在同一租户开发的所有应用内的唯一标识 string 是
UnionId string `json:"union_id"`
// en_name 用户英文名称 string 是
EnName string `json:"en_name"`
// tenant_key 当前企业标识 string 是
TenantKey string `json:"tenant_key"`
// avatar_url 用户头像,等同于picture string 是
AvatarUrl string `json:"avatar_url"`
// avatar_thumb 用户头像 72x72 string 是
AvatarThumb string `json:"avatar_thumb"`
// avatar_middle 用户头像 240x240 string 是
AvatarMiddle string `json:"avatar_middle"`
// avatar_big 用户头像 640x640 string 是
AvatarBig string `json:"avatar_big"`
// user_id 用户 user id,申请了邮箱获取权限(获取用户 user ID)的应用会返回该字段 string 否
UserId string `json:"user_id"`
// email 用户邮箱,申请了邮箱获取权限(获取用户邮箱信息)的应用会返回该字段 string 否
Email string `json:"email"`
// mobile 用户手机号,申请了手机号获取权限(获取用户手机号)的应用会返回该字段
Mobile string `json:"mobile"`
}
func (*User) ToCreateUserRequest ¶
func (u *User) ToCreateUserRequest(domain, password, descriptoin string) *user.CreateUserRequest
Click to show internal directories.
Click to hide internal directories.