diff --git a/src/main/java/cn/authing/sdk/java/client/ManagementClient.java b/src/main/java/cn/authing/sdk/java/client/ManagementClient.java index f780f460..dc3b9427 100644 --- a/src/main/java/cn/authing/sdk/java/client/ManagementClient.java +++ b/src/main/java/cn/authing/sdk/java/client/ManagementClient.java @@ -2111,6 +2111,74 @@ public CheckDomainAvailableSecretRespDto checkDomainAvailable(CheckDomainAvailab return deserialize(response, CheckDomainAvailableSecretRespDto.class); } + /** + * @summary 获取租户应用列表 + * @description 获取应用列表,可以指定 租户 ID 筛选。 + **/ + public TenantApplicationListPaginatedRespDto listTenantApplications( + ListTenantApplicationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-applications"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantApplicationListPaginatedRespDto.class); + } + + + /** + * @summary 更新应用登录页配置 + * @description 通过应用 ID 更新登录页配置。 + **/ + public IsSuccessRespDto updateLoginPageConfig(UpdateLoginConfigDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-login-page-config"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户池租户配置信息 + * @description 根据用户池 ID 获取用户池多租户配置信息 + **/ + public UserPoolTenantConfigDtoRespDto userpollTenantConfig() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/userpool-tenant-config"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPoolTenantConfigDtoRespDto.class); + } + + /** + * @summary 更新用户池租户配置信息 + * @description 更新用户池多租户配置内登录信息 + **/ + public IsSuccessRespDto updateUserPoolTenantConfig(UpdateUserPoolTenantLoginConfigDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-userpool-tenant-config"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 设置用户池多租户身份源连接 + * @description 设置用户池多租户身份源连接,支持同时设置多个身份源连接,支持设置连接和取消连接 + **/ + public IsSuccessRespDto changeUserpoolTenanExtIdpConnState( + ChangeUserPoolTenantExtIdpConnDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-userpool-tenant-ext-idp-conn-state"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + /** * @summary 创建 ASA 账号 * @description 在某一应用下创建 ASA 账号 @@ -2780,7 +2848,7 @@ public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { /** * @summary 获取用户权限列表 - * @description 该接口用于用户列表权限查询,可以通过用户 ID 列表进行批量查询权限,也可以通过查询多个用户在同一个权限空间的权限。 + * @description 该接口用于用户列表权限查询,可以通过用户 ID 列表进行批量查询权限,也可以通过查询多个用户在同一个权限空间的权限,不同数据资源类型返回相应的资源结果。 *

* ### 查询一个用户拥有的数组资源、字符串资源和树资源权限列表示例 *

@@ -2792,16 +2860,17 @@ public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { *

* ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace", "resourceList": [ { "resourceCode": "strCode", "authorize": { - * "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } }, { "resourceCode": - * "arrayCode", "authorize": { "values": [ "示例数据资源" ], "actions": [ "read", "post", "get", - * "write" ] } }, { "resourceCode": "treeCode", "authorize": { "authList": [ { "nodePath": - * "treeCode/treeChildrenCode1", "nodeActions": [ "read", "get" ], "nodeName": + * "examplePermissionNamespace", "resourceList": [ { "resourceCode": "strCode", "resourceType": + * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] + * } }, { "resourceCode": "arrayCode", "resourceType": "ARRAY", "arrAuthorize": { "values": [ + * "示例数据资源1", "示例数据资源2" ], "actions": [ "read", "post", "get", "write" ] } }, { "resourceCode": + * "treeCode", "resourceType": "TREE", "treeAuthorize": { "authList": [ { "nodePath": + * "/treeChildrenCode/treeChildrenCode1", "nodeActions": [ "read", "get" ], "nodeName": * "treeChildrenName1", "nodeValue": "treeChildrenValue1" }, { "nodePath": - * "treeCode/treeChildrenCode2", "nodeActions": [ "read", "get" ], "nodeName": + * "/treeChildrenCode/treeChildrenCode2", "nodeActions": [ "read", "get" ], "nodeName": * "treeChildrenName2", "nodeValue": "treeChildrenValue2" }, { "nodePath": - * "treeCode/treeChildrenCode3", "nodeActions": [ "read" ], "nodeName": "treeChildrenName3", - * "nodeValue": "treeChildrenValue3" } ] } } ] } ] } } ``` + * "/treeChildrenCode/treeChildrenCode3", "nodeActions": [ "read" ], "nodeName": + * "treeChildrenName3", "nodeValue": "treeChildrenValue3" } ] } } ] } ] } } ``` *

