|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
// Copyright (c) 2015, Google Inc. |
|
|
|
|
// Copyright 2016 Google Inc. |
|
|
|
|
// |
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
// you may not use this file except in compliance with the License. |
|
|
|
@ -16,92 +16,93 @@ syntax = "proto3"; |
|
|
|
|
|
|
|
|
|
package google.iam.v1; |
|
|
|
|
|
|
|
|
|
option cc_enable_arenas = true; |
|
|
|
|
option java_multiple_files = true; |
|
|
|
|
option java_outer_classname = "PolicyProto"; |
|
|
|
|
option java_package = "com.google.iam.v1"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// # Overview |
|
|
|
|
// Defines an Identity and Access Management (IAM) policy. It is used to |
|
|
|
|
// specify access control policies for Cloud Platform resources. |
|
|
|
|
// |
|
|
|
|
// The `Policy` defines an access control policy language. It is used to |
|
|
|
|
// define policies that are attached to resources like files, folders, VMs, |
|
|
|
|
// etc. |
|
|
|
|
// |
|
|
|
|
// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of |
|
|
|
|
// `members` to a `role`, where the members can be user accounts, Google groups, |
|
|
|
|
// Google domains, and service accounts. A `role` is a named list of permissions |
|
|
|
|
// defined by IAM. |
|
|
|
|
// |
|
|
|
|
// # Policy structure |
|
|
|
|
// **Example** |
|
|
|
|
// |
|
|
|
|
// A `Policy` consists of a list of bindings. A `Binding` binds a set of members |
|
|
|
|
// to a role, where the members include user accounts, user groups, user |
|
|
|
|
// domains, and service accounts. A 'role' is a named set of permissions, |
|
|
|
|
// defined by IAM. The definition of a role is outside the policy. |
|
|
|
|
// |
|
|
|
|
// A permission check first determines the roles that include the specified |
|
|
|
|
// permission, and then determines if the principal specified is a |
|
|
|
|
// member of a binding to at least one of these roles. The membership check is |
|
|
|
|
// recursive when a group is bound to a role. |
|
|
|
|
// |
|
|
|
|
// Policy examples: |
|
|
|
|
// |
|
|
|
|
// ``` |
|
|
|
|
// { |
|
|
|
|
// "bindings": [ |
|
|
|
|
// { |
|
|
|
|
// "role": "roles/owner", |
|
|
|
|
// "members": [ |
|
|
|
|
// "user:mike@example.com", |
|
|
|
|
// "group:admins@example.com", |
|
|
|
|
// "domain:google.com", |
|
|
|
|
// "serviceAccount:frontend@example.iam.gserviceaccounts.com"] |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// "role": "roles/viewer", |
|
|
|
|
// "members": ["user:sean@example.com"] |
|
|
|
|
// "bindings": [ |
|
|
|
|
// { |
|
|
|
|
// "role": "roles/owner", |
|
|
|
|
// "members": [ |
|
|
|
|
// "user:mike@example.com", |
|
|
|
|
// "group:admins@example.com", |
|
|
|
|
// "domain:google.com", |
|
|
|
|
// "serviceAccount:my-other-app@appspot.gserviceaccount.com", |
|
|
|
|
// ] |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// "role": "roles/viewer", |
|
|
|
|
// "members": ["user:sean@example.com"] |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// } |
|
|
|
|
// ``` |
|
|
|
|
// |
|
|
|
|
// For a description of IAM and its features, see the |
|
|
|
|
// [IAM developer's guide](https://cloud.google.com/iam). |
|
|
|
|
message Policy { |
|
|
|
|
// The policy language version. The version of the policy is |
|
|
|
|
// represented by the etag. The default version is 0. |
|
|
|
|
// Version of the `Policy`. The default version is 0. |
|
|
|
|
int32 version = 1; |
|
|
|
|
|
|
|
|
|
// It is an error to specify multiple bindings for the same role. |
|
|
|
|
// It is an error to specify a binding with no members. |
|
|
|
|
// Associates a list of `members` to a `role`. |
|
|
|
|
// Multiple `bindings` must not be specified for the same `role`. |
|
|
|
|
// `bindings` with no members will result in an error. |
|
|
|
|
repeated Binding bindings = 4; |
|
|
|
|
|
|
|
|
|
// Can be used to perform a read-modify-write. |
|
|
|
|
// `etag` is used for optimistic concurrency control as a way to help |
|
|
|
|
// prevent simultaneous updates of a policy from overwriting each other. |
|
|
|
|
// It is strongly suggested that systems make use of the `etag` in the |
|
|
|
|
// read-modify-write cycle to perform policy updates in order to avoid race |
|
|
|
|
// conditions: An `etag` is returned in the response to `getIamPolicy`, and |
|
|
|
|
// systems are expected to put that etag in the request to `setIamPolicy` to |
|
|
|
|
// ensure that their change will be applied to the same version of the policy. |
|
|
|
|
// |
|
|
|
|
// If no `etag` is provided in the call to `setIamPolicy`, then the existing |
|
|
|
|
// policy is overwritten blindly. |
|
|
|
|
bytes etag = 3; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Associates members with roles. See below for allowed |
|
|
|
|
// formats of members. |
|
|
|
|
// Associates `members` with a `role`. |
|
|
|
|
message Binding { |
|
|
|
|
// The name of the role to which the members should be bound. |
|
|
|
|
// Examples: "roles/viewer", "roles/editor", "roles/owner". |
|
|
|
|
// Role that is assigned to `members`. |
|
|
|
|
// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
|
|
|
|
// Required |
|
|
|
|
string role = 1; |
|
|
|
|
|
|
|
|
|
// Format of member entries: |
|
|
|
|
// 1. allUsers |
|
|
|
|
// Matches any requesting principal (users, service accounts or anonymous). |
|
|
|
|
// Specifies the identities requesting access for a Cloud Platform resource. |
|
|
|
|
// `members` can have the following values: |
|
|
|
|
// |
|
|
|
|
// * `allUsers`: A special identifier that represents anyone who is |
|
|
|
|
// on the internet; with or without a Google account. |
|
|
|
|
// |
|
|
|
|
// * `allAuthenticatedUsers`: A special identifier that represents anyone |
|
|
|
|
// who is authenticated with a Google account or a service account. |
|
|
|
|
// |
|
|
|
|
// * `user:{emailid}`: An email address that represents a specific Google |
|
|
|
|
// account. For example, `alice@gmail.com` or `joe@example.com`. |
|
|
|
|
// |
|
|
|
|
// 2. allAuthenticatedUsers |
|
|
|
|
// Matches any requesting authenticated principal (users or service |
|
|
|
|
// accounts). |
|
|
|
|
// * `serviceAccount:{emailid}`: An email address that represents a service |
|
|
|
|
// account. For example, `my-other-app@appspot.gserviceaccount.com`. |
|
|
|
|
// |
|
|
|
|
// 3. user:{emailid} |
|
|
|
|
// A google user account using an email address. |
|
|
|
|
// For example alice@gmail.com, joe@example.com |
|
|
|
|
// * `group:{emailid}`: An email address that represents a Google group. |
|
|
|
|
// For example, `admins@example.com`. |
|
|
|
|
// |
|
|
|
|
// 4. serviceAccount:{emailid} |
|
|
|
|
// An service account email. |
|
|
|
|
// * `domain:{domain}`: A Google Apps domain name that represents all the |
|
|
|
|
// users of that domain. For example, `google.com` or `example.com`. |
|
|
|
|
// |
|
|
|
|
// 5. group:{emailid} |
|
|
|
|
// A google group with an email address. For example |
|
|
|
|
// auth-ti-cloud@google.com |
|
|
|
|
// |
|
|
|
|
// 6. domain:{domain} |
|
|
|
|
// A Google Apps domain name. |
|
|
|
|
// For example google.com, example.com |
|
|
|
|
repeated string members = 2; |
|
|
|
|
} |
|
|
|
|