management

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRequestParam

func CreateRequestParam(param struct{}) map[string]interface{}

func GetAccessToken

func GetAccessToken(client *Client) (string, error)

func QueryAccessToken

func QueryAccessToken(client *Client) (*model.AccessTokenRes, error)

Types

type Client

type Client struct {
	HttpClient *http.Client

	Host string

	// Log is called with various debug information.
	// To log to standard out, use:
	//  client.Log = func(s string) { log.Println(s) }
	Log func(s string)
	// contains filtered or unexported fields
}

Client is a client for interacting with the GraphQL API of `Authing`

func NewClient

func NewClient(userPoolId string, secret string, host ...string) *Client

func NewClientWithError added in v0.1.9

func NewClientWithError(userPoolId string, secret string, host ...string) (*Client, error)

func NewHttpClient

func NewHttpClient(userPoolId string, appSecret string, isDev bool) *Client

NewHttpClient creates a new Authing user endpoint GraphQL API client

func NewOauthClient

func NewOauthClient(userPoolId string, appSecret string, isDev bool) *Client

NewOauthClient creates a new Authing oauth endpoint GraphQL API client

func (*Client) ActivateUser added in v0.2.6

func (c *Client) ActivateUser(userId string) (*model.CommonMessageAndCode, error)

ActivateUser 解除停用账号

func (*Client) AddAssignments

AddAssignments 添加策略授权

func (*Client) AddMembers

func (c *Client) AddMembers(nodeId string, userIds []string) (*model.Node, error)

AddMembers 节点添加成员

func (*Client) AddOrgNode

func (c *Client) AddOrgNode(req *model.AddOrgNodeRequest) (*model.AddNodeOrg, error)

AddOrgNode 在组织机构中添加一个节点

func (*Client) AddRolePolicies

func (c *Client) AddRolePolicies(code string, policiesCode []string) (*model.CommonMessageAndCode, error)

AddRolePolicies 给角色授权策略

func (*Client) AddTenantMembers

func (c *Client) AddTenantMembers(tenantId string, userIds []string) (*model.AddTenantMembersResponse, error)

AddTenantMembers 添加租户成员

func (*Client) AddUserPolicies

func (c *Client) AddUserPolicies(userId string, policiesCode []string) (*model.CommonMessageAndCode, error)

AddUserPolicies 批量添加策略

func (*Client) AddUserPoolEnv

func (c *Client) AddUserPoolEnv(key, value string) (*model.UserPoolEnv, error)

AddUserPoolEnv 新增环境变量列表

func (*Client) AddUserToGroup

func (c *Client) AddUserToGroup(userId, groupCode string) (*model.CommonMessageAndCode, error)

AddUserToGroup 将用户加入分组

func (*Client) AddUserToGroups

func (c *Client) AddUserToGroups(code string, userIds []string) (*model.CommonMessageAndCode, error)

AddUserToGroups 添加用户

func (*Client) AddUserToRoles

func (c *Client) AddUserToRoles(request model.UserRoleOptRequest) (*model.CommonMessageAndCode, error)

AddUserToRoles 将用户加入角色

func (*Client) AddWhileList

func (c *Client) AddWhileList(whileListType model.EnumWhitelistType, ids []string) (*[]model.WhiteList, error)

AddWhileList 添加白名单记录

func (*Client) Allow

func (c *Client) Allow(request model.AllowRequest) (bool, error)

Allow 允许某个用户对某个资源进行某个操作

func (*Client) AllowApplicationAccessPolicies

func (c *Client) AllowApplicationAccessPolicies(appId string, req *model.ApplicationAccessPoliciesRequest) (*string, error)

AllowApplicationAccessPolicies 配置「允许主体(用户、角色、分组、组织机构节点)访问应用」的控制策略

func (*Client) ApplicationTenants

func (c *Client) ApplicationTenants(appId string) (*model.ApplicationTenantDetails, error)

ApplicationTenants 获取应用关联租户

func (*Client) AssignRole

AssignRole 角色 添加用户

func (*Client) AuthorizeResource

func (c *Client) AuthorizeResource(request model.AuthorizeResourceRequest) (bool, error)

AuthorizeResource 将一个(类)资源授权给用户、角色、分组、组织机构,且可以分别指定不同的操作权限。

func (*Client) BatchChangeExtIdpConnectionState

func (c *Client) BatchChangeExtIdpConnectionState(extIdpId string, request *model.ChangeExtIdpConnectionStateRequest) (bool, error)

BatchChangeExtIdpConnectionState 批量开关身份源连接

func (*Client) BatchDeleteGroups

func (c *Client) BatchDeleteGroups(codes []string) (*model.CommonMessageAndCode, error)

BatchDeleteGroups 批量删除分组

func (*Client) BatchDeletePolicy

func (c *Client) BatchDeletePolicy(codeList []string) (*model.CommonMessageAndCode, error)

BatchDeletePolicy 删除策略

func (*Client) BatchDeleteRole

func (c *Client) BatchDeleteRole(request model.BatchDeleteRoleRequest) (*model.CommonMessageAndCode, error)

