authing

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthingIdpAZureADFields

type AuthingIdpAZureADFields struct {
	AuthorizationDomain  string `json:"authorizationDomain"`  // "https://login.microsoftonline.com/",
	Tenant               string `json:"tenant"`               // "Azure AD1",
	ClientId             string `json:"clientId"`             // "Azure AD1",
	ClientSecret         string `json:"clientSecret"`         // "Azure AD1",
	EmailVerifiedDefault bool   `json:"emailVerifiedDefault"` // false
}

type AuthingIdpBaiduFields

type AuthingIdpBaiduFields struct {
	ClientID     string `json:"clientID"`     //
	ClientSecret string `json:"clientSecret"` //
}

type AuthingIdpBaiduMobileFields

type AuthingIdpBaiduMobileFields struct {
	ClientID     string `json:"clientID"`     //
	ClientSecret string `json:"clientSecret"` //
	Unionid      bool   `json:"unionid"`      //
}

type AuthingIdpGiteeFields

type AuthingIdpGiteeFields struct {
	ClientID     string   `json:"clientID"`     //
	ClientSecret string   `json:"clientSecret"` //
	CallbackURL  string   `json:"callbackURL"`  //
	RedirectUrl  string   `json:"redirectUrl"`  // keep empty
	Scopes       []string `json:"scopes"`       // user_info
}

type AuthingIdpSAMLFields

type AuthingIdpSAMLFields struct {
	SamlIdpCert        string `json:"samlIdpCert"`
	SignInEndPoint     string `json:"signInEndPoint"`     // "http://127.0.0.1",
	SignSamlRequest    bool   `json:"signSamlRequest"`    //
	SignatureAlgorithm string `json:"signatureAlgorithm"` // "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
	DigestAlgorithm    string `json:"digestAlgorithm"`    // "http://www.w3.org/2001/04/xmlenc#sha256",
	ProtocolBinding    string `json:"protocolBinding"`    // "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
}

type AuthingIdpWechatworkQrConnFields

type AuthingIdpWechatworkQrConnFields struct {
	CorpID           string `json:"corpID"`           //
	AgentID          string `json:"agentID"`          //
	Secret           string `json:"secret"`           //
	IsOpenQrcodeAuth bool   `json:"isOpenQrcodeAuth"` //
}

type AuthingIdpWindowsADFields

type AuthingIdpWindowsADFields struct {
	SyncPassword        bool `json:"syncPassword"`        //
	RewritePasswordToAd bool `json:"rewritePasswordToAd"` //
}

type BaseAuthingCli

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

	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

	// region group
	AddUserToGroup(userId *string, groupCode string) error

	// 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

	// 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
}

func GetAuthingCliV2

func GetAuthingCliV2() BaseAuthingCli

tenant id will not set to header for v2 sdk

func GetAuthingCliV3

func GetAuthingCliV3(tenantId *string) BaseAuthingCli

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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