全部产品

授权应用

更新时间:2020-04-21 11:33:47

本文列出了授权应用相关的所有 API 及其请求参数、返回参数。

创建授权应用

sofa.apigateway.authapp.create 用于创建一个授权应用。

请求参数

名称 类型 是否必填 示例 描述
param AuthAppInfoVO - param
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data AuthAppInfoVO - data

代码示例

请求示例

  1. {
  2. "param": {
  3. "auth_app_type": "INNER",
  4. "sub_app_id": "qcbA92upcnVlaYiF",
  5. "authentication_type": "SECRET",
  6. "encrypt_type": "NONE",
  7. "sub_workspace_id": "antdemo",
  8. "sub_tenant_id": "JADDGOCN",
  9. },
  10. "tenant_id": "JADDGOCN",
  11. "workspace_id": "antdemo"
  12. }

返回示例

  1. {
  2. "data": {
  3. "auth_app_type": "OUTER",
  4. "encrypt_type": "NONE",
  5. "app_type": "STANDARD",
  6. "sub_app_id": "qcbA92upcnVlaYiF",
  7. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  8. "sub_app_info": {
  9. "tenant_id": "JADDGOCN",
  10. "gmt_create": "2020-03-27 10:47:01",
  11. "workspace_id": "antdemo",
  12. "app_name": "app6",
  13. "gmt_modified": "2020-03-27 10:47:01",
  14. "app_id": "qcbA92upcnVlaYiF",
  15. "operator": ""
  16. },
  17. "sub_tenant_id": "JADDGOCN",
  18. "authentication_type": "SECRET",
  19. "sub_workspace_id": "antdemo",
  20. "operator": ""
  21. },
  22. "result_code": "OK"
  23. }

删除授权应用

sofa.apigateway.authapp.delete 用于删除一个授权应用。

请求参数

名称 类型 是否必填 示例 描述
auth_app_info_id STRING 8Amfi67dmE9wpY46 授权应用信息标识
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data BOOLEAN true, false data

代码示例

请求示例

  1. {
  2. "auth_app_info_id": "OzygEdYzwFLRruxg",
  3. "tenant_id": "JADDGOCN",
  4. "workspace_id": "antdemo"
  5. }

返回示例

  1. {
  2. "data": true,
  3. "result_code": "OK"
  4. }

更新授权应用

sofa.apigateway.authapp.update 用于更新一个授权应用信息。

请求参数

名称 类型 是否必填 示例 描述
auth_app_info_id STRING 8Amfi67dmE9wpY46 授权应用信息标识
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data AuthAppInfoVO - data

代码示例

请求示例

  1. {
  2. "param": {
  3. "auth_app_type": "OUTER",
  4. "sub_app_id": "qcbA92upcnVlaYiF",
  5. "authentication_type": "SECRET",
  6. "encrypt_type": "ECC",
  7. "sub_workspace_id": "antdemo",
  8. "sub_tenant_id": "JADDGOCN",
  9. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  10. },
  11. "tenant_id": "JADDGOCN",
  12. "workspace_id": "antdemo"
  13. }

返回示例

  1. {
  2. "data": true,
  3. "result_code": "OK"
  4. }

通过 ID 查询授权应用

sofa.apigateway.authapp.get 用于查询指定授权应用 ID 的授权对象信息。

请求参数

名称 类型 是否必填 示例 描述
auth_app_info_id STRING 8Amfi67dmE9wpY46 授权应用信息标识
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data AuthAppInfoVO - data

代码示例

请求示例

  1. {
  2. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  3. "tenant_id": "JADDGOCN",
  4. "workspace_id": "antdemo"
  5. }

返回示例

  1. {
  2. "data": {
  3. "gmt_create": "2020-03-27 15:33:18",
  4. "auth_app_type": "OUTER",
  5. "encrypt_type": "ECC",
  6. "app_type": "STANDARD",
  7. "sub_app_id": "qcbA92upcnVlaYiF",
  8. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  9. "sub_app_info": {
  10. "tenant_id": "JADDGOCN",
  11. "gmt_create": "2020-03-27 10:47:01",
  12. "workspace_id": "antdemo",
  13. "app_name": "app6",
  14. "gmt_modified": "2020-03-27 10:47:01",
  15. "app_id": "qcbA92upcnVlaYiF",
  16. "operator": ""
  17. },
  18. "sub_tenant_id": "JADDGOCN",
  19. "gmt_modified": "2020-03-27 15:39:29",
  20. "authentication_type": "SECRET",
  21. "sub_workspace_id": "antdemo",
  22. "operator": ""
  23. },
  24. "result_code": "OK"
  25. }

查询授权应用分页列表

sofa.apigateway.authapp.list 用于查询授权应用的分页列表。

请求参数

名称 类型 是否必填 示例 描述
param AuthAppInfoQueryVO - param
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间 标识

返回参数

名称 类型 示例 描述
data AuthAppInfoPagedListVO - data

代码示例

请求示例

  1. {
  2. "param": {
  3. "page_info": {
  4. "page_index": 1,
  5. "page_size": 10
  6. },
  7. "query": {}
  8. },
  9. "tenant_id": "JADDGOCN",
  10. "workspace_id": "antdemo"
  11. }

返回示例

  1. {
  2. "data": {
  3. "page_info": {
  4. "total": 4,
  5. "page_index": 1,
  6. "page_size": 10
  7. },
  8. "list": [
  9. {
  10. "subTenantId": "JADDGOCN",
  11. "gmtModified": "2020-03-27 15:39:29",
  12. "appType": "STANDARD",
  13. "subAppInfo": {
  14. "gmtModified": "2020-03-27 10:47:01",
  15. "appName": "app6",
  16. "appId": "qcbA92upcnVlaYiF",
  17. "tenantId": "JADDGOCN",
  18. "gmtCreate": "2020-03-27 10:47:01",
  19. "operator": "",
  20. "workspaceId": "antdemo"
  21. },
  22. "authAppInfoId": "MQr68JtMFFFzLJe0",
  23. "authAppType": "OUTER",
  24. "authenticationType": "SECRET",
  25. "gmtCreate": "2020-03-27 15:33:18",
  26. "subWorkspaceId": "antdemo",
  27. "encryptType": "ECC",
  28. "operator": "",
  29. "subAppId": "qcbA92upcnVlaYiF"
  30. },
  31. {
  32. "subTenantId": "JADDGOCN",
  33. "gmtModified": "2020-03-25 16:40:11",
  34. "appType": "STANDARD",
  35. "subAppInfo": {
  36. "gmtModified": "2020-03-25 16:39:51",
  37. "appName": "app2",
  38. "appId": "zQf1Pk34kku03wxP",
  39. "tenantId": "JADDGOCN",
  40. "gmtCreate": "2020-03-25 16:39:51",
  41. "operator": "",
  42. "workspaceId": "antdemo"
  43. },
  44. "authAppInfoId": "oxLIMO8MKn7x6nxy",
  45. "authAppType": "OUTER",
  46. "authenticationType": "SECRET",
  47. "gmtCreate": "2020-03-25 16:40:11",
  48. "subWorkspaceId": "antdemo",
  49. "encryptType": "NONE",
  50. "operator": "",
  51. "subAppId": "zQf1Pk34kku03wxP"
  52. }
  53. ]
  54. },
  55. "result_code": "OK"
  56. }

查询授权应用列表

sofa.apigateway.authapp.all 用于查询授权应用的所有列表。

请求参数

名称 类型 是否必填 示例 描述
param AuthAppInfoQueryVO - param
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data ARRAY[AuthAppInfoVO] - data

代码示例

请求示例

  1. {
  2. "param": {
  3. "page_info": {
  4. "page_index": 1,
  5. "page_size": 10
  6. },
  7. "query": {}
  8. },
  9. "tenant_id": "JADDGOCN",
  10. "workspace_id": "antdemo"
  11. }

返回示例

  1. {
  2. "data": {
  3. "page_info": {
  4. "total": 2,
  5. "page_index": 1,
  6. "page_size": 10
  7. },
  8. "list": [
  9. {
  10. "subTenantId": "JADDGOCN",
  11. "gmtModified": "2020-03-27 15:39:29",
  12. "appType": "STANDARD",
  13. "subAppInfo": {
  14. "gmtModified": "2020-03-27 10:47:01",
  15. "appName": "app6",
  16. "appId": "qcbA92upcnVlaYiF",
  17. "tenantId": "JADDGOCN",
  18. "gmtCreate": "2020-03-27 10:47:01",
  19. "operator": "",
  20. "workspaceId": "antdemo"
  21. },
  22. "authAppInfoId": "MQr68JtMFFFzLJe0",
  23. "authAppType": "OUTER",
  24. "authenticationType": "SECRET",
  25. "gmtCreate": "2020-03-27 15:33:18",
  26. "subWorkspaceId": "antdemo",
  27. "encryptType": "ECC",
  28. "operator": "",
  29. "subAppId": "qcbA92upcnVlaYiF"
  30. },
  31. {
  32. "subTenantId": "JADDGOCN",
  33. "gmtModified": "2020-03-25 16:40:11",
  34. "appType": "STANDARD",
  35. "subAppInfo": {
  36. "gmtModified": "2020-03-25 16:39:51",
  37. "appName": "app2",
  38. "appId": "zQf1Pk34kku03wxP",
  39. "tenantId": "JADDGOCN",
  40. "gmtCreate": "2020-03-25 16:39:51",
  41. "operator": "",
  42. "workspaceId": "antdemo"
  43. },
  44. "authAppInfoId": "oxLIMO8MKn7x6nxy",
  45. "authAppType": "OUTER",
  46. "authenticationType": "SECRET",
  47. "gmtCreate": "2020-03-25 16:40:11",
  48. "subWorkspaceId": "antdemo",
  49. "encryptType": "NONE",
  50. "operator": "",
  51. "subAppId": "zQf1Pk34kku03wxP"
  52. }
  53. ]
  54. },
  55. "result_code": "OK"
  56. }

通过授权应用 ID 查询 API 分页列表

sofa.apigateway.authapp.api.list 用于查询指定授权应用下的获得授权的 API 分页列表。

请求参数

名称 类型 是否必填 示例 描述
auth_app_info_id STRING 8Amfi67dmE9wpY46 授权 API 标识
param ApiInfoQueryVO - param
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data ApiInfoPagedListVO data

代码示例

请求示例

  1. {
  2. "param": {
  3. "page_info": {
  4. "page_index": 1,
  5. "page_size": 10
  6. },
  7. "query": {}
  8. },
  9. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  10. "tenant_id": "JADDGOCN",
  11. "workspace_id": "antdemo"
  12. }

返回示例

  1. {
  2. "data": {
  3. "page_info": {
  4. "total": 1,
  5. "page_index": 1,
  6. "page_size": 10
  7. },
  8. "list": [
  9. {
  10. "charset": "UTF-8",
  11. "apiName": "api-test2",
  12. "gmtModified": "2020-03-27 15:51:48",
  13. "sysId": "A3QV9pym9CaVKdLV0gIcQMsGNIplTZwd",
  14. "routerType": "PATH",
  15. "upstreamProtocol": "HTTP",
  16. "timeout": 3000,
  17. "operator": "",
  18. "path": "/openapi/apigateway/test/api1",
  19. "apiGroupId": "fifhwqgcsmqo9ycl",
  20. "appType": "STANDARD",
  21. "contentType": "application/json",
  22. "apiId": "IjiuBaYgvZLz2ODOvRWiQT3OGCqSbDYu",
  23. "workspaceId": "antdemo",
  24. "method": "GET",
  25. "authAppCount": 1,
  26. "upstreamPath": "/openapi/apigateway/test/api1",
  27. "gmtCreate": "2020-03-27 14:12:43",
  28. "onlineVersion": {
  29. "versionId": "3VdYOmSsKAD07DuvX6EHvsnheXONfF80",
  30. "gmtModified": "2020-03-27 14:58:34",
  31. "versionNo": "20200327141243487-B0XAffhP",
  32. "gmtOnline": "2020-03-27 14:58:34",
  33. "gmtCreate": "2020-03-27 14:12:43",
  34. "gmtEdit": "2020-03-27 14:17:30",
  35. "apiId": "IjiuBaYgvZLz2ODOvRWiQT3OGCqSbDYu"
  36. },
  37. "downstreamProtocol": "HTTP",
  38. "domainName": "fifhwqgcsmqo9ycl.apigateway.inc.alipay.net",
  39. "apiGroupName": "apigroup2",
  40. "tenantId": "JADDGOCN",
  41. "upstreamType": "SYSTEM_CLUSTER",
  42. "apiStatus": "OPENED"
  43. }
  44. ]
  45. },
  46. "result_code": "OK"
  47. }

通过授权应用 ID 查询 API 列表

sofa.apigateway.authapp.api.all 用于查询指定授权应用下的所有获得授权的 API 列表。

请求参数

名称 类型 是否必填 示例 描述
auth_app_info_id STRING 8Amfi67dmE9wpY46 授权应用标识
param ApiInfoQueryVO - param
tenant_id STRING TSCPDICNT 租户标识
workspace_id STRING default 工作空间标识

返回参数

名称 类型 示例 描述
data ARRAY[ApiInfoVO] - data

代码示例

请求示例

  1. {
  2. "param": {
  3. "page_info": {
  4. "page_index": 1,
  5. "page_size": 10
  6. },
  7. "query": {}
  8. },
  9. "auth_app_info_id": "MQr68JtMFFFzLJe0",
  10. "tenant_id": "JADDGOCN",
  11. "workspace_id": "antdemo"
  12. }

返回示例

  1. {
  2. "data": {
  3. "page_info": {
  4. "total": 1,
  5. "page_index": 1,
  6. "page_size": 10
  7. },
  8. "list": [
  9. {
  10. "charset": "UTF-8",
  11. "apiName": "api-test2",
  12. "gmtModified": "2020-03-27 15:51:48",
  13. "sysId": "A3QV9pym9CaVKdLV0gIcQMsGNIplTZwd",
  14. "routerType": "PATH",
  15. "upstreamProtocol": "HTTP",
  16. "timeout": 3000,
  17. "operator": "",
  18. "path": "/openapi/apigateway/test/api1",
  19. "apiGroupId": "fifhwqgcsmqo9ycl",
  20. "appType": "STANDARD",
  21. "contentType": "application/json",
  22. "apiId": "IjiuBaYgvZLz2ODOvRWiQT3OGCqSbDYu",
  23. "workspaceId": "antdemo",
  24. "method": "GET",
  25. "authAppCount": 1,
  26. "upstreamPath": "/openapi/apigateway/test/api1",
  27. "gmtCreate": "2020-03-27 14:12:43",
  28. "onlineVersion": {
  29. "versionId": "3VdYOmSsKAD07DuvX6EHvsnheXONfF80",
  30. "gmtModified": "2020-03-27 14:58:34",
  31. "versionNo": "20200327141243487-B0XAffhP",
  32. "gmtOnline": "2020-03-27 14:58:34",
  33. "gmtCreate": "2020-03-27 14:12:43",
  34. "gmtEdit": "2020-03-27 14:17:30",
  35. "apiId": "IjiuBaYgvZLz2ODOvRWiQT3OGCqSbDYu"
  36. },
  37. "downstreamProtocol": "HTTP",
  38. "domainName": "fifhwqgcsmqo9ycl.apigateway.inc.alipay.net",
  39. "apiGroupName": "apigroup2",
  40. "tenantId": "JADDGOCN",
  41. "upstreamType": "SYSTEM_CLUSTER",
  42. "apiStatus": "OPENED"
  43. }
  44. ]
  45. },
  46. "result_code": "OK"
  47. }