Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/grpc-google-iam-v1/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Code-Based Examples

import logging

from google.cloud.translate_v3 import translate
from google.cloud import library_v1

base_logger = logging.getLogger("google")
base_logger.addHandler(logging.StreamHandler())
Expand All @@ -174,7 +174,7 @@ Code-Based Examples

import logging

from google.cloud.translate_v3 import translate
from google.cloud import library_v1

base_logger = logging.getLogger("google.cloud.library_v1")
base_logger.addHandler(logging.StreamHandler())
Expand Down
157 changes: 157 additions & 0 deletions packages/grpc-google-iam-v1/google/iam/v1/iam_policy.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
// Copyright 2025 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
//
// http://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.

syntax = "proto3";

package google.iam.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/iam/v1/options.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.Iam.V1";
option go_package = "cloud.google.com/go/iam/apiv1/iampb;iampb";
option java_multiple_files = true;
option java_outer_classname = "IamPolicyProto";
option java_package = "com.google.iam.v1";
option php_namespace = "Google\\Cloud\\Iam\\V1";

// API Overview
//
// Manages Identity and Access Management (IAM) policies.
//
// Any implementation of an API that offers access control features
// implements the google.iam.v1.IAMPolicy interface.
//
// ## Data model
//
// Access control is applied when a principal (user or service account), takes
// some action on a resource exposed by a service. Resources, identified by
// URI-like names, are the unit of access control specification. Service
// implementations can choose the granularity of access control and the
// supported permissions for their resources.
// For example one database service may allow access control to be
// specified only at the Table level, whereas another might allow access control
// to also be specified at the Column level.
//
// ## Policy Structure
//
// See google.iam.v1.Policy
//
// This is intentionally not a CRUD style API because access control policies
// are created and deleted implicitly with the resources to which they are
// attached.
service IAMPolicy {
option (google.api.default_host) = "iam-meta-api.googleapis.com";

// Sets the access control policy on the specified resource. Replaces any
// existing policy.
//
// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy) {
option (google.api.http) = {
post: "/v1/{resource=**}:setIamPolicy"
body: "*"
};
}

// Gets the access control policy for a resource.
// Returns an empty policy if the resource exists and does not have a policy
// set.
rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy) {
option (google.api.http) = {
post: "/v1/{resource=**}:getIamPolicy"
body: "*"
};
}

// Returns permissions that a caller has on the specified resource.
// If the resource does not exist, this will return an empty set of
// permissions, not a `NOT_FOUND` error.
//
// Note: This operation is designed to be used for building permission-aware
// UIs and command-line tools, not for authorization checking. This operation
// may "fail open" without warning.
rpc TestIamPermissions(TestIamPermissionsRequest)
returns (TestIamPermissionsResponse) {
option (google.api.http) = {
post: "/v1/{resource=**}:testIamPermissions"
body: "*"
};
}
}

// Request message for `SetIamPolicy` method.
message SetIamPolicyRequest {
// REQUIRED: The resource for which the policy is being specified.
// See the operation documentation for the appropriate value for this field.
string resource = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "*"
];

// REQUIRED: The complete policy to be applied to the `resource`. The size of
// the policy is limited to a few 10s of KB. An empty policy is a
// valid policy but certain Cloud Platform services (such as Projects)
// might reject them.
Policy policy = 2 [(google.api.field_behavior) = REQUIRED];

// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
// the fields in the mask will be modified. If no mask is provided, the
// following default mask is used:
//
// `paths: "bindings, etag"`
google.protobuf.FieldMask update_mask = 3;
}

// Request message for `GetIamPolicy` method.
message GetIamPolicyRequest {
// REQUIRED: The resource for which the policy is being requested.
// See the operation documentation for the appropriate value for this field.
string resource = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "*"
];

// OPTIONAL: A `GetPolicyOptions` object for specifying options to
// `GetIamPolicy`.
GetPolicyOptions options = 2;
}

// Request message for `TestIamPermissions` method.
message TestIamPermissionsRequest {
// REQUIRED: The resource for which the policy detail is being requested.
// See the operation documentation for the appropriate value for this field.
string resource = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "*"
];

// The set of permissions to check for the `resource`. Permissions with
// wildcards (such as '*' or 'storage.*') are not allowed. For more
// information see
// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
repeated string permissions = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response message for `TestIamPermissions` method.
message TestIamPermissionsResponse {
// A subset of `TestPermissionsRequest.permissions` that the caller is
// allowed.
repeated string permissions = 1;
}
52 changes: 28 additions & 24 deletions packages/grpc-google-iam-v1/google/iam/v1/iam_policy_pb2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2024 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@

# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/iam/v1/iam_policy.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
Expand All @@ -27,14 +28,13 @@
_sym_db = _symbol_database.Default()


from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
from google.api import client_pb2 as google_dot_api_dot_client__pb2
from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
from google.api import resource_pb2 as google_dot_api_dot_resource__pb2
from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2

from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2
from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2
from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
b'\n\x1egoogle/iam/v1/iam_policy.proto\x12\rgoogle.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/iam/v1/options.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto"\x8f\x01\n\x13SetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"d\n\x13GetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x30\n\x07options\x18\x02 \x01(\x0b\x32\x1f.google.iam.v1.GetPolicyOptions"R\n\x19TestIamPermissionsRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x18\n\x0bpermissions\x18\x02 \x03(\tB\x03\xe0\x41\x02"1\n\x1aTestIamPermissionsResponse\x12\x13\n\x0bpermissions\x18\x01 \x03(\t2\xb4\x03\n\tIAMPolicy\x12t\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy")\x82\xd3\xe4\x93\x02#"\x1e/v1/{resource=**}:setIamPolicy:\x01*\x12t\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy")\x82\xd3\xe4\x93\x02#"\x1e/v1/{resource=**}:getIamPolicy:\x01*\x12\x9a\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"/\x82\xd3\xe4\x93\x02)"$/v1/{resource=**}:testIamPermissions:\x01*\x1a\x1e\xca\x41\x1biam-meta-api.googleapis.comB|\n\x11\x63om.google.iam.v1B\x0eIamPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3'
Expand All @@ -46,42 +46,46 @@
DESCRIPTOR, "google.iam.v1.iam_policy_pb2", _globals
)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b"\n\021com.google.iam.v1B\016IamPolicyProtoP\001Z)cloud.google.com/go/iam/apiv1/iampb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1"
_SETIAMPOLICYREQUEST.fields_by_name["resource"]._options = None
_SETIAMPOLICYREQUEST.fields_by_name[
_globals["DESCRIPTOR"]._options = None
_globals[
"DESCRIPTOR"
]._serialized_options = b"\n\021com.google.iam.v1B\016IamPolicyProtoP\001Z)cloud.google.com/go/iam/apiv1/iampb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1"
_globals["_SETIAMPOLICYREQUEST"].fields_by_name["resource"]._options = None
_globals["_SETIAMPOLICYREQUEST"].fields_by_name[
"resource"
]._serialized_options = b"\340A\002\372A\003\n\001*"
_SETIAMPOLICYREQUEST.fields_by_name["policy"]._options = None
_SETIAMPOLICYREQUEST.fields_by_name["policy"]._serialized_options = b"\340A\002"
_GETIAMPOLICYREQUEST.fields_by_name["resource"]._options = None
_GETIAMPOLICYREQUEST.fields_by_name[
_globals["_SETIAMPOLICYREQUEST"].fields_by_name["policy"]._options = None
_globals["_SETIAMPOLICYREQUEST"].fields_by_name[
"policy"
]._serialized_options = b"\340A\002"
_globals["_GETIAMPOLICYREQUEST"].fields_by_name["resource"]._options = None
_globals["_GETIAMPOLICYREQUEST"].fields_by_name[
"resource"
]._serialized_options = b"\340A\002\372A\003\n\001*"
_TESTIAMPERMISSIONSREQUEST.fields_by_name["resource"]._options = None
_TESTIAMPERMISSIONSREQUEST.fields_by_name[
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name["resource"]._options = None
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name[
"resource"
]._serialized_options = b"\340A\002\372A\003\n\001*"
_TESTIAMPERMISSIONSREQUEST.fields_by_name["permissions"]._options = None
_TESTIAMPERMISSIONSREQUEST.fields_by_name[
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name["permissions"]._options = None
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name[
"permissions"
]._serialized_options = b"\340A\002"
_IAMPOLICY._options = None
_IAMPOLICY._serialized_options = b"\312A\033iam-meta-api.googleapis.com"
_IAMPOLICY.methods_by_name["SetIamPolicy"]._options = None
_IAMPOLICY.methods_by_name[
_globals["_IAMPOLICY"]._options = None
_globals["_IAMPOLICY"]._serialized_options = b"\312A\033iam-meta-api.googleapis.com"
_globals["_IAMPOLICY"].methods_by_name["SetIamPolicy"]._options = None
_globals["_IAMPOLICY"].methods_by_name[
"SetIamPolicy"
]._serialized_options = (
b'\202\323\344\223\002#"\036/v1/{resource=**}:setIamPolicy:\001*'
)
_IAMPOLICY.methods_by_name["GetIamPolicy"]._options = None
_IAMPOLICY.methods_by_name[
_globals["_IAMPOLICY"].methods_by_name["GetIamPolicy"]._options = None
_globals["_IAMPOLICY"].methods_by_name[
"GetIamPolicy"
]._serialized_options = (
b'\202\323\344\223\002#"\036/v1/{resource=**}:getIamPolicy:\001*'
)
_IAMPOLICY.methods_by_name["TestIamPermissions"]._options = None
_IAMPOLICY.methods_by_name[
_globals["_IAMPOLICY"].methods_by_name["TestIamPermissions"]._options = None
_globals["_IAMPOLICY"].methods_by_name[
"TestIamPermissions"
]._serialized_options = (
b'\202\323\344\223\002)"$/v1/{resource=**}:testIamPermissions:\001*'
Expand Down
77 changes: 77 additions & 0 deletions packages/grpc-google-iam-v1/google/iam/v1/iam_policy_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright 2025 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
#
# http://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.

from typing import ClassVar as _ClassVar
from typing import Iterable as _Iterable
from typing import Mapping as _Mapping
from typing import Optional as _Optional
from typing import Union as _Union

from google.api import annotations_pb2 as _annotations_pb2
from google.api import client_pb2 as _client_pb2
from google.api import field_behavior_pb2 as _field_behavior_pb2
from google.api import resource_pb2 as _resource_pb2
from google.iam.v1 import options_pb2 as _options_pb2
from google.iam.v1 import policy_pb2 as _policy_pb2
from google.protobuf import descriptor as _descriptor
from google.protobuf import field_mask_pb2 as _field_mask_pb2
from google.protobuf import message as _message
from google.protobuf.internal import containers as _containers

DESCRIPTOR: _descriptor.FileDescriptor

class SetIamPolicyRequest(_message.Message):
__slots__ = ("resource", "policy", "update_mask")
RESOURCE_FIELD_NUMBER: _ClassVar[int]
POLICY_FIELD_NUMBER: _ClassVar[int]
UPDATE_MASK_FIELD_NUMBER: _ClassVar[int]
resource: str
policy: _policy_pb2.Policy
update_mask: _field_mask_pb2.FieldMask
def __init__(
self,
resource: _Optional[str] = ...,
policy: _Optional[_Union[_policy_pb2.Policy, _Mapping]] = ...,
update_mask: _Optional[_Union[_field_mask_pb2.FieldMask, _Mapping]] = ...,
) -> None: ...

class GetIamPolicyRequest(_message.Message):
__slots__ = ("resource", "options")
RESOURCE_FIELD_NUMBER: _ClassVar[int]
OPTIONS_FIELD_NUMBER: _ClassVar[int]
resource: str
options: _options_pb2.GetPolicyOptions
def __init__(
self,
resource: _Optional[str] = ...,
options: _Optional[_Union[_options_pb2.GetPolicyOptions, _Mapping]] = ...,
) -> None: ...

class TestIamPermissionsRequest(_message.Message):
__slots__ = ("resource", "permissions")
RESOURCE_FIELD_NUMBER: _ClassVar[int]
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
resource: str
permissions: _containers.RepeatedScalarFieldContainer[str]
def __init__(
self,
resource: _Optional[str] = ...,
permissions: _Optional[_Iterable[str]] = ...,
) -> None: ...

class TestIamPermissionsResponse(_message.Message):
__slots__ = ("permissions",)
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
permissions: _containers.RepeatedScalarFieldContainer[str]
def __init__(self, permissions: _Optional[_Iterable[str]] = ...) -> None: ...
Loading
Loading