diff --git a/CHANGELOG.md b/CHANGELOG.md index 880c242..6e4dd60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.2.2](https://github.com/googleapis/python-audit-log/compare/v0.2.1...v0.2.2) (2022-05-26) + + +### Bug Fixes + +* regenerate pb2 files using grpcio-tools ([#57](https://github.com/googleapis/python-audit-log/issues/57)) ([7058ada](https://github.com/googleapis/python-audit-log/commit/7058ada0cc89cac453b6d55d6a1529d7274784fd)) + ### [0.2.1](https://github.com/googleapis/python-audit-log/compare/v0.2.0...v0.2.1) (2022-05-26) diff --git a/google/cloud/audit/audit_log_pb2.py b/google/cloud/audit/audit_log_pb2.py index c1ff374..91b61e1 100644 --- a/google/cloud/audit/audit_log_pb2.py +++ b/google/cloud/audit/audit_log_pb2.py @@ -16,8 +16,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/audit/audit_log.proto - +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -35,972 +36,25 @@ from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/audit/audit_log.proto", - package="google.cloud.audit", - syntax="proto3", - serialized_options=b"\n\026com.google.cloud.auditB\rAuditLogProtoP\001Z7google.golang.org/genproto/googleapis/cloud/audit;audit\370\001\001", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n"google/cloud/audit/audit_log.proto\x12\x12google.cloud.audit\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a*google/rpc/context/attribute_context.proto\x1a\x17google/rpc/status.proto"\xfa\x04\n\x08\x41uditLog\x12\x14\n\x0cservice_name\x18\x07 \x01(\t\x12\x13\n\x0bmethod_name\x18\x08 \x01(\t\x12\x15\n\rresource_name\x18\x0b \x01(\t\x12?\n\x11resource_location\x18\x14 \x01(\x0b\x32$.google.cloud.audit.ResourceLocation\x12\x38\n\x17resource_original_state\x18\x13 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\x12num_response_items\x18\x0c \x01(\x03\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x13\x61uthentication_info\x18\x03 \x01(\x0b\x32&.google.cloud.audit.AuthenticationInfo\x12\x41\n\x12\x61uthorization_info\x18\t \x03(\x0b\x32%.google.cloud.audit.AuthorizationInfo\x12=\n\x10request_metadata\x18\x04 \x01(\x0b\x32#.google.cloud.audit.RequestMetadata\x12(\n\x07request\x18\x10 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08response\x18\x11 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12*\n\x0cservice_data\x18\x0f \x01(\x0b\x32\x14.google.protobuf.Any"\x99\x02\n\x12\x41uthenticationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x1a\n\x12\x61uthority_selector\x18\x02 \x01(\t\x12\x36\n\x15third_party_principal\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12 \n\x18service_account_key_name\x18\x05 \x01(\t\x12Y\n\x1fservice_account_delegation_info\x18\x06 \x03(\x0b\x32\x30.google.cloud.audit.ServiceAccountDelegationInfo\x12\x19\n\x11principal_subject\x18\x08 \x01(\t"\x96\x01\n\x11\x41uthorizationInfo\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\t\x12\x0f\n\x07granted\x18\x03 \x01(\x08\x12J\n\x13resource_attributes\x18\x05 \x01(\x0b\x32-.google.rpc.context.AttributeContext.Resource"\xf5\x01\n\x0fRequestMetadata\x12\x11\n\tcaller_ip\x18\x01 \x01(\t\x12"\n\x1a\x63\x61ller_supplied_user_agent\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61ller_network\x18\x03 \x01(\t\x12H\n\x12request_attributes\x18\x07 \x01(\x0b\x32,.google.rpc.context.AttributeContext.Request\x12I\n\x16\x64\x65stination_attributes\x18\x08 \x01(\x0b\x32).google.rpc.context.AttributeContext.Peer"I\n\x10ResourceLocation\x12\x19\n\x11\x63urrent_locations\x18\x01 \x03(\t\x12\x1a\n\x12original_locations\x18\x02 \x03(\t"\xa8\x03\n\x1cServiceAccountDelegationInfo\x12\x65\n\x15\x66irst_party_principal\x18\x01 \x01(\x0b\x32\x44.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalH\x00\x12\x65\n\x15third_party_principal\x18\x02 \x01(\x0b\x32\x44.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalH\x00\x1a\x61\n\x13\x46irstPartyPrincipal\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x31\n\x10service_metadata\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x1aJ\n\x13ThirdPartyPrincipal\x12\x33\n\x12third_party_claims\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x0b\n\tAuthorityBe\n\x16\x63om.google.cloud.auditB\rAuditLogProtoP\x01Z7google.golang.org/genproto/googleapis/cloud/audit;audit\xf8\x01\x01\x62\x06proto3', - dependencies=[ - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, - google_dot_rpc_dot_context_dot_attribute__context__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_AUDITLOG = _descriptor.Descriptor( - name="AuditLog", - full_name="google.cloud.audit.AuditLog", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="service_name", - full_name="google.cloud.audit.AuditLog.service_name", - index=0, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="method_name", - full_name="google.cloud.audit.AuditLog.method_name", - index=1, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resource_name", - full_name="google.cloud.audit.AuditLog.resource_name", - index=2, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resource_location", - full_name="google.cloud.audit.AuditLog.resource_location", - index=3, - number=20, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resource_original_state", - full_name="google.cloud.audit.AuditLog.resource_original_state", - index=4, - number=19, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_response_items", - full_name="google.cloud.audit.AuditLog.num_response_items", - index=5, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.cloud.audit.AuditLog.status", - index=6, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="authentication_info", - full_name="google.cloud.audit.AuditLog.authentication_info", - index=7, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="authorization_info", - full_name="google.cloud.audit.AuditLog.authorization_info", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="request_metadata", - full_name="google.cloud.audit.AuditLog.request_metadata", - index=9, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="request", - full_name="google.cloud.audit.AuditLog.request", - index=10, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="response", - full_name="google.cloud.audit.AuditLog.response", - index=11, - number=17, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.audit.AuditLog.metadata", - index=12, - number=18, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="service_data", - full_name="google.cloud.audit.AuditLog.service_data", - index=13, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=185, - serialized_end=819, -) - - -_AUTHENTICATIONINFO = _descriptor.Descriptor( - name="AuthenticationInfo", - full_name="google.cloud.audit.AuthenticationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="principal_email", - full_name="google.cloud.audit.AuthenticationInfo.principal_email", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="authority_selector", - full_name="google.cloud.audit.AuthenticationInfo.authority_selector", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="third_party_principal", - full_name="google.cloud.audit.AuthenticationInfo.third_party_principal", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="service_account_key_name", - full_name="google.cloud.audit.AuthenticationInfo.service_account_key_name", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="service_account_delegation_info", - full_name="google.cloud.audit.AuthenticationInfo.service_account_delegation_info", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="principal_subject", - full_name="google.cloud.audit.AuthenticationInfo.principal_subject", - index=5, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=822, - serialized_end=1103, -) - - -_AUTHORIZATIONINFO = _descriptor.Descriptor( - name="AuthorizationInfo", - full_name="google.cloud.audit.AuthorizationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="resource", - full_name="google.cloud.audit.AuthorizationInfo.resource", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="permission", - full_name="google.cloud.audit.AuthorizationInfo.permission", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="granted", - full_name="google.cloud.audit.AuthorizationInfo.granted", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resource_attributes", - full_name="google.cloud.audit.AuthorizationInfo.resource_attributes", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1106, - serialized_end=1256, -) - - -_REQUESTMETADATA = _descriptor.Descriptor( - name="RequestMetadata", - full_name="google.cloud.audit.RequestMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="caller_ip", - full_name="google.cloud.audit.RequestMetadata.caller_ip", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="caller_supplied_user_agent", - full_name="google.cloud.audit.RequestMetadata.caller_supplied_user_agent", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="caller_network", - full_name="google.cloud.audit.RequestMetadata.caller_network", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="request_attributes", - full_name="google.cloud.audit.RequestMetadata.request_attributes", - index=3, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="destination_attributes", - full_name="google.cloud.audit.RequestMetadata.destination_attributes", - index=4, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1259, - serialized_end=1504, +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n"google/cloud/audit/audit_log.proto\x12\x12google.cloud.audit\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a*google/rpc/context/attribute_context.proto\x1a\x17google/rpc/status.proto"\xfa\x04\n\x08\x41uditLog\x12\x14\n\x0cservice_name\x18\x07 \x01(\t\x12\x13\n\x0bmethod_name\x18\x08 \x01(\t\x12\x15\n\rresource_name\x18\x0b \x01(\t\x12?\n\x11resource_location\x18\x14 \x01(\x0b\x32$.google.cloud.audit.ResourceLocation\x12\x38\n\x17resource_original_state\x18\x13 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\x12num_response_items\x18\x0c \x01(\x03\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x13\x61uthentication_info\x18\x03 \x01(\x0b\x32&.google.cloud.audit.AuthenticationInfo\x12\x41\n\x12\x61uthorization_info\x18\t \x03(\x0b\x32%.google.cloud.audit.AuthorizationInfo\x12=\n\x10request_metadata\x18\x04 \x01(\x0b\x32#.google.cloud.audit.RequestMetadata\x12(\n\x07request\x18\x10 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08response\x18\x11 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08metadata\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12*\n\x0cservice_data\x18\x0f \x01(\x0b\x32\x14.google.protobuf.Any"\x99\x02\n\x12\x41uthenticationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x1a\n\x12\x61uthority_selector\x18\x02 \x01(\t\x12\x36\n\x15third_party_principal\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12 \n\x18service_account_key_name\x18\x05 \x01(\t\x12Y\n\x1fservice_account_delegation_info\x18\x06 \x03(\x0b\x32\x30.google.cloud.audit.ServiceAccountDelegationInfo\x12\x19\n\x11principal_subject\x18\x08 \x01(\t"\x96\x01\n\x11\x41uthorizationInfo\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\t\x12\x0f\n\x07granted\x18\x03 \x01(\x08\x12J\n\x13resource_attributes\x18\x05 \x01(\x0b\x32-.google.rpc.context.AttributeContext.Resource"\xf5\x01\n\x0fRequestMetadata\x12\x11\n\tcaller_ip\x18\x01 \x01(\t\x12"\n\x1a\x63\x61ller_supplied_user_agent\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61ller_network\x18\x03 \x01(\t\x12H\n\x12request_attributes\x18\x07 \x01(\x0b\x32,.google.rpc.context.AttributeContext.Request\x12I\n\x16\x64\x65stination_attributes\x18\x08 \x01(\x0b\x32).google.rpc.context.AttributeContext.Peer"I\n\x10ResourceLocation\x12\x19\n\x11\x63urrent_locations\x18\x01 \x03(\t\x12\x1a\n\x12original_locations\x18\x02 \x03(\t"\xa8\x03\n\x1cServiceAccountDelegationInfo\x12\x65\n\x15\x66irst_party_principal\x18\x01 \x01(\x0b\x32\x44.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalH\x00\x12\x65\n\x15third_party_principal\x18\x02 \x01(\x0b\x32\x44.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalH\x00\x1a\x61\n\x13\x46irstPartyPrincipal\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x31\n\x10service_metadata\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x1aJ\n\x13ThirdPartyPrincipal\x12\x33\n\x12third_party_claims\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x0b\n\tAuthorityBe\n\x16\x63om.google.cloud.auditB\rAuditLogProtoP\x01Z7google.golang.org/genproto/googleapis/cloud/audit;audit\xf8\x01\x01\x62\x06proto3' ) -_RESOURCELOCATION = _descriptor.Descriptor( - name="ResourceLocation", - full_name="google.cloud.audit.ResourceLocation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="current_locations", - full_name="google.cloud.audit.ResourceLocation.current_locations", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="original_locations", - full_name="google.cloud.audit.ResourceLocation.original_locations", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1506, - serialized_end=1579, -) - - -_SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL = _descriptor.Descriptor( - name="FirstPartyPrincipal", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="principal_email", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.principal_email", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="service_metadata", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.service_metadata", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1820, - serialized_end=1917, -) - -_SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL = _descriptor.Descriptor( - name="ThirdPartyPrincipal", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="third_party_claims", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.third_party_claims", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1919, - serialized_end=1993, -) - -_SERVICEACCOUNTDELEGATIONINFO = _descriptor.Descriptor( - name="ServiceAccountDelegationInfo", - full_name="google.cloud.audit.ServiceAccountDelegationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="first_party_principal", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.first_party_principal", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="third_party_principal", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.third_party_principal", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL, - _SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="Authority", - full_name="google.cloud.audit.ServiceAccountDelegationInfo.Authority", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=1582, - serialized_end=2006, -) - -_AUDITLOG.fields_by_name["resource_location"].message_type = _RESOURCELOCATION -_AUDITLOG.fields_by_name[ - "resource_original_state" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_AUDITLOG.fields_by_name["status"].message_type = google_dot_rpc_dot_status__pb2._STATUS -_AUDITLOG.fields_by_name["authentication_info"].message_type = _AUTHENTICATIONINFO -_AUDITLOG.fields_by_name["authorization_info"].message_type = _AUTHORIZATIONINFO -_AUDITLOG.fields_by_name["request_metadata"].message_type = _REQUESTMETADATA -_AUDITLOG.fields_by_name[ - "request" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_AUDITLOG.fields_by_name[ - "response" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_AUDITLOG.fields_by_name[ - "metadata" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_AUDITLOG.fields_by_name[ - "service_data" -].message_type = google_dot_protobuf_dot_any__pb2._ANY -_AUTHENTICATIONINFO.fields_by_name[ - "third_party_principal" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_AUTHENTICATIONINFO.fields_by_name[ - "service_account_delegation_info" -].message_type = _SERVICEACCOUNTDELEGATIONINFO -_AUTHORIZATIONINFO.fields_by_name[ - "resource_attributes" -].message_type = ( - google_dot_rpc_dot_context_dot_attribute__context__pb2._ATTRIBUTECONTEXT_RESOURCE -) -_REQUESTMETADATA.fields_by_name[ - "request_attributes" -].message_type = ( - google_dot_rpc_dot_context_dot_attribute__context__pb2._ATTRIBUTECONTEXT_REQUEST -) -_REQUESTMETADATA.fields_by_name[ - "destination_attributes" -].message_type = ( - google_dot_rpc_dot_context_dot_attribute__context__pb2._ATTRIBUTECONTEXT_PEER -) -_SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL.fields_by_name[ - "service_metadata" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL.containing_type = ( - _SERVICEACCOUNTDELEGATIONINFO -) -_SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL.fields_by_name[ - "third_party_claims" -].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL.containing_type = ( - _SERVICEACCOUNTDELEGATIONINFO -) -_SERVICEACCOUNTDELEGATIONINFO.fields_by_name[ - "first_party_principal" -].message_type = _SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL -_SERVICEACCOUNTDELEGATIONINFO.fields_by_name[ - "third_party_principal" -].message_type = _SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL -_SERVICEACCOUNTDELEGATIONINFO.oneofs_by_name["Authority"].fields.append( - _SERVICEACCOUNTDELEGATIONINFO.fields_by_name["first_party_principal"] -) -_SERVICEACCOUNTDELEGATIONINFO.fields_by_name[ - "first_party_principal" -].containing_oneof = _SERVICEACCOUNTDELEGATIONINFO.oneofs_by_name["Authority"] -_SERVICEACCOUNTDELEGATIONINFO.oneofs_by_name["Authority"].fields.append( - _SERVICEACCOUNTDELEGATIONINFO.fields_by_name["third_party_principal"] -) -_SERVICEACCOUNTDELEGATIONINFO.fields_by_name[ - "third_party_principal" -].containing_oneof = _SERVICEACCOUNTDELEGATIONINFO.oneofs_by_name["Authority"] -DESCRIPTOR.message_types_by_name["AuditLog"] = _AUDITLOG -DESCRIPTOR.message_types_by_name["AuthenticationInfo"] = _AUTHENTICATIONINFO -DESCRIPTOR.message_types_by_name["AuthorizationInfo"] = _AUTHORIZATIONINFO -DESCRIPTOR.message_types_by_name["RequestMetadata"] = _REQUESTMETADATA -DESCRIPTOR.message_types_by_name["ResourceLocation"] = _RESOURCELOCATION -DESCRIPTOR.message_types_by_name[ +_AUDITLOG = DESCRIPTOR.message_types_by_name["AuditLog"] +_AUTHENTICATIONINFO = DESCRIPTOR.message_types_by_name["AuthenticationInfo"] +_AUTHORIZATIONINFO = DESCRIPTOR.message_types_by_name["AuthorizationInfo"] +_REQUESTMETADATA = DESCRIPTOR.message_types_by_name["RequestMetadata"] +_RESOURCELOCATION = DESCRIPTOR.message_types_by_name["ResourceLocation"] +_SERVICEACCOUNTDELEGATIONINFO = DESCRIPTOR.message_types_by_name[ "ServiceAccountDelegationInfo" -] = _SERVICEACCOUNTDELEGATIONINFO -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +] +_SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL = _SERVICEACCOUNTDELEGATIONINFO.nested_types_by_name[ + "FirstPartyPrincipal" +] +_SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL = _SERVICEACCOUNTDELEGATIONINFO.nested_types_by_name[ + "ThirdPartyPrincipal" +] AuditLog = _reflection.GeneratedProtocolMessageType( "AuditLog", (_message.Message,), @@ -1087,6 +141,24 @@ _sym_db.RegisterMessage(ServiceAccountDelegationInfo.FirstPartyPrincipal) _sym_db.RegisterMessage(ServiceAccountDelegationInfo.ThirdPartyPrincipal) - -DESCRIPTOR._options = None +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"\n\026com.google.cloud.auditB\rAuditLogProtoP\001Z7google.golang.org/genproto/googleapis/cloud/audit;audit\370\001\001" + _AUDITLOG._serialized_start = 185 + _AUDITLOG._serialized_end = 819 + _AUTHENTICATIONINFO._serialized_start = 822 + _AUTHENTICATIONINFO._serialized_end = 1103 + _AUTHORIZATIONINFO._serialized_start = 1106 + _AUTHORIZATIONINFO._serialized_end = 1256 + _REQUESTMETADATA._serialized_start = 1259 + _REQUESTMETADATA._serialized_end = 1504 + _RESOURCELOCATION._serialized_start = 1506 + _RESOURCELOCATION._serialized_end = 1579 + _SERVICEACCOUNTDELEGATIONINFO._serialized_start = 1582 + _SERVICEACCOUNTDELEGATIONINFO._serialized_end = 2006 + _SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL._serialized_start = 1820 + _SERVICEACCOUNTDELEGATIONINFO_FIRSTPARTYPRINCIPAL._serialized_end = 1917 + _SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL._serialized_start = 1919 + _SERVICEACCOUNTDELEGATIONINFO_THIRDPARTYPRINCIPAL._serialized_end = 1993 # @@protoc_insertion_point(module_scope) diff --git a/noxfile.py b/noxfile.py index f608d2f..e09aabc 100644 --- a/noxfile.py +++ b/noxfile.py @@ -53,9 +53,7 @@ def generate_protos(session): 3. The `google` directory also has `__init__.py` files to create proper modules. If a new subdirectory is added, you will need to create more `__init__.py` files. - NOTE: This is a hack and only runnable locally. You will need to have - the api-common-protos repo cloned. This should be migrated to use - bazel in the future. + NOTE: This should be migrated to use bazel in the future. """ session.install("grpcio-tools") protos = [str(p) for p in (Path(".").glob("google/**/*.proto"))] @@ -64,7 +62,6 @@ def generate_protos(session): "python", "-m", "grpc_tools.protoc", - "--proto_path=../api-common-protos", "--proto_path=.", "--python_out=.", *protos, diff --git a/owlbot.py b/owlbot.py index 6fe1835..201460a 100644 --- a/owlbot.py +++ b/owlbot.py @@ -11,21 +11,41 @@ # 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. -import os +import os +import shutil +import subprocess import synthtool as s import synthtool.gcp as gcp -from synthtool import tmp from synthtool.languages import python from synthtool.sources import git +GOOGLEAPIS_REPO = "googleapis/googleapis" + +# Clean up googleapis +shutil.rmtree('googleapis', ignore_errors=True) + +# Clone googleapis +googleapis_url = git.make_repo_clone_url(https://github.com/GOOGLEAPIS_REPO) +subprocess.run(["git", "clone", googleapis_url]) + +# This is required in order for s.copy() to work +s._tracked_paths.add("googleapis") + +os.makedirs("google/rpc/context", exist_ok=True) + +s.copy("googleapis/google/rpc/context/attribute_context.proto", "google/rpc/context") +s.copy("googleapis/google/rpc/status.proto", "google/rpc") + +# Clean up googleapis +shutil.rmtree('googleapis') + # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- -# TODO: fetch protos from their source of truth (googleapis/googleapis) and -# generate via Bazel +# TODO: generate via Bazel common = gcp.CommonTemplates() templated_files = common.py_library() @@ -37,5 +57,37 @@ s.move(templated_files / ".github", excludes=["workflows"]) s.move(templated_files / ".gitignore") +# Generate _pb2.py files and format them +s.shell.run(["nox", "-s", "generate_protos"], hide_output=False) + +# Clean up googleapis +shutil.rmtree('google/rpc') + +s.shell.run(["nox", "-s", "blacken"], hide_output=False) + # Add license headers python.fix_pb2_headers() + +LICENSE = """ +# Copyright 2020 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.""" + +PB2_GRPC_HEADER = r"""(\# Generated by the gRPC Python protocol compiler plugin\. DO NOT EDIT!$) +(.*?$)""" + +s.replace( + "**/*_pb2_grpc.py", + PB2_GRPC_HEADER, + fr"{LICENSE}\n\n\g<1>\n\n\g<2>", # add line breaks to avoid stacking replacements +) diff --git a/setup.py b/setup.py index 9e12d72..2118f25 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ name = "google-cloud-audit-log" description = "Google Cloud Audit Protos" -version = "0.2.1" +version = "0.2.2" release_status = "Development Status :: 4 - Beta" dependencies = [ "protobuf >= 3.6.0, <4.0.0dev",