* ### 查询多个用户权限列表示例 *

@@ -2813,11 +2882,12 @@ public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { *

* ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode1", "authorize": { - * "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } } ] }, { "userId": - * "6121ceaxxxxxxxxxxx27312", "namespaceCode": "examplePermissionNamespace2", "resourceList": [ - * { "resourceCode": "arrayCode", "authorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": - * [ "read", "post", "get", "write" ] } } ] } ] } } ``` + * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode", "resourceType": + * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] + * } } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": + * "examplePermissionNamespace2", "resourceList": [ { "resourceCode": "arrayCode", + * "resourceType": "ARRAY", "arrAuthorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ + * "read", "post", "get", "write" ] } } ] } ] } } ``` *

* ### 查询多个用户在多个权限空间下权限列表示例 *

@@ -2830,11 +2900,12 @@ public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { *

* ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode1", "authorize": { - * "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } } ] }, { "userId": - * "6121ceaxxxxxxxxxxx27312", "namespaceCode": "examplePermissionNamespace2", "resourceList": [ - * { "resourceCode": "arrayCode", "authorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": - * [ "read", "post", "get", "write" ] } } ] } ] } } ``` + * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode1", + * "resourceType": "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", + * "get", "write" ] } } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": + * "examplePermissionNamespace2", "resourceList": [ { "resourceCode": "arrayCode", + * "resourceType": "ARRAY", "arrAuthorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ + * "read", "post", "get", "write" ] } } ] } ] } } ``` **/ public GetUserPermissionListRespDto getUserPermissionList(GetUserPermissionListDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); @@ -2976,8 +3047,8 @@ public GetUserResourcePermissionListRespDto getUserResourcePermissionList( *

* - 入参 *

- * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", "read"] - * "resources":["strResourceCode1", "arrayResourceCode1"] } ``` + * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", + * "read"], "resources":["strResourceCode1", "arrayResourceCode1"] } ``` *

* - 出参 *

@@ -2994,7 +3065,7 @@ public GetUserResourcePermissionListRespDto getUserResourcePermissionList( * - 入参 *

* ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", - * "delete"] "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", + * "delete"], "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` *

* - 出参 @@ -3019,23 +3090,53 @@ public ListResourceTargetsRespDto listResourceTargets(ListResourceTargetsDto req /** * @summary 获取用户授权资源的结构列表 - * @description 该接口主要用于获取用户授权的资源列表,通过权限空间 Code、用户 id、资源 Code 获取用户资源的授权列表。 + * @description 该接口主要用于获取用户授权的资源列表,通过权限空间 Code、用户 Id、资源 Code 获取用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 + *

+ * ### 获取用户授权字符串数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleStrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", + * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` + *

*

- * ### 示例 + * ### 获取用户授权数据数组资源示例 *

* - 入参 *

* ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleResourceCode" } ``` + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` *

* - 出参 *

* ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleResourceCode", "permissionBo": { - * "resourceId": "63xxxxxxxxxxxxx999", "resourceType": "TREE", "nodeAuthActionList": [ { "name": - * "1", "code": "1", "children": [ { "name": "1-1", "code": "1-1", "children": [], "actions": [ - * "read", "get" ] } ], "actions": [ "read" ] }, { "name": "2", "code": "2", "children": [ { - * "name": "2-1", "code": "2-1", "actions": [ "read" ] } ], "actions": [ "get" ] } ] } } } ``` + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", + * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], + * "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权树数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", + * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", + * "value": "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", + * "name": "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": + * "tree22", "name": "tree22", "value": "test22Value", "actions": ["get","delete"], }] } } } + * ``` **/ public GetUserResourceStructRespDto getUserResourceStruct(GetUserResourceStructDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); @@ -3048,23 +3149,54 @@ public GetUserResourceStructRespDto getUserResourceStruct(GetUserResourceStructD /** * @summary 获取外部用户授权资源的结构列表 - * @description 该接口主要用于获取外部用户授权的资源列表,通过权限空间 Code、外部用户 id、资源 Code 获取外部用户资源的授权列表。 + * @description 该接口主要用于获取外部用户授权的资源列表,通过权限空间 Code、外部用户 Id、资源 Code 获取外部用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 + *

+ *

+ * ### 获取用户授权字符串数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleStrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", + * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` *

- * ### 示例 + *

+ * ### 获取用户授权数据数组资源示例 *

* - 入参 *

* ```json { "namespaceCode": "examplePermissionNamespace", "externalId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleResourceCode" } ``` + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` *

* - 出参 *

* ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleResourceCode", "permissionBo": { - * "resourceId": "63xxxxxxxxxxxxx999", "resourceType": "TREE", "nodeAuthActionList": [ { "name": - * "1", "code": "1", "children": [ { "name": "1-1", "code": "1-1", "children": [], "actions": [ - * "read", "get" ] } ], "actions": [ "read" ] }, { "name": "2", "code": "2", "children": [ { - * "name": "2-1", "code": "2-1", "actions": [ "read" ] } ], "actions": [ "get" ] } ] } } } ``` + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", + * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], + * "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权树数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", + * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", + * "value": "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", + * "name": "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": + * "tree22", "name": "tree22", "value": "test22Value", "actions": ["get","delete"], }] } } } + * ``` **/ public GetExternalUserResourceStructRespDto getExternalUserResourceStruct( GetExternalUserResourceStructDto reqDto) { @@ -3077,33 +3209,25 @@ public GetExternalUserResourceStructRespDto getExternalUserResourceStruct( } /** - * @summary 判断用户在同层级资源下的权限 - * @description 该接口主要用于判断用户在同层级资源下的权限,通过权限空间 Code 、用户 ID、资源操作、资源或资源子节点查询用户是否有该同级资源的权限。可选传条件属性参数,默认不开启条件判断。 + * @summary 判断用户在树资源同层级下的权限 + * @description 该接口主要用于判断用户在树资源同层级下的权限,通过权限空间 Code 、用户 ID、资源操作、资源或资源子节点查询用户是否有该树资源同级路径的权限。可选传条件属性参数,默认不开启条件判断。 + *

*

- * ### 判断用户在同层级字符串资源权限示例(无条件判断) + * ### 判断用户在树资源同层级权限示例(无条件判断) *

* ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "strResourceCode1" } ``` + * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "treeResourceCode/structCode", + * "resourceNodeCodes": ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"] + * } ``` *

- * ### 判断用户在同层级字符串资源权限示例(开启条件判断) + * ### 判断用户在树资源同层级权限示例(开启条件判断) *

* ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "strResourceCode1", + * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "treeResourceCode/structCode", + * "resourceNodeCodes": ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"], * "judgeConditionEnabled": true, "authEnvParams":{ "ip":"110.96.0.0", "city":"北京", * "province":"北京", "country":"中国", "deviceType":"PC", "systemType":"ios", "browserType":"IE", * "requestDate":"2022-12-26 17:40:00" } } ``` - *

- * ### 判断用户在同层级数组资源权限示例 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "arrayResourceCode1" } ``` - *

- * ### 判断用户在同层级树资源权限示例 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "treeResourceCode1/structCode1", - * "resourceNodeCodes": ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"] - * } ``` **/ public CheckUserSameLevelPermissionResponseDto checkUserSameLevelPermission( CheckUserSameLevelPermissionDto reqDto) { @@ -3430,8 +3554,8 @@ public ListAccessKeyResponseDto getAccessKeyList(ListAccessKeyDto reqDto) { } /** - * @summary 获取协作管理员 AK/Sk 详细信息 - * @description 获取协作管理员 AK/Sk 详细信息,根据协作管理员 ID 和 accessKeyId 获取对应 AK/SK 的详细信息。 + * @summary 获取协作管理员 AK/SK 详细信息 + * @description 获取协作管理员 AK/SK 详细信息,根据协作管理员 ID 和 accessKeyId 获取对应 AK/SK 的详细信息。 **/ public GetAccessKeyResponseDto getAccessKey(GetAccessKeyDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); @@ -3467,4 +3591,19 @@ public CommonResponseDto deleteAccessKey(DeleteAccessKeyDto reqDto) { String response = request(config); return deserialize(response, CommonResponseDto.class); } + + /** + * @summary 更新一个管理员 AccessKey + * @description 根据 AccessKeyId 更新一个管理员 AccessKey,目前只支持更新 status,status 支持 activated / revoked + **/ + public IsSuccessRespDto updateAccessKey(UpdateAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-access-key"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + } \ No newline at end of file