BatchDeleteRole 批量删除角色

func (*Client) BatchDeleteUser

func (c *Client) BatchDeleteUser(ids []string) (*model.CommonMessageAndCode, error)

BatchDeleteUser 批量删除用户

func (*Client) BatchGetRoleUdfValue

func (c *Client) BatchGetRoleUdfValue(ids []string) (map[string][]model.UserDefinedData, error)

BatchGetRoleUdfValue 获取多个角色扩展字段列表

func (*Client) BatchGetUser

func (c *Client) BatchGetUser(ids []string, queryField string, withCustomData bool) (*[]model.User, error)

BatchGetUser 通过 ID、username、email、phone、email、externalId 批量获取用户详情

func (*Client) BatchGetUserUdfValue

func (c *Client) BatchGetUserUdfValue(ids []string) (map[string][]model.UserDefinedData, error)

BatchGetUserUdfValue 批量获取多个用户的自定义数据

func (*Client) BatchSetRoleUdfValue

func (c *Client) BatchSetRoleUdfValue(request *[]model.SetUdfValueBatchInput) (*model.CommonMessageAndCode, error)

BatchSetRoleUdfValue 设置多个角色扩展字段列表

func (*Client) BatchSetUserUdfValue

func (c *Client) BatchSetUserUdfValue(request *[]model.SetUdfValueBatchInput) (*model.CommonMessageAndCode, error)

BatchSetUserUdfValue 批量设置自定义数据

func (*Client) ChangeExtIdpConnectionState

func (c *Client) ChangeExtIdpConnectionState(extIdpConnectionId string, request *model.ChangeExtIdpConnectionStateRequest) (bool, error)

ChangeExtIdpConnectionState 开关身份源连接

func (*Client) CheckExtIdpConnectionIdentifierUnique

func (c *Client) CheckExtIdpConnectionIdentifierUnique(identifier string) (bool, error)

CheckExtIdpConnectionIdentifierUnique 检查连接唯一标识是否冲突

func (*Client) CheckLoginStatus

func (c *Client) CheckLoginStatus(userId string, appId, deviceId *string) (*model.CommonMessageAndCode, error)

CheckLoginStatus 检查用户登录状态

func (*Client) CheckLoginStatusByToken

func (c *Client) CheckLoginStatusByToken(token string) (*model.CheckLoginStatusResponse, error)

CheckLoginStatusByToken 检测登录状态

func (*Client) CheckUserExists

func (c *Client) CheckUserExists(request model.CheckUserExistsRequest) (bool, error)

CheckUserExists 检查用户是否存在

func (*Client) ConfigTenant

func (c *Client) ConfigTenant(tenantId string, request *model.ConfigTenantRequest) (bool, error)

ConfigTenant 配置租户品牌化

func (*Client) CreateApplication

func (c *Client) CreateApplication(name, identifier, redirectUris string, logo *string) (*model.Application, error)

CreateApplication 创建应用

func (*Client) CreateApplicationAgreement

func (c *Client) CreateApplicationAgreement(appId, title string, lang *string, required *bool) (*model.ApplicationAgreement, error)

CreateApplicationAgreement 创建应用协议

func (*Client) CreateExtIdp

func (c *Client) CreateExtIdp(request *model.CreateExtIdpRequest) (*model.ExtIdpDetailResponse, error)

CreateExtIdp 创建身份源

func (*Client) CreateExtIdpConnection

func (c *Client) CreateExtIdpConnection(request *model.CreateExtIdpConnectionRequest) (*model.ExtIdpConnectionDetails, error)

CreateExtIdpConnection 创建身份源连接

func (*Client) CreateGroups

func (c *Client) CreateGroups(req *model.CreateGroupsRequest) (*model.GroupModel, error)

CreateGroups 创建分组

func (*Client) CreateNamespace

func (c *Client) CreateNamespace(request *model.EditNamespaceRequest) (*model.Namespace, error)

CreateNamespace 创建权限分组

func (*Client) CreateOrg

func (c *Client) CreateOrg(req *model.CreateOrgRequest) (*model.OrgResponse, error)

CreateOrg 创建组织机构

func (*Client) CreatePolicy

func (c *Client) CreatePolicy(req *model.PolicyRequest) (*model.CreatePolicyResponse, error)

CreatePolicy 添加策略

func (*Client) CreateProgrammaticAccessAccount

func (c *Client) CreateProgrammaticAccessAccount(appId string, remark *string, tokenLifetime *int) (*model.ProgrammaticAccessAccount, error)

CreateProgrammaticAccessAccount 添加编程访问账号

func (*Client) CreateResource

func (c *Client) CreateResource(req *model.CreateResourceRequest) (*model.ResourceResponse, error)

CreateResource 创建资源

func (*Client) CreateRole

func (c *Client) CreateRole(request model.CreateRoleRequest) (*model.Role, error)

CreateRole 创建角色

func (*Client) CreateTenant

func (c *Client) CreateTenant(request *model.CreateTenantRequest) (*model.TenantDetails, error)

CreateTenant 创建租户

func (*Client) CreateUser

func (c *Client) CreateUser(request model.CreateUserRequest) (*model.User, error)

CreateUser 创建用户

func (*Client) DeleteApplication

func (c *Client) DeleteApplication(appId string) (*string, error)

DeleteApplication 删除应用

func (*Client) DeleteApplicationAccessPolicies

func (c *Client) DeleteApplicationAccessPolicies(appId string, req *model.ApplicationAccessPoliciesRequest) (*string, error)

DeleteApplicationAccessPolicies 删除应用访问控制策略

func (*Client) DeleteApplicationAgreement

func (c *Client) DeleteApplicationAgreement(appId, agreementId string) (*string, error)

DeleteApplicationAgreement 删除应用协议

func (*Client) DeleteExtIdp

func (c *Client) DeleteExtIdp(extIdpId string) (*string, error)

DeleteExtIdp 删除身份源

func (*Client) DeleteExtIdpConnection

func (c *Client) DeleteExtIdpConnection(extIdpConnectionId string) (*string, error)

DeleteExtIdpConnection 删除身份源连接

func (*Client) DeleteGroups

func (c *Client) DeleteGroups(code string) (*model.CommonMessageAndCode, error)

DeleteGroups 删除分组

func (*Client) DeleteNamespace

func (c *Client) DeleteNamespace(id string) (*string, error)

DeleteNamespace 删除权限分组

func (*Client) DeleteNodeMembers

func (c *Client) DeleteNodeMembers(nodeId string, userIds []string) (*model.Node, error)

DeleteNodeMembers 删除节点成员

func (*Client) DeleteOrgById

func (c *Client) DeleteOrgById(id string) (*model.CommonMessageAndCode, error)

DeleteOrgById 删除组织机构

func (*Client) DeleteOrgNode

func (c *Client) DeleteOrgNode(orgId, nodeId string) (*model.CommonMessageAndCode, error)

DeleteOrgNode 删除节点

func (*Client) DeletePolicy

func (c *Client) DeletePolicy(code string) (*model.CommonMessageAndCode, error)

DeletePolicy 删除策略

func (*Client) DeleteProgrammaticAccessAccount

func (c *Client) DeleteProgrammaticAccessAccount(programmaticAccessAccountId string) (*string, error)

DeleteProgrammaticAccessAccount 删除编程访问账号

func (*Client) DeleteResource

func (c *Client) DeleteResource(code, namespace string) (*string, error)

DeleteResource 删除资源

func (*Client) DeleteRole

func (c *Client) DeleteRole(request model.DeleteRoleRequest) (*model.CommonMessageAndCode, error)

DeleteRole 删除角色

func (*Client) DeleteUser

func (c *Client) DeleteUser(id string) (*model.CommonMessageAndCode, error)

DeleteUser 删除用户

func (*Client) DenyApplicationAccessPolicies

func (c *Client) DenyApplicationAccessPolicies(appId string, req *model.ApplicationAccessPoliciesRequest) (*string, error)

DenyApplicationAccessPolicies 配置「拒绝主体(用户、角色、分组、组织机构节点)访问应用」的控制策略

func (*Client) Detail

func (c *Client) Detail(userId string) (*model.User, error)

Detail 获取用户详情

func (*Client) DetailGroups

func (c *Client) DetailGroups(code string) (*model.GroupModel, error)

DetailGroups 获取分组详情

func (*Client) DetailPolicy

func (c *Client) DetailPolicy(code string) (*model.Policy, error)

DetailPolicy 获取策略详情

func (*Client) DisableApplicationAccessPolicies

func (c *Client) DisableApplicationAccessPolicies(appId string, req *model.ApplicationAccessPoliciesRequest) (*string, error)

DisableApplicationAccessPolicies 停用应用访问控制策略

func (*Client) DisableAssignments

DisableAssignments 设置策略授权状态为关闭

func (*Client) DisableProgrammaticAccessAccount

func (c *Client) DisableProgrammaticAccessAccount(programmaticAccessAccountId string) (*model.ProgrammaticAccessAccount, error)

DisableProgrammaticAccessAccount 禁用编程访问账号

func (*Client) DisableWhileList

func (c *Client) DisableWhileList(whileListType model.EnumWhitelistType) (*model.UserPool, error)

DisableWhileList 关闭白名单

func (*Client) EnableApplicationAccessPolicies

func (c *Client) EnableApplicationAccessPolicies(appId string, req *model.ApplicationAccessPoliciesRequest) (*string, error)

EnableApplicationAccessPolicies 启用应用访问控制策略

func (*Client) EnableAssignments

EnableAssignments 设置策略授权状态为开启

func (*Client) EnableProgrammaticAccessAccount

func (c *Client) EnableProgrammaticAccessAccount(programmaticAccessAccountId string) (*model.ProgrammaticAccessAccount, error)

EnableProgrammaticAccessAccount 启用编程访问账号

func (*Client) EnableWhileList

func (c *Client) EnableWhileList(whileListType model.EnumWhitelistType) (*model.UserPool, error)

EnableWhileList 开启白名单

func (*Client) ExportAll

func (c *Client) ExportAll() ([]model.OrgNode, error)

ExportAll 导出所有组织机构

func (*Client) ExportByOrgId

func (c *Client) ExportByOrgId(orgId string) (*model.OrgNode, error)

ExportByOrgId 导出某个组织机构

func (*Client) ExtIdpDetail

func (c *Client) ExtIdpDetail(extIdpId string) (*model.ExtIdpDetailResponse, error)

ExtIdpDetail 获取身份源详细信息

func (*Client) FindApplicationById

func (c *Client) FindApplicationById(appId string) (*model.Application, error)

FindApplicationById 通过应用 id 查找应用详情

func (*Client) FindUser

func (c *Client) FindUser(request *model.FindUserRequest) (*model.User, error)

FindUser 查找用户

func (*Client) GetApplicationAccessPolicies

func (c *Client) GetApplicationAccessPolicies(appId string, page, limit int) (*model.GetApplicationAccessPoliciesResponse, error)

GetApplicationAccessPolicies 获取应用访问控制策略列表

func (*Client) GetAuthorizedTargets

func (c *Client) GetAuthorizedTargets(req *model.GetAuthorizedTargetsRequest) (*struct {
	TotalCount int64 `json:"totalCount"`
	List       []struct {
		Actions          []string `json:"actions"`
		TargetType       string   `json:"targetType"`
		TargetIdentifier string   `json:"targetIdentifier"`
	} `json:"list"`
}, error)

GetAuthorizedTargets 获取具备某些资源操作权限的主体

func (*Client) GetAuthorizedTargetsCode added in v0.2.4

func (c *Client) GetAuthorizedTargetsCode(req *model.GetAuthorizedTargetsRequest) (*struct {
	TotalCount int64 `json:"totalCount"`
	List       []struct {
		Actions          []string `json:"actions"`
		TargetType       string   `json:"targetType"`
		TargetIdentifier string   `json:"targetIdentifier"`
	} `json:"list"`
}, error)

GetAuthorizedTargetsCode 获取具备某些资源操作权限的主体, 分组返回 Code

func (*Client) GetOrgNodeById

func (c *Client) GetOrgNodeById(id string) (*model.OrgNodeChildStr, error)

GetOrgNodeById 获取某个节点详情

func (*Client) GetOrganizationById

func (c *Client) GetOrganizationById(orgId string) (*model.Org, error)

GetOrganizationById 获取组织机构详情

func (*Client) GetOrganizationChildren

func (c *Client) GetOrganizationChildren(nodeId string, depth int) (*[]model.Node, error)

GetOrganizationChildren 获取子节点列表

func (*Client) GetOrganizationList

func (c *Client) GetOrganizationList(request model.QueryListRequest) (model.PaginatedOrgs, error)

TODO

func (*Client) GetResourceByCode

func (c *Client) GetResourceByCode(code, namespace string) (*model.ResourceResponse, error)

GetResourceByCode 根据 Code 获取单个资源

func (*Client) GetResourceById

func (c *Client) GetResourceById(id string) (*model.ResourceResponse, error)

GetResourceById 根据 ID 获取单个资源

func (*Client) GetRoleList

func (c *Client) GetRoleList(request model.GetRoleListRequest) (*model.PaginatedRoles, error)

GetRoleList 获取角色列表

func (*Client) GetRoleSpecificUdfValue

func (c *Client) GetRoleSpecificUdfValue(id string) (*[]model.UserDefinedData, error)

GetRoleSpecificUdfValue 获取某个角色某个扩展字段

func (*Client) GetRoleUdfValue

func (c *Client) GetRoleUdfValue(id string) (*[]model.UserDefinedData, error)

GetRoleUdfValue 获取某个角色扩展字段列表

func (*Client) GetRoleUserList

func (c *Client) GetRoleUserList(request model.GetRoleUserListRequest) (*struct {
	TotalCount int64        `json:"totalCount"`
	List       []model.User `json:"list"`
}, error)

GetRoleUserList 获取角色用户列表

func (*Client) GetRootNode

func (c *Client) GetRootNode(orgId string) (*model.OrgNodeChildStr, error)

GetRootNode 获取根节点

func (*Client) GetTenantDetails

func (c *Client) GetTenantDetails(tenantId string) (*model.TenantDetails, error)

GetTenantDetails 获取租户详情

func (*Client) GetTenantList

func (c *Client) GetTenantList(request *model.CommonPageRequest) (*model.GetTenantListResponse, error)

GetTenantList 获取用户池下租户列表

func (*Client) GetTenantMembers

func (c *Client) GetTenantMembers(tenantId string, request *model.CommonPageRequest) (*model.TenantMembersResponse, error)

GetTenantMembers 获取租户成员列表

func (*Client) GetUserDepartments

func (c *Client) GetUserDepartments(request model.GetUserDepartmentsRequest) (*model.PaginatedDepartments, error)

GetUserDepartments 获取用户所在部门

func (*Client) GetUserGroupList

func (c *Client) GetUserGroupList(userId string) (*model.PaginatedGroups, error)

func (*Client) GetUserGroups

func (c *Client) GetUserGroups(userId string) (*struct {
	TotalCount int                `json:"totalCount"`
	List       []model.GroupModel `json:"list"`
}, error)

GetUserGroups 获取用户分组列表

func (*Client) GetUserInfo added in v0.2.5

func (c *Client) GetUserInfo(request model.QueryUserInfoRequest) (*model.User, error)

Detail 获取用户详情

func (*Client) GetUserList

func (c *Client) GetUserList(request model.QueryListRequest) (*model.PaginatedUsers, error)

GetUserList 获取用户列表

func (*Client) GetUserRoleList

func (c *Client) GetUserRoleList(request model.GetUserRoleListRequest) (*model.PaginatedRoles, error)

func (*Client) GetUserRoles

func (c *Client) GetUserRoles(request model.GetUserRolesRequest) (*struct {
	TotalCount int               `json:"totalCount"`
	List       []model.RoleModel `json:"list"`
}, error)

GetUserRoles 获取用户角色列表

func (*Client) GetUserTenants

func (c *Client) GetUserTenants(userId string) (*model.GetUserTenantsResponse, error)

GetUserTenants 获取用户所在租户

func (*Client) GetUserUdfValue

func (c *Client) GetUserUdfValue(userId string) (*[]model.UserDefinedData, error)

GetUserUdfValue 获取某个用户的所有自定义数据

func (*Client) GetWhileList

func (c *Client) GetWhileList(whileListType model.EnumWhitelistType) (*[]model.WhiteList, error)

GetWhileList 获取白名单记录

func (*Client) ImportNodeByJSON

func (c *Client) ImportNodeByJSON(jsonStr string) (*string, error)

ImportNodeByJSON 通过 JSON 导入

func (*Client) IsAllowed

func (c *Client) IsAllowed(request model.IsAllowedRequest) (bool, error)

IsAllowed 判断某个用户是否对某个资源有某个操作权限

func (*Client) IsPasswordValid

func (c *Client) IsPasswordValid(password string) (*struct {
	Valid   bool   `json:"valid"`
	Message string `json:"message"`
}, error)

IsPasswordValid 检测密码是否合法

func (*Client) IsRootNode

func (c *Client) IsRootNode(orgId, nodeId string) (*bool, error)

IsRootNode 判断是否为根节点

func (*Client) KickUser

func (c *Client) KickUser(userIds []string) (*model.CommonMessageAndCode, error)

KickUser 强制一批用户下线

func (*Client) ListApplication

func (c *Client) ListApplication(req *model.CommonPageRequest) (*struct {
	List []model.Application `json:"list"`
}, error)

ListApplication 获取应用列表

func (*Client) ListApplicationActiveUsers

func (c *Client) ListApplicationActiveUsers(appId string, page, limit int) (*struct {
	List       []model.ApplicationActiveUsers `json:"list"`
	TotalCount int64                          `json:"totalCount"`
}, error)

ListApplicationActiveUsers 查看应用下已登录用户

func (*Client) ListApplicationAgreement

func (c *Client) ListApplicationAgreement(appId string) (*struct {
	List       []model.ApplicationAgreement `json:"list"`
	TotalCount int64                        `json:"totalCount"`
}, error)

ListApplicationAgreement 应用协议列表

func (*Client) ListArchivedUsers

func (c *Client) ListArchivedUsers(request model.CommonPageRequest) (*model.CommonPageUsersResponse, error)

ListArchivedUsers 获取已归档用户列表

func (*Client) ListAssignments

func (c *Client) ListAssignments(code string, page, limit int) (*model.PaginatedPolicyAssignments, error)

ListAssignments 获取策略授权记录

func (*Client) ListAuditLogs

func (c *Client) ListAuditLogs(req *model.ListAuditLogsRequest) (*struct {
	List       []interface{} `json:"list"`
	TotalCount int64         `json:"totalCount"`
}, error)

ListAuditLogs 审计日志列表查询

func (*Client) ListAuthorizedResources

func (c *Client) ListAuthorizedResources(request model.ListAuthorizedResourcesByIdRequest) (*model.User, error)

func (*Client) ListAuthorizedResourcesByNodeCode

func (c *Client) ListAuthorizedResourcesByNodeCode(req *model.ListAuthorizedResourcesByNodeCodeRequest) (*struct {
	TotalCount int64                      `json:"totalCount"`
	List       []model.AuthorizedResource `json:"list"`
}, error)

ListAuthorizedResourcesByNodeCode 获取组织机构节点被授权的所有资源

func (*Client) ListAuthorizedResourcesByNodeId

func (c *Client) ListAuthorizedResourcesByNodeId(req *model.ListAuthorizedResourcesByIdRequest) (*struct {
	TotalCount int64                      `json:"totalCount"`
	List       []model.AuthorizedResource `json:"list"`
}, error)

ListAuthorizedResourcesByNodeId 获取组织机构节点被授权的所有资源

func (*Client) ListAuthorizedResourcesForCustom

func (c *Client) ListAuthorizedResourcesForCustom(request model.ListAuthorizedResourcesRequest) (*struct {
	TotalCount int64                      `json:"totalCount"`
	List       []model.AuthorizedResource `json:"list"`
}, error)

ListAuthorizedResourcesForCustom 获取某个主体(用户、角色、分组、组织机构节点)被授权的所有资源。

func (*Client) ListExtIdp

func (c *Client) ListExtIdp(tenantId string) (*[]model.ListExtIdpResponse, error)

ListExtIdp 获取身份源列表

func (*Client) ListGroups

func (c *Client) ListGroups(page, limit int) (*struct {
	TotalCount int64              `json:"totalCount"`
	List       []model.GroupModel `json:"list"`
}, error)

ListGroups 获取分组列表

func (*Client) ListGroupsAuthorizedResources

func (c *Client) ListGroupsAuthorizedResources(req *model.ListGroupsAuthorizedResourcesRequest) (*struct {
	TotalCount int64                      `json:"totalCount"`
	List       []model.AuthorizedResource `json:"list"`
}, error)

ListGroupsAuthorizedResources 获取分组被授权的所有资源

func (*Client) ListGroupsUser

func (c *Client) ListGroupsUser(code string, page, limit int, withCustomData bool) (*struct {
	TotalCount int          `json:"totalCount"`
	List       []model.User `json:"list"`
}, error)

ListGroupsUser 获取分组用户列表

func (*Client) ListMembers

func (c *Client) ListMembers(req *model.ListMemberRequest) (*model.Node, error)

ListMembers 获取节点成员

func (*Client) ListNamespace

func (c *Client) ListNamespace(page, limit int) (*struct {
	List  []model.Namespace `json:"list"`
	Total int64             `json:"total"`
}, error)

ListNamespace 权限分组列表

func (*Client) ListNamespaceResources

func (c *Client) ListNamespaceResources(req model.ListResourceRequest) (*model.ListNamespaceResourceResponse, error)

ListNamespaceResources 获取资源列表

func (*Client) ListOrg

func (c *Client) ListOrg(page, limit int) (*model.PaginatedOrgs, error)

ListOrg 获取用户池组织机构列表

func (*Client) ListPolicy

func (c *Client) ListPolicy(page, limit int) (*model.PaginatedPolicies, error)

ListPolicy 获取策略列表

func (*Client) ListRoleAuthorizedResources

func (c *Client) ListRoleAuthorizedResources(code, namespace string, resourceType model.EnumResourceType) (*model.AuthorizedResources, error)

ListRoleAuthorizedResources 获取角色被授权的所有资源

func (*Client) ListRolePolicies

func (c *Client) ListRolePolicies(request model.ListPoliciesRequest) (*model.ListPoliciesResponse, error)

ListRolePolicies 获取角色策略列表

func (*Client) ListUdf

func (c *Client) ListUdf(targetType model.EnumUDFTargetType) (*[]model.UserDefinedField, error)

ListUdf 获取自定义字段定义

func (*Client) ListUdfValue

func (c *Client) ListUdfValue(targetType model.EnumUDFTargetType, targetId string) (*[]model.UserDefinedData, error)

ListUdfValue 获取某一实体的自定义字段数据列表

func (*Client) ListUserAction

func (c *Client) ListUserAction(req *model.ListUserActionRequest) (*struct {
	List       []interface{} `json:"list"`
	TotalCount int64         `json:"totalCount"`
}, error)

ListUserAction 查看用户操作日志

func (*Client) ListUserAuthorizedResources

func (c *Client) ListUserAuthorizedResources(request model.ListUserAuthResourceRequest) (*model.AuthorizedResources, error)

ListUserAuthorizedResources 获取用户被授权的所有资源

func (*Client) ListUserOrg

func (c *Client) ListUserOrg(userId string) (*[][]model.OrgModel, error)

ListUserOrg 获取用户所在组织机构

func (*Client) ListUserPolicies

func (c *Client) ListUserPolicies(request model.ListPoliciesOnIdRequest) (*model.ListPoliciesResponse, error)

ListUserPolicies 获取策略列表

func (*Client) ListUserPoolEnv

func (c *Client) ListUserPoolEnv() (*[]model.UserPoolEnv, error)

ListUserPoolEnv 获取环境变量列表

func (*Client) LogOut

func (c *Client) LogOut(userId string, appId *string) (*model.CommonMessageAndCode, error)

LogOut 用户退出

func (*Client) ModifyApplicationAgreement

func (c *Client) ModifyApplicationAgreement(appId, agreementId, title string, lang *string, required *bool) (*model.ApplicationAgreement, error)

ModifyApplicationAgreement 修改应用协议

func (*Client) MoveNodeMembers

func (c *Client) MoveNodeMembers(nodeId, targetNodeId string, userIds []string) (*model.CommonMessageAndCode, error)

MoveNodeMembers 移动节点成员

func (*Client) MoveOrgNode

func (c *Client) MoveOrgNode(orgId, nodeId, targetParentId string) (*model.AddNodeOrg, error)

MoveOrgNode 移动节点

func (*Client) PrincipalAuthDetail

func (c *Client) PrincipalAuthDetail(userId string) (*struct {
	Message string      `json:"message"`
	Code    int64       `json:"code"`
	Data    interface{} `json:"data"`
}, error)

PrincipalAuthDetail 获取主体认证详情

func (*Client) PrincipalAuthenticate

func (c *Client) PrincipalAuthenticate(userId string, req *model.PrincipalAuthenticateRequest) (*struct {
	Message string      `json:"message"`
	Code    int64       `json:"code"`
	Data    interface{} `json:"data"`
}, error)

PrincipalAuthenticate 进行主体认证

func (*Client) ProgrammaticAccessAccountList

func (c *Client) ProgrammaticAccessAccountList(appId string, page, limit int) (*struct {
	TotalCount int64                             `json:"totalCount"`
	List       []model.ProgrammaticAccessAccount `json:"list"`
}, error)

ProgrammaticAccessAccountList 编程访问账号列表

func (*Client) RefreshApplicationSecret

func (c *Client) RefreshApplicationSecret(appId string) (*model.Application, error)

RefreshApplicationSecret 刷新应用密钥

func (*Client) RefreshProgrammaticAccessAccountSecret

func (c *Client) RefreshProgrammaticAccessAccountSecret(programmaticAccessAccountId string, secret *string) (*model.ProgrammaticAccessAccount, error)

RefreshProgrammaticAccessAccountSecret 刷新编程访问账号密钥

func (*Client) RefreshUserToken

func (c *Client) RefreshUserToken(userId string) (*model.RefreshToken, error)

RefreshUserToken 刷新用户 token

func (*Client) RemoveAssignments

func (c *Client) RemoveAssignments(req *model.PolicyAssignmentsRequest) (*model.CommonMessageAndCode, error)

RemoveAssignments 撤销策略授权

func (*Client) RemoveGroupUsers

func (c *Client) RemoveGroupUsers(code string, userIds []string) (*model.CommonMessageAndCode, error)

RemoveGroupUsers 移除用户

func (*Client) RemoveRolePolicies

func (c *Client) RemoveRolePolicies(code string, policiesCode []string) (*model.CommonMessageAndCode, error)

RemoveRolePolicies 角色移除策略

func (*Client) RemoveRoleUdfValue

func (c *Client) RemoveRoleUdfValue(id, key string) (*[]model.UserDefinedData, error)

RemoveRoleUdfValue 删除用户的扩展字段

func (*Client) RemoveTenant

func (c *Client) RemoveTenant(tenantId string) (*string, error)

RemoveTenant 删除租户

func (*Client) RemoveTenantMembers

func (c *Client) RemoveTenantMembers(tenantId string, userId string) (*string, error)

RemoveTenantMembers 删除租户成员

func (*Client) RemoveUdf

func (c *Client) RemoveUdf(targetType model.EnumUDFTargetType, key string) (*model.CommonMessageAndCode, error)

RemoveUdf 删除自定义字段

func (*Client) RemoveUserInGroup

func (c *Client) RemoveUserInGroup(userId, groupCode string) (*model.CommonMessageAndCode, error)

RemoveUserInGroup 将用户退出分组

func (*Client) RemoveUserInRoles

func (c *Client) RemoveUserInRoles(request model.UserRoleOptRequest) (*model.CommonMessageAndCode, error)

RemoveUserInRoles 将用户从角色中移除

func (*Client) RemoveUserPolicies

func (c *Client) RemoveUserPolicies(userId string, policiesCode []string) (*model.CommonMessageAndCode, error)

RemoveUserPolicies 批量移除策略

func (*Client) RemoveUserPoolEnv

func (c *Client) RemoveUserPoolEnv(key string) (*model.CommonMessageAndCode, error)

RemoveUserPoolEnv 移除环境变量列表

func (*Client) RemoveUserUdfValue

func (c *Client) RemoveUserUdfValue(id, key string) (*[]model.UserDefinedData, error)

RemoveUserUdfValue 清除用户的自定义数据

func (*Client) RemoveWhileList

func (c *Client) RemoveWhileList(whileListType model.EnumWhitelistType, ids []string) (*[]model.WhiteList, error)

RemoveWhileList 移除白名单记录

func (*Client) ResignUser added in v0.2.6

func (c *Client) ResignUser(userId string) (*model.CommonMessageAndCode, error)

ResignUser 离职用户

func (*Client) RevokeResource

func (c *Client) RevokeResource(request model.RevokeResourceRequest) (bool, error)

RevokeResource 批量撤销资源的授权

func (*Client) RevokeRole

RevokeRole 角色 移除用户

func (*Client) RoleDetail

func (c *Client) RoleDetail(request model.RoleDetailRequest) (*model.Role, error)

RoleDetail 角色详情

func (*Client) SearchNodes

func (c *Client) SearchNodes(keywords string) (*[]model.OrgNodeChildStr, error)

SearchNodes 搜索组织机构节点

func (*Client) SearchUser

func (c *Client) SearchUser(request *model.SearchUserRequest) (*model.CommonPageUsersResponse, error)

SearchUser 搜索用户

func (*Client) SendEmail

func (c *Client) SendEmail(email string, scene model.EnumEmailScene) (*model.CommonMessageAndCode, error)

SendEmail 发送邮件

func (*Client) SendFirstLoginVerifyEmail

func (c *Client) SendFirstLoginVerifyEmail(userId, appId string) (*model.CommonMessageAndCode, error)

SendFirstLoginVerifyEmail 发送首次登录验证邮件

func (*Client) SendHttpRequest

func (c *Client) SendHttpRequest(url string, method string, query string, variables map[string]interface{}) ([]byte, error)

func (*Client) SendHttpRequestV2

func (c *Client) SendHttpRequestV2(url string, method string, query string, variables map[string]interface{}) ([]byte, error)

func (*Client) SendHttpRestRequest

func (c *Client) SendHttpRestRequest(url string, method string, variables map[string]interface{}) ([]byte, error)

func (*Client) SetMainDepartment

func (c *Client) SetMainDepartment(departmentId, userId string) (*model.CommonMessageAndCode, error)

SetMainDepartment 设置用户主部门

func (*Client) SetPublicKey added in v0.3.1

func (c *Client) SetPublicKey(publicKey string)

func (*Client) SetRoleUdfValue

func (c *Client) SetRoleUdfValue(id string, udv *model.KeyValuePair) (*[]model.UserDefinedData, error)

SetRoleUdfValue 设置某个角色扩展字段列表

func (*Client) SetUdf

func (c *Client) SetUdf(req *model.SetUdfInput) (*model.UserDefinedField, error)

SetUdf 设置自定义字段元数据

func (*Client) SetUdvBatch

func (c *Client) SetUdvBatch(id string, targetType model.EnumUDFTargetType, udv *[]model.KeyValuePair) (*[]model.UserDefinedData, error)

SetUdvBatch 批量添加自定义数据

func (*Client) SetUserUdfValue

func (c *Client) SetUserUdfValue(id string, udv *model.KeyValuePair) (*[]model.UserDefinedData, error)

SetUserUdfValue 设置某个用户的自定义数据

func (*Client) SortApplicationAgreement

func (c *Client) SortApplicationAgreement(appId string, ids []string) (*string, error)

SortApplicationAgreement 排序应用协议

func (*Client) SuspendUser added in v0.2.6

func (c *Client) SuspendUser(userId string) (*model.CommonMessageAndCode, error)

SuspendUser 停用账号

func (*Client) UpdateDefaultApplicationAccessPolicy

func (c *Client) UpdateDefaultApplicationAccessPolicy(appId string, strategy constant.ApplicationDefaultAccessPolicies) (*model.Application, error)

UpdateDefaultApplicationAccessPolicy 更改默认应用访问策略(默认拒绝所有用户访问应用、默认允许所有用户访问应用)

func (*Client) UpdateExtIdp

func (c *Client) UpdateExtIdp(extIdpId string, request *model.UpdateExtIdpRequest) (*string, error)

UpdateExtIdp 更新身份源

func (*Client) UpdateExtIdpConnection

func (c *Client) UpdateExtIdpConnection(extIdpConnectionId string, request *model.UpdateExtIdpConnectionRequest) (*string, error)

UpdateExtIdpConnection 更新身份源连接

func (*Client) UpdateGroups

func (c *Client) UpdateGroups(req *model.UpdateGroupsRequest) (*model.GroupModel, error)

UpdateGroups 修改分组

func (*Client) UpdateNamespace

func (c *Client) UpdateNamespace(id string, request *model.EditNamespaceRequest) (*model.Namespace, error)

UpdateNamespace 修改权限分组

func (*Client) UpdateOrgNode

func (c *Client) UpdateOrgNode(req *model.UpdateOrgNodeRequest) (*model.Node, error)

UpdateOrgNode 修改节点

func (*Client) UpdatePolicy

func (c *Client) UpdatePolicy(req *model.PolicyRequest) (*model.UpdatePolicyResponse, error)

UpdatePolicy 修改策略

func (*Client) UpdateResource

func (c *Client) UpdateResource(code string, req *model.UpdateResourceRequest) (*model.ResourceResponse, error)

UpdateResource 更新资源

func (*Client) UpdateRole

func (c *Client) UpdateRole(request model.UpdateRoleRequest) (*model.Role, error)

UpdateRole 更新角色

func (*Client) UpdateTenant

func (c *Client) UpdateTenant(tenantId string, request *model.CreateTenantRequest) (bool, error)

UpdateTenant 修改租户

func (*Client) UpdateUser

func (c *Client) UpdateUser(id string, updateInfo model.UpdateUserInput) (*model.User, error)

UpdateUser 修改用户资料

func (*Client) UpdateUserPool

func (c *Client) UpdateUserPool(request model.UpdateUserpoolInput) (*model.UserPool, error)

UpdateUserPool 更新用户池配置

func (*Client) UserHasRole

func (c *Client) UserHasRole(userId, roleCode, namespace string) (bool, error)

UserHasRole 判断用户是否有某个角色

func (*Client) UserPoolDetail

func (c *Client) UserPoolDetail() (*model.UserPool, error)

UserPoolDetail 查询用户池配置

Jump to

Keyboard shortcuts

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