发送反馈
Binding
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
JSON 表示法
{
"role" : string ,
"members" : [
string
] ,
"condition" : {
object (Expr
)
}
}
字段
role
string
分配给 members
或主账号列表的角色。例如 roles/viewer
、roles/editor
或 roles/owner
。
如需简要了解 IAM 角色和权限,请参阅 IAM 文档 。如需查看可用的预定义角色列表,请点击此处 。
members[]
string
指定请求访问 Google Cloud 资源的身份。members
可以具有以下值:
allUsers
:一个特殊的标识符,表示互联网上的任何人(无论是否拥有 Google 账号)。
allAuthenticatedUsers
:一个特殊的标识符,表示使用 Google 账号或服务账号进行身份验证的任何用户。 不包括来自外部身份提供方 (IdP) 通过身份联合的身份。
user:{emailid}
:表示特定 Google 账号的电子邮件地址。例如 alice@example.com
。
serviceAccount:{emailid}
:表示 Google 服务帐号的电子邮件地址。例如 my-other-app@appspot.gserviceaccount.com
。
serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]
:Kubernetes 服务账号 的标识符。例如 my-project.svc.id.goog[my-namespace/my-kubernetes-sa]
。
group:{emailid}
:表示 Google 群组的电子邮件地址。例如 admins@example.com
。
domain:{domain}
:G Suite 网域(主网域),表示该网域中的所有用户。例如 google.com
或 example.com
。
principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}
:员工身份池中的单个身份。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{groupId}
:群组中的所有员工身份。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}
:具有特定属性值的所有员工身份。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*
:员工身份池中的所有身份。
principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}
:工作负载身份池中的单个身份。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{groupId}
:工作负载身份池组。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
:工作负载身份池中具有特定特性的所有身份。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*
:工作负载身份池中的所有身份。
deleted:user:{emailid}?uid={uniqueid}
:表示最近被删除的用户的电子邮件地址(以及唯一标识符)。例如 alice@example.com?uid=123456789012345678901
。如果用户已恢复,则此值会恢复为 user:{emailid}
,而且恢复的用户将保留绑定中的角色。
deleted:serviceAccount:{emailid}?uid={uniqueid}
:表示最近被删除的服务账号的电子邮件地址(以及唯一标识符)。例如 my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901
。如果恢复删除的服务账号,则此值会还原为 serviceAccount:{emailid}
,而且删除的服务账号在恢复后将保留绑定中的角色。
deleted:group:{emailid}?uid={uniqueid}
:表示最近被删除的 Google 群组的电子邮件地址(以及唯一标识符)。例如 admins@example.com?uid=123456789012345678901
。如果群组已恢复,则此值会恢复为 group:{emailid}
,而且恢复的群组将保留绑定中的角色。
deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}
:员工身份池中已删除的单个身份。例如 deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value
。
condition
object (Expr
)
与此绑定关联的条件。
如果条件的计算结果为 true
,则此绑定会应用于当前请求。
如果条件的计算结果为 false
,则此绑定不会应用于当前请求。但是,不同的角色绑定可能会向此绑定中的一个或多个主账号授予相同角色。
如需了解哪些资源支持在其 IAM 政策中使用条件,请参阅 IAM 文档 。
Expr
表示采用通用表达式语言 (CEL) 语法的文本表达式。CEL 是一种类似于 C 的表达式语言。有关 CEL 的语法和语义,请参见https://github.com/google/cel-spec 。
示例(比较):
title: "Summary size limit"
description: "Determines if a summary is less than 100 chars"
expression: "document.summary.size() < 100"
示例(相等):
title: "Requestor is owner"
description: "Determines if requestor is the document owner"
expression: "document.owner == request.auth.claims.email"
示例(逻辑):
title: "Public documents"
description: "Determine whether the document should be publicly visible"
expression: "document.type != 'private' && document.type != 'internal'"
示例(数据操纵):
title: "Notification string"
description: "Create a notification string with a timestamp."
expression: "'New message received at ' + string(document.create_time)"
可以在表达式内引用的确切变量和函数由计算该表达式的服务决定。如需了解详情,请参阅服务文档。
JSON 表示法
{
"expression" : string ,
"title" : string ,
"description" : string ,
"location" : string
}
字段
expression
string
采用通用表达式语言语法的表达式的文本表示法。
title
string
可选。表达式的标题,即说明表达式用途的短字符串。该标题可用于允许输入表达式的内容(例如界面)中。
description
string
可选。表达式的说明。该说明是描述表达式的较长文本,例如在界面中将鼠标悬停在表达式上时显示的文本。
location
string
可选。指示用于错误报告的表达式位置的字符串,例如文件名和文件中的位置。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-05-24。
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
需要向我们提供更多信息?