Apigee Spaces 中的身分與存取權管理權限階層

本頁適用於 ApigeeApigee Hybrid

查看 Apigee Edge 說明文件。

本頁說明如何在使用 Apigee Spaces 時,將身分與存取權管理 (IAM) 權限階層套用至 Apigee API 資源 (API 代理程式、共用流程和 API 產品) 及其子項。

IAM 與 Apigee Spaces 的互動

一般來說,管理資源存取權的 IAM 政策會透過 Google Cloud 資源階層繼承。套用至特定資源的特定 IAM 政策包含下列兩者:

  • 直接套用至資源的任何政策
  • 資源從祖系繼承的任何政策

Apigee 中的資源和權限階層結構

在 Apigee 中,資源階層的最上層是「機構」資源。機構的子資源包括 API Proxy共用流程API 產品。在未使用工作區的情況下使用 Apigee 時,權限會套用至 Google Cloud 專案,而該專案會直接與 Apigee 機構資源建立關聯。因此,除了直接套用至特定資源的任何政策外,管理特定 API Proxy、共用流程或 API 產品存取權的 IAM 政策,還包括從機構繼承的任何政策。

聊天室的資源和權限階層

當您將 Apigee 與聊天室搭配使用時,系統會將聊天室資源加入階層。請考慮以下情境:Apigee 機構有三個 API Proxy,分別是 proxy-aproxy-bproxy-c。在本範例中,proxy-bproxy-c 分別與 space-redspace-blue 建立關聯。將 API 資源與聊天室建立關聯時,系統會在資源上設定 space 屬性。

當您發出 API 呼叫以取得 proxy-c 的詳細資料時,API 端點會反映實際的資源階層,其中 API 代理程式是組織的子項,並具有「空間」屬性,如以下範例所示:

curl -X GET -H "Authorization: Bearer $TOKEN" "https://apigee.googleapis.com/v1/organizations/org1/apis/proxy-c"
{
  "metaData": {
    "createdAt": "1725665197737",
    "lastModifiedAt": "1725665462105",
    "subType": "Proxy"
  },
  "name": "proxy-c",
  "revision": [
    "1"
  ],
  "apiProxyType": "PROGRAMMABLE",
  "space": "space-blue"
}

雖然與工作區相關聯的 API 資源路徑保持不變,但有效的 IAM 權限階層會有所變更。在這個範例情境中,IAM 權限檢查會假設 API 資源是工作區的子項。因此,除了直接套用至工作區的任何政策外,套用至 API 資源的 IAM 政策還包括從工作區繼承的政策,如下圖所示:

聊天室的 IAM 階層
圖 1:使用 Spaces 時,API 資源的有效 IAM 權限階層

檢查 Space 資源的 IAM 政策

如前文所述,當 API Proxy、共用流程和 API 產品與工作區建立關聯時,在 IAM 政策檢查期間,這些資源會視為工作區的子項資源。這個有效資源階層適用於 API Proxy、共用流程和 API 產品的所有子項。

舉例來說,API 產品屬性是 API 產品的子項資源。如要列出與 Apigee 空間 space-blue 相關聯的 Apigee 機構 org1 中 API 產品 product-a 的所有屬性,實際資源路徑為 GET organizations/org1/apiproduct/product-a/attributes。不過,檢查 IAM 權限的路徑是 organizations/org1/spaces/space-blue/apiproduct/product-a/attributes

檢查部署作業的 IAM 政策

環境資源未與聊天室建立關聯。不過,我們已更新部分現有 API,讓您可以精細控管 API Proxy 和共用流程的部署和偵錯工作階段。

以下說明對 Space 中資源執行下列部署作業時,IAM 權限檢查的變更:

方法 空間身分與存取權管理權限檢查
organizations.deployments.list 無變更
organizations.apis.deployments.list apigee.deployments.list organizations/$ORG/spaces/$SPACE/apis/$API
organizations.apis.revisions.deployments.list organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.deployments.list
organizations.environments.deployments.list 無變更
organizations.environments.deployments.get 無變更
organizations.environments.apis.deployments.list organizations/$ORG/environments/$ENV
上的 apigee.deployments.list「或」

organizations/$ORG/spaces/$SPACE/apis/$API

organizations.environments.apis.revisions.deployments.get organizations/$ORG/environments/$ENV 上的 apigee.deployments.get

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.deployments.get

organizations.environments.apis.revisions.deployments.deploy organizations/$ORG/environments/$ENV 上執行 apigee.deployments.create

AND

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.proxyrevisions.deploy

organizations.environments.apis.revisions.deployments.generateDeployChangeReport organizations/$ORG/environments/$ENV 上執行 apigee.deployments.create

AND

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.proxyrevisions.deploy

organizations.environments.apis.revisions.deployments.generateUndeployChangeReport organizations/$ORG/environments/$ENV 上的 apigee.deployments.delete

AND

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.proxyrevisions.undeploy

organizations.environments.apis.revisions.deployments.undeploy organizations/$ORG/environments/$ENV 上的 apigee.deployments.delete

AND

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.proxyrevisions.undeploy

organizations.environments.sharedflows.deployments.list organizations/$ORG/environments/$ENV 上的 apigee.deployments.list
OR
上的 apigee.deployments.list organizations/$ORG/spaces/$SPACE/sharedflows/$SF
organizations.environments.sharedflows.revisions.deployments.deploy organizations/$ORG/environments/$ENV 上執行 apigee.deployments.create

AND

organizations/$ORG/spaces/$SPACE/sharedflow/$SF/revisions/$REV 上的 apigee.sharedflowrevisions.deploy

organizations.environments.sharedflows.revisions.deployments.get organizations/$ORG/environments/$ENV 上的 apigee.deployments.get

OR

apigee.deployments.get

organizations/$ORG/spaces/$SPACE/sharedflows/$SF/revisions/$REV

organizations.environments.sharedflows.revisions.deployments.undeploy organizations/$ORG/environments/$ENV 上的 apigee.deployments.delete

AND

organizations/$ORG/spaces/$SPACE/sharedflow/$SF/revisions/$REV 上的 apigee.sharedflowrevisions.undeploy

organizations.sharedflows.deployments.list
organizations/$ORG/spaces/$SPACE/sharedflows/$SF 上的 apigee.deployments.list
organizations.sharedflows.revisions.deployments.list
organizations/$ORG/spaces/$SPACE/sharedflows/$SF/revisions/$REV 上的 apigee.deployments.list

偵錯工作階段的權限檢查

如果 API Proxy 與工作區相關聯,則 Proxy 的偵錯工作階段會進行 IAM 權限檢查,如下表所述:

方法 空間身分與存取權管理權限檢查
organizations.environments.apis.revisions.debugsessions.create organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上執行 apigee.tracesessions.create

AND

organizations/$ORG/environments/$ENV

organizations.environments.apis.revisions.debugsessions.get organizations/$ORG/environments/$ENV
上的 apigee.tracesessions.get AND organizations/$ORG/spaces/$SPACE/apis/$API
organizations.environments.apis.revisions.debugsessions.deleteData organizations/$ORG/environments/$ENV
上的 apigee.tracesessions.delete 權限 AND

apigee.tracesessions.delete

organizations/$ORG/spaces/$SPACE/apis/$API

organizations.environments.apis.revisions.debugsessions.list organizations/$ORG/environments/$ENV 上的 apigee.tracesessions.list

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.tracesessions.list

organizations.environments.apis.revisions.debugsessions.data.get organizations/$ORG/environments/$ENV 上的 apigee.tracesessions.get

AND

organizations/$ORG/spaces/$SPACE/apis/$API/revisions/$REV 上的 apigee.tracesessions.get

organizations.environments.apis.revisions.debugsessions.data.list organizations/$ORG/environments/$ENV 上的 apigee.tracesessions.get

AND

organizations/$ORG/spaces/$SPACE/apis/$API 上的 apigee.tracesessions.get