1 Star 0 Fork 0

carlmax_my/console-core-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
base.go 4.66 KB
一键复制 编辑 原始数据 按行查看 历史
carlmax_my 提交于 2024-12-02 21:32 . init project
package authing
import (
"gitee.com/carlmax_my/console-core-go/pkg/authing/authing_model"
"gitee.com/carlmax_my/console-core-go/pkg/authing/authing_v2"
"gitee.com/carlmax_my/console-core-go/pkg/authing/authing_v3"
)
type BaseAuthingCli interface {
PrintOptions()
GetAppId() string
GetAppHost() string
ResetAuthCli(appId, appSecret, appHost, appRedirectUri, appLogoutRedirectUri, accessToken string)
ResetCliTenantId(tenantId string)
// region app
DelApp(appId string) error
FindAppById(appId string) *authing_model.Application
FindApp() *authing_model.Application
CreateApp(info *authing_model.CreateApplicationReq) (*authing_model.Application, error)
UpdateAppMfa(enabledFactors []string, disabledFactors []string) []string
// endregion app
BuildClientAuthUrl(appHost, state, redirectUri string, tenantId *string) string
BuildLogoutUrl(redirectUri string, idToken *string) string
PostAccountLogin(appId, tenantId string, payload interface{}) (interface{}, error)
PostPhoneCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error)
PostEmailCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error)
GetMeInfo(appId, tenantId, authorization string) (interface{}, error)
FindUserWhenLogin(appId, tenantId, key, loginType string) (interface{}, error)
SendEmailWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error)
SendSmsWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error)
GetLoginStatus(appId, tenantId string, payload interface{}) (interface{}, error)
GetCheckAppIsShowCode(appId string, tenantId string) (interface{}, error)
GetAppComponentPublicConfig(appId string, tenantId string) (interface{}, error)
GetAppPublicConfig(appId string, tenantId string) (interface{}, error)
PostGraphqlV2(appId string, tenantId string, payload any) (interface{}, error)
GetUserInfoByAccessToken(code string) (*authing_model.AuthingSessionUserInfo, error)
GetAccessTokenByCode(code, redirectUri string) (string, error)
RevokeToken(token string) error
SetAccessToken(token string)
// region tenant
GetAppTenantList() (list *[]authing_model.TenantDetails, err error)
GetTenantList() (list *[]authing_model.Tenant)
CreateTenant(tenantInfo *authing_model.CreateTenantRequest) (*authing_model.TenantDetails, error)
AddTenantMembers(tenantId, userId *string) error
UpdateTenant(id *string, tenantInfo *authing_model.CreateTenantRequest) (bool, error)
UpdateTenant_ExtraInfo(tenantId string, request *authing_model.UpdateTenantExtraReq) (bool, error)
RemoveTenant(tenantId *string) (*string, error)
UpdateTenant_loginPage(tenantId string, loginCfg *authing_model.MyAuthingLoginConfig) error
// endregion tenant
// region group
AddUserToGroup(userId *string, groupCode string) error
// endregion group
// region user
GetUser(userId *string) (*authing_model.User, error)
DeleteUser(id *string) (bool, error)
CreateUser(userInfo *authing_model.CreateUserInput) (*authing_model.User, error)
UpdateUser(id *string, user *authing_model.UpdateUserInput) error
ActiveUser(id *string) error
DeActiveUser(id *string) error
// endregion user
// region idp
// CreateIdp(name, idpType string) (bool, error)
CreateIdp(name, idpType string) (string, error)
UpdateIdp(idpId string, name string) error
DeleteIdp(idpId string) error
CreateIdpConnection(idpId string, connType string, identifier string, displayName string, fields interface{}) (string, error)
UpdateIdpConnection(idpConnectionId string, displayName string, fields interface{}) error
DeleteIdpConnection(idpConnectionId string) error
CreateIdp4Tenant(name, idpType, tenantId string) (string, error)
UpdateIdp4Tenant(idpId string, tenantId string, name string) error
DeleteIdp4Tenant(idpId string, tenantId string) error
CreateIdpConnection4Tenant(idpId string, tenantId string, connType string, identifier string, displayName string, fields interface{}) (string, error)
UpdateIdpConnection4Tenant(idpConnectionId string, tenantId string, displayName string, fields interface{}) error
DeleteIdpConnection4Tenant(idpConnectionId string, tenantId string) error
ChangeIdpConnectionState4App(idpConnectionId string, enable bool) error
ChangeIdpConnectionState4Tenant(idpConnectionId string, enable bool, tenantId string, isCreate bool) error
AutoJoinUserToTenant(idpId string, enable bool, tenantId string) error
// SMS,OTP,EMAIL
ChangeIdpConnectionMfa4Tenant(idpConnectionId string, tenantId string, EnabledFactors []string) error
// endregion idp
}
// tenant id will not set to header for v2 sdk
func GetAuthingCliV2() BaseAuthingCli {
return authing_v2.NewAuthingCli()
}
func GetAuthingCliV3(tenantId *string) BaseAuthingCli {
return authing_v3.NewAuthingCli(tenantId, true)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/carlmax_my/console-core-go.git
git@gitee.com:carlmax_my/console-core-go.git
carlmax_my
console-core-go
console-core-go
v0.0.13

搜索帮助

0d507c66 1850385 C8b1a773 1850385