簡體   English   中英

工作負載身份聯合條件的通用表達式語言中的用戶或條件

[英]User or condition in common expression language for workload identity federation condition

我正在嘗試在我的 GCP 組織中設置工作負載身份聯合身份驗證。

我想通過利用attribute_conditions來限制訪問,以便一些repos 和一些分支能夠訪問 GCP 服務帳戶提供的相應權限。 假設我想使用 2 個存儲庫/分支,那么在語法上正確的方法(就 CEL 而言)是什么?

 attribute_condition                = "(assertion.sub=='repo:MyOrg/repo1:ref:refs/heads/main|repo:MyOrg/repo2:ref:refs/heads/master')"

我嘗試過的上述示例似乎不起作用。

問題在於期望值的鏈接方式。 我有一個類似的用例來支持多個存儲庫,並且以下格式有效。

(assertion.repository=='MyOrg/repo1' && assertion.ref=='refs/heads/main') || (assertion.repository=='MyOrg/repo2' && assertion.ref=='refs/heads/master')

確保為使用的字段定義了屬性映射( assertion.repository 和 assertion.ref)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM