Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 1dfb0e9

Browse files
gcf-owl-bot[bot]Benjamin E. CoeSurferJeffAtGoogle
authored
feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511)
* feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies PiperOrigin-RevId: 381145907 Source-Link: googleapis/googleapis@5d301f9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9b332fd884d84662522abad820fa5835cae8688a * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Benjamin E. Coe <bencoe@google.com> Co-authored-by: Jeffrey Rennie <rennie@google.com>
1 parent ca46c72 commit 1dfb0e9

File tree

7 files changed

+366
-4
lines changed

7 files changed

+366
-4
lines changed

protos/google/cloud/asset/v1/asset_service.proto

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,10 @@ message SearchAllIamPoliciesRequest {
838838
// * `resource:(instance1 OR instance2) policy:amy` to find
839839
// IAM policy bindings that are set on resources "instance1" or
840840
// "instance2" and also specify user "amy".
841+
// * `roles:roles/compute.admin` to find IAM policy bindings that specify the
842+
// Compute Admin role.
843+
// * `memberTypes:user` to find IAM policy bindings that contain the "user"
844+
// member type.
841845
string query = 2 [(google.api.field_behavior) = OPTIONAL];
842846

843847
// Optional. The page size for search result pagination. Page size is capped at 500 even
@@ -851,6 +855,36 @@ message SearchAllIamPoliciesRequest {
851855
// previous response. The values of all other method parameters must be
852856
// identical to those in the previous call.
853857
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
858+
859+
// Optional. A list of asset types that the IAM policies are attached to. If empty, it
860+
// will search the IAM policies that are attached to all the [searchable asset
861+
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
862+
//
863+
// Regular expressions are also supported. For example:
864+
//
865+
// * "compute.googleapis.com.*" snapshots IAM policies attached to asset type
866+
// starts with "compute.googleapis.com".
867+
// * ".*Instance" snapshots IAM policies attached to asset type ends with
868+
// "Instance".
869+
// * ".*Instance.*" snapshots IAM policies attached to asset type contains
870+
// "Instance".
871+
//
872+
// See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
873+
// regular expression syntax. If the regular expression does not match any
874+
// supported asset type, an INVALID_ARGUMENT error will be returned.
875+
repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL];
876+
877+
// Optional. A comma-separated list of fields specifying the sorting order of the
878+
// results. The default order is ascending. Add " DESC" after the field name
879+
// to indicate descending order. Redundant space characters are ignored.
880+
// Example: "assetType DESC, resource".
881+
// Only singular primitive fields in the response are sortable:
882+
// * resource
883+
// * assetType
884+
// * project
885+
// All the other fields such as repeated fields (e.g., `folders`) and
886+
// non-primitive fields (e.g., `policy`) are not supported.
887+
string order_by = 7 [(google.api.field_behavior) = OPTIONAL];
854888
}
855889

856890
// Search all IAM policies response.

protos/google/cloud/asset/v1/assets.proto

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,14 @@ message IamPolicySearchResult {
463463
// * use a field query. Example: `resource:organizations/123`
464464
string resource = 1;
465465

466+
// The type of the resource associated with this IAM policy. Example:
467+
// `compute.googleapis.com/Disk`.
468+
//
469+
// To search against the `asset_type`:
470+
//
471+
// * specify the `asset_types` field in your search request.
472+
string asset_type = 5;
473+
466474
// The project that the associated GCP resource belongs to, in the form of
467475
// projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM
468476
// instance, Cloud Storage bucket), the project field will indicate the
@@ -474,6 +482,28 @@ message IamPolicySearchResult {
474482
// * specify the `scope` field as this project in your search request.
475483
string project = 2;
476484

485+
// The folder(s) that the IAM policy belongs to, in the form of
486+
// folders/{FOLDER_NUMBER}. This field is available when the IAM policy
487+
// belongs to one or more folders.
488+
//
489+
// To search against `folders`:
490+
//
491+
// * use a field query. Example: `folders:(123 OR 456)`
492+
// * use a free text query. Example: `123`
493+
// * specify the `scope` field as this folder in your search request.
494+
repeated string folders = 6;
495+
496+
// The organization that the IAM policy belongs to, in the form
497+
// of organizations/{ORGANIZATION_NUMBER}. This field is available when the
498+
// IAM policy belongs to an organization.
499+
//
500+
// To search against `organization`:
501+
//
502+
// * use a field query. Example: `organization:123`
503+
// * use a free text query. Example: `123`
504+
// * specify the `scope` field as this organization in your search request.
505+
string organization = 7;
506+
477507
// The IAM policy directly set on the given resource. Note that the original
478508
// IAM policy can contain multiple bindings. This only contains the bindings
479509
// that match the given query. For queries that don't contain a constrain on

protos/protos.d.ts

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)