Skip to content

Commit

Permalink
feat: introduces 'expression text', deprecates version field (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and bcoe committed May 10, 2019
1 parent cffab9d commit 4f88558
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-asset/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"repository": "googleapis/nodejs-asset",
"private": true,
"scripts": {
"test": "mocha --timeout 20000"
"test": "mocha --timeout 40000"
},
"dependencies": {
"@google-cloud/asset": "^0.3.0",
Expand Down
39 changes: 30 additions & 9 deletions packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
* specify access control policies for Cloud Platform resources.
*
*
* A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
* 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.
*
* **Example**
* **JSON Example**
*
* {
* "bindings": [
Expand All @@ -35,7 +35,7 @@
* "user:mike@example.com",
* "group:admins@example.com",
* "domain:google.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com"
* ]
* },
* {
Expand All @@ -45,15 +45,28 @@
* ]
* }
*
* **YAML Example**
*
* bindings:
* - members:
* - user:mike@example.com
* - group:admins@example.com
* - domain:google.com
* - serviceAccount:my-other-app@appspot.gserviceaccount.com
* role: roles/owner
* - members:
* - user:sean@example.com
* role: roles/viewer
*
*
* For a description of IAM and its features, see the
* [IAM developer's guide](https://cloud.google.com/iam).
* [IAM developer's guide](https://cloud.google.com/iam/docs).
*
* @property {number} version
* Version of the `Policy`. The default version is 0.
* Deprecated.
*
* @property {Object[]} bindings
* 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.
*
* This object should have the same structure as [Binding]{@link google.iam.v1.Binding}
Expand Down Expand Up @@ -84,7 +97,6 @@ const Policy = {
* @property {string} role
* Role that is assigned to `members`.
* For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
* Required
*
* @property {string[]} members
* Specifies the identities requesting access for a Cloud Platform resource.
Expand All @@ -97,7 +109,7 @@ const Policy = {
* 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`.
* account. For example, `alice@gmail.com` .
*
*
* * `serviceAccount:{emailid}`: An email address that represents a service
Expand All @@ -106,9 +118,18 @@ const Policy = {
* * `group:{emailid}`: An email address that represents a Google group.
* For example, `admins@example.com`.
*
* * `domain:{domain}`: A Google Apps domain name that represents all the
*
* * `domain:{domain}`: The G Suite domain (primary) that represents all the
* users of that domain. For example, `google.com` or `example.com`.
*
* @property {Object} condition
* The condition that is associated with this binding.
* NOTE: An unsatisfied condition will not allow user access via current
* binding. Different bindings, including their conditions, are examined
* independently.
*
* This object should have the same structure as [Expr]{@link google.type.Expr}
*
* @typedef Binding
* @memberof google.iam.v1
* @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto}
Expand Down
51 changes: 51 additions & 0 deletions packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Note: this file is purely for documentation. Any contents are not expected
// to be loaded as the JS file.

/**
* Represents an expression text. Example:
*
* title: "User account presence"
* description: "Determines whether the request has a user account"
* expression: "size(request.user) > 0"
*
* @property {string} expression
* Textual representation of an expression in
* Common Expression Language syntax.
*
* The application context of the containing message determines which
* well-known feature set of CEL is supported.
*
* @property {string} title
* An optional title for the expression, i.e. a short string describing
* its purpose. This can be used e.g. in UIs which allow to enter the
* expression.
*
* @property {string} description
* An optional description of the expression. This is a longer text which
* describes the expression, e.g. when hovered over it in a UI.
*
* @property {string} location
* An optional string indicating the location of the expression for error
* reporting, e.g. a file name and a position in the file.
*
* @typedef Expr
* @memberof google.type
* @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto}
*/
const Expr = {
// This is for documentation. Actual contents will be loaded by gRPC.
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
* specify access control policies for Cloud Platform resources.
*
*
* A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
* 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.
*
* **Example**
* **JSON Example**
*
* {
* "bindings": [
Expand All @@ -35,7 +35,7 @@
* "user:mike@example.com",
* "group:admins@example.com",
* "domain:google.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com"
* ]
* },
* {
Expand All @@ -45,15 +45,28 @@
* ]
* }
*
* **YAML Example**
*
* bindings:
* - members:
* - user:mike@example.com
* - group:admins@example.com
* - domain:google.com
* - serviceAccount:my-other-app@appspot.gserviceaccount.com
* role: roles/owner
* - members:
* - user:sean@example.com
* role: roles/viewer
*
*
* For a description of IAM and its features, see the
* [IAM developer's guide](https://cloud.google.com/iam).
* [IAM developer's guide](https://cloud.google.com/iam/docs).
*
* @property {number} version
* Version of the `Policy`. The default version is 0.
* Deprecated.
*
* @property {Object[]} bindings
* 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.
*
* This object should have the same structure as [Binding]{@link google.iam.v1.Binding}
Expand Down Expand Up @@ -84,7 +97,6 @@ const Policy = {
* @property {string} role
* Role that is assigned to `members`.
* For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
* Required
*
* @property {string[]} members
* Specifies the identities requesting access for a Cloud Platform resource.
Expand All @@ -97,7 +109,7 @@ const Policy = {
* 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`.
* account. For example, `alice@gmail.com` .
*
*
* * `serviceAccount:{emailid}`: An email address that represents a service
Expand All @@ -106,9 +118,18 @@ const Policy = {
* * `group:{emailid}`: An email address that represents a Google group.
* For example, `admins@example.com`.
*
* * `domain:{domain}`: A Google Apps domain name that represents all the
*
* * `domain:{domain}`: The G Suite domain (primary) that represents all the
* users of that domain. For example, `google.com` or `example.com`.
*
* @property {Object} condition
* The condition that is associated with this binding.
* NOTE: An unsatisfied condition will not allow user access via current
* binding. Different bindings, including their conditions, are examined
* independently.
*
* This object should have the same structure as [Expr]{@link google.type.Expr}
*
* @typedef Binding
* @memberof google.iam.v1
* @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Note: this file is purely for documentation. Any contents are not expected
// to be loaded as the JS file.

/**
* Represents an expression text. Example:
*
* title: "User account presence"
* description: "Determines whether the request has a user account"
* expression: "size(request.user) > 0"
*
* @property {string} expression
* Textual representation of an expression in
* Common Expression Language syntax.
*
* The application context of the containing message determines which
* well-known feature set of CEL is supported.
*
* @property {string} title
* An optional title for the expression, i.e. a short string describing
* its purpose. This can be used e.g. in UIs which allow to enter the
* expression.
*
* @property {string} description
* An optional description of the expression. This is a longer text which
* describes the expression, e.g. when hovered over it in a UI.
*
* @property {string} location
* An optional string indicating the location of the expression for error
* reporting, e.g. a file name and a position in the file.
*
* @typedef Expr
* @memberof google.type
* @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto}
*/
const Expr = {
// This is for documentation. Actual contents will be loaded by gRPC.
};
10 changes: 5 additions & 5 deletions packages/google-cloud-asset/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-05-04T11:08:40.331631Z",
"updateTime": "2019-05-10T11:55:39.589987Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.18.0",
"dockerImage": "googleapis/artman@sha256:29bd82cc42c43825fde408e63fc955f3f9d07ff9989243d7aa0f91a35c7884dc"
"version": "0.19.0",
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "39c876cca5403e7e8282ce2229033cc3cc02962c",
"internalRef": "246561601"
"sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a",
"internalRef": "247530843"
}
},
{
Expand Down

0 comments on commit 4f88558

Please sign in to comment.