From dff37867e568f172f79b5b0244b47a55f9613cf5 Mon Sep 17 00:00:00 2001 From: Christian Schaible Date: Thu, 18 Jul 2024 14:09:07 +0200 Subject: [PATCH] Add event source, region and container reference to audit event and replace wrapping protobuf message type with cloud event wrapper --- audit/api/api.go | 50 +- audit/api/api_common.go | 44 +- audit/api/api_common_test.go | 54 +-- audit/api/api_legacy.go | 38 +- audit/api/api_mock.go | 24 +- audit/api/api_mock_test.go | 10 +- audit/api/api_routable.go | 45 +- audit/api/api_routable_test.go | 42 +- audit/api/test_data.go | 13 + audit/messaging/messaging.go | 15 +- audit/messaging/messaging_test.go | 8 +- gen/go/audit/v1/audit_event.pb.go | 442 ++++++++++++------ gen/go/audit/v1/audit_event.pb.validate.go | 62 +++ gen/go/audit/v1/common.pb.go | 285 +++++++++++ ...t.pb.validate.go => common.pb.validate.go} | 54 +-- gen/go/audit/v1/event.pb.go | 166 ------- gen/go/audit/v1/routable_event.pb.go | 381 ++++----------- gen/go/audit/v1/routable_event.pb.validate.go | 104 ----- proto/audit/v1/audit_event.proto | 47 +- proto/audit/v1/common.proto | 32 ++ proto/audit/v1/event.proto | 17 - proto/audit/v1/routable_event.proto | 25 +- 22 files changed, 1022 insertions(+), 936 deletions(-) create mode 100644 gen/go/audit/v1/common.pb.go rename gen/go/audit/v1/{event.pb.validate.go => common.pb.validate.go} (53%) delete mode 100644 gen/go/audit/v1/event.pb.go create mode 100644 proto/audit/v1/common.proto delete mode 100644 proto/audit/v1/event.proto diff --git a/audit/api/api.go b/audit/api/api.go index 1f43266..c1ed7ad 100644 --- a/audit/api/api.go +++ b/audit/api/api.go @@ -2,6 +2,7 @@ package api import ( "context" + "time" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/gen/go/audit/v1" @@ -58,13 +59,13 @@ type AuditApi interface { visibility auditV1.Visibility, routingIdentifier *RoutingIdentifier, objectIdentifier *auditV1.ObjectIdentifier, - ) (SerializedPayload, error) + ) (*CloudEvent, error) // Send the serialized content as byte array to the audit log system. Send( ctx context.Context, routingIdentifier *RoutingIdentifier, - serializedPayload *SerializedPayload, + serializedPayload *CloudEvent, ) error } @@ -74,14 +75,47 @@ type ProtobufValidator interface { Validate(msg proto.Message) error } -// SerializedPayload is an abstraction for serialized content -type SerializedPayload interface { +// CloudEvent is a representation of a cloudevents.io object. +// +// More information about the schema and attribute semantics can be found here: +// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#required-attributes +type CloudEvent struct { - // GetPayload returns the actual payload as byte array - GetPayload() []byte + // The version of the CloudEvents specification which the event uses. + // This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 + // when referring to this version of the specification. + // + // Currently, this attribute will only have the 'major' and 'minor' version numbers included in it. + // This allows for 'patch' changes to the specification to be made without changing this property's + // value in the serialization. + specVersion string - // GetContentType returns the content type of the payload - GetContentType() string + // The source system uri-reference. Producers MUST ensure that source + id is unique for each distinct event. + source string + + // Identifier of the event. Producers MUST ensure that source + id is unique for each distinct event. + // If a duplicate event is re-sent (e.g. due to a network error) it MAY have the same id. + // Consumers MAY assume that Events with identical source and id are duplicates. + id string + + // The time when the event happened + time time.Time + + // The content type of the payload + // Examples could be: + // - application/cloudevents+json + // - application/cloudevents+json; charset=UTF-8 + // - application/cloudevents-batch+json + // - application/cloudevents+protobuf + // - application/cloudevents+avro + // Source: https://github.com/cloudevents/spec/blob/main/cloudevents/formats/protobuf-format.md + dataContentType string + + // The object type (i.e. the fully qualified protobuf type name) + dataType string + + // The serialized payload + data []byte } // RoutingIdentifierType is an enumeration of allowed identifier types. diff --git a/audit/api/api_common.go b/audit/api/api_common.go index ed054b7..0a36420 100644 --- a/audit/api/api_common.go +++ b/audit/api/api_common.go @@ -131,38 +131,13 @@ func validateAndSerializePartially( return &routableEvent, nil } -func serializeToProtobufMessage(routableEvent *auditV1.RoutableAuditEvent) (SerializedPayload, error) { - // Serialize routable event - routableEventBytes, err := proto.Marshal(routableEvent) - if err != nil { - return nil, err - } - - // Package the routable event with information about the type in a message - message := auditV1.ProtobufMessage{ - Value: routableEventBytes, - ProtobufType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()), - } - - // Serialize message - messageBytes, err := proto.Marshal(&message) - if err != nil { - return nil, err - } - - return &routablePayload{ - payload: messageBytes, - contentType: ContentTypeProtobuf, - }, nil -} - // Send implements AuditApi.Send func send( topicNameResolver *TopicNameResolver, messagingApi *messaging.MessagingApi, ctx context.Context, routingIdentifier *RoutingIdentifier, - serializedPayload *SerializedPayload, + cloudEvent *CloudEvent, ) error { if topicNameResolver == nil { @@ -171,7 +146,7 @@ func send( if messagingApi == nil { return ErrMessagingApiNil } - if serializedPayload == nil { + if cloudEvent == nil { return ErrSerializedPayloadNil } @@ -180,5 +155,18 @@ func send( return err } - return (*messagingApi).Send(ctx, topic, (*serializedPayload).GetPayload(), (*serializedPayload).GetContentType()) + applicationAttributes := make(map[string]any) + applicationAttributes["cloudEvents:specversion"] = cloudEvent.specVersion + applicationAttributes["cloudEvents:source"] = cloudEvent.source + applicationAttributes["cloudEvents:id"] = cloudEvent.id + applicationAttributes["cloudEvents:time"] = cloudEvent.time.UnixMilli() + applicationAttributes["cloudEvents:datacontenttype"] = cloudEvent.dataContentType + applicationAttributes["cloudEvents:type"] = cloudEvent.dataType + + return (*messagingApi).Send( + ctx, + topic, + (*cloudEvent).data, + (*cloudEvent).dataContentType, + applicationAttributes) } diff --git a/audit/api/api_common_test.go b/audit/api/api_common_test.go index 84ff020..3fc0391 100644 --- a/audit/api/api_common_test.go +++ b/audit/api/api_common_test.go @@ -3,7 +3,6 @@ package api import ( "context" "errors" - "fmt" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/wrapperspb" "testing" @@ -23,8 +22,15 @@ type MessagingApiMock struct { mock.Mock } -func (m *MessagingApiMock) Send(ctx context.Context, topic string, data []byte, contentType string) error { - args := m.Called(ctx, topic, data, contentType) +func (m *MessagingApiMock) Send( + ctx context.Context, + topic string, + data []byte, + contentType string, + applicationProperties map[string]any, +) error { + + args := m.Called(ctx, topic, data, contentType, applicationProperties) return args.Error(0) } @@ -111,6 +117,8 @@ func Test_ValidateAndSerializePartially_AuditEventSequenceNumber(t *testing.T) { t.Run("Sequence number not set", func(t *testing.T) { event := &auditV1.AuditEvent{ + EventSource: "resource-manager", + Region: auditV1.Region_REGION_EU01, EventName: "ORGANIZATION_CREATED", EventTimeStamp: timestamppb.New(time.Now()), EventTrigger: auditV1.EventTrigger_EVENT_TRIGGER_EVENT, @@ -129,6 +137,7 @@ func Test_ValidateAndSerializePartially_AuditEventSequenceNumber(t *testing.T) { Identifier: identifier.String(), Type: auditV1.ObjectType_OBJECT_TYPE_ORGANIZATION, } + event.ResourceContainerReference = &auditV1.AuditEvent_ObjectIdentifier{ObjectIdentifier: objectIdentifier} _, err := validateAndSerializePartially( &validator, event, auditV1.Visibility_VISIBILITY_PUBLIC, routingIdentifier, objectIdentifier) @@ -278,34 +287,6 @@ func Test_ValidateAndSerializePartially_SystemEvent(t *testing.T) { } } -func Test_SerializeToProtobufMessage(t *testing.T) { - validator := NewValidator(t) - - // Create test data - event, identifier, objectIdentifier := NewOrganizationAuditEventWithDetails() - - // Serialize to routable event - routableEvent, err := validateAndSerializePartially( - &validator, event, auditV1.Visibility_VISIBILITY_PUBLIC, identifier, objectIdentifier) - assert.NoError(t, err) - - // Serialize to protobuf message - serializedPayload, err := serializeToProtobufMessage(routableEvent) - assert.NoError(t, err) - assert.Equal(t, serializedPayload.GetContentType(), ContentTypeProtobuf) - - // Deserialize - var deserializedEvent auditV1.ProtobufMessage - assert.NoError(t, proto.Unmarshal(serializedPayload.GetPayload(), &deserializedEvent)) - - expectedProtobufType := fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()) - assert.Equal(t, expectedProtobufType, deserializedEvent.ProtobufType) - - var deserializedRoutableEvent auditV1.RoutableAuditEvent - assert.NoError(t, proto.Unmarshal(deserializedEvent.Value, &deserializedRoutableEvent)) - assert.True(t, proto.Equal(routableEvent, &deserializedRoutableEvent)) -} - func Test_Send_TopicNameResolverNil(t *testing.T) { err := send(nil, nil, context.Background(), nil, nil) assert.ErrorIs(t, err, ErrTopicNameResolverNil) @@ -318,10 +299,10 @@ func Test_Send_TopicNameResolutionError(t *testing.T) { topicNameResolverMock.On("Resolve", mock.Anything).Return("topic", expectedError) var topicNameResolver TopicNameResolver = &topicNameResolverMock - var serializedPayload SerializedPayload = &routablePayload{} + var cloudEvent = CloudEvent{} var messagingApi messaging.MessagingApi = &messaging.AmqpMessagingApi{} - err := send(&topicNameResolver, &messagingApi, context.Background(), nil, &serializedPayload) + err := send(&topicNameResolver, &messagingApi, context.Background(), nil, &cloudEvent) assert.ErrorIs(t, err, expectedError) } @@ -343,12 +324,11 @@ func Test_Send(t *testing.T) { topicNameResolverMock.On("Resolve", mock.Anything).Return("topic", nil) var topicNameResolver TopicNameResolver = &topicNameResolverMock - var serializedPayload SerializedPayload = &routablePayload{} - messagingApiMock := MessagingApiMock{} - messagingApiMock.On("Send", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + messagingApiMock.On("Send", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) var messagingApi messaging.MessagingApi = &messagingApiMock - assert.NoError(t, send(&topicNameResolver, &messagingApi, context.Background(), nil, &serializedPayload)) + var cloudEvent = CloudEvent{} + assert.NoError(t, send(&topicNameResolver, &messagingApi, context.Background(), nil, &cloudEvent)) assert.True(t, messagingApiMock.AssertNumberOfCalls(t, "Send", 1)) } diff --git a/audit/api/api_legacy.go b/audit/api/api_legacy.go index ad515bc..f2d36aa 100644 --- a/audit/api/api_legacy.go +++ b/audit/api/api_legacy.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "errors" + "fmt" + "github.com/google/uuid" "time" "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/audit/messaging" @@ -12,21 +14,6 @@ import ( "google.golang.org/protobuf/proto" ) -// legacyPayload implements SerializedPayload. -type legacyPayload struct { - payload []byte -} - -// GetPayload implements SerializedPayload.GetPayload. -func (p *legacyPayload) GetPayload() []byte { - return p.payload -} - -// GetContentType implements SerializedPayload.GetContentType. -func (p *legacyPayload) GetContentType() string { - return "application/json" -} - // LegacyTopicNameResolver implements TopicNameResolver. // A hard-coded topic name is used, routing identifiers are ignored. type LegacyTopicNameResolver struct { @@ -87,12 +74,12 @@ func (a *LegacyAuditApi) Log( objectIdentifier *auditV1.ObjectIdentifier, ) error { - serializedPayload, err := a.ValidateAndSerialize(event, visibility, routingIdentifier, objectIdentifier) + cloudEvent, err := a.ValidateAndSerialize(event, visibility, routingIdentifier, objectIdentifier) if err != nil { return err } - return a.Send(ctx, routingIdentifier, &serializedPayload) + return a.Send(ctx, routingIdentifier, cloudEvent) } // ValidateAndSerialize implements AuditApi.ValidateAndSerialize. @@ -102,7 +89,7 @@ func (a *LegacyAuditApi) ValidateAndSerialize( visibility auditV1.Visibility, routingIdentifier *RoutingIdentifier, objectIdentifier *auditV1.ObjectIdentifier, -) (SerializedPayload, error) { +) (*CloudEvent, error) { routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routingIdentifier, objectIdentifier) if err != nil { @@ -121,17 +108,26 @@ func (a *LegacyAuditApi) ValidateAndSerialize( return nil, err } - return &legacyPayload{payload: legacyBytes}, nil + message := CloudEvent{ + specVersion: "1.0", + source: event.EventSource, + id: uuid.NewString(), + time: event.EventTimeStamp.AsTime(), + dataContentType: "application/cloudevents+protobuf", + dataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()), + data: legacyBytes, + } + return &message, nil } // Send implements AuditApi.Send func (a *LegacyAuditApi) Send( ctx context.Context, routingIdentifier *RoutingIdentifier, - serializedPayload *SerializedPayload, + cloudEvent *CloudEvent, ) error { - return send(a.topicNameResolver, a.messagingApi, ctx, routingIdentifier, serializedPayload) + return send(a.topicNameResolver, a.messagingApi, ctx, routingIdentifier, cloudEvent) } // convertAndSerializeIntoLegacyFormat converts the protobuf events into the json serialized legacy audit log format diff --git a/audit/api/api_mock.go b/audit/api/api_mock.go index 279ae5f..b977bbb 100644 --- a/audit/api/api_mock.go +++ b/audit/api/api_mock.go @@ -2,6 +2,9 @@ package api import ( "context" + "fmt" + "github.com/google/uuid" + "google.golang.org/protobuf/proto" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/gen/go/audit/v1" @@ -43,17 +46,32 @@ func (a *MockAuditApi) ValidateAndSerialize( visibility auditV1.Visibility, routingIdentifier *RoutingIdentifier, objectIdentifier *auditV1.ObjectIdentifier, -) (SerializedPayload, error) { +) (*CloudEvent, error) { routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routingIdentifier, objectIdentifier) if err != nil { return nil, err } - return serializeToProtobufMessage(routableEvent) + routableEventBytes, err := proto.Marshal(routableEvent) + if err != nil { + return nil, err + } + + message := CloudEvent{ + specVersion: "1.0", + source: event.EventSource, + id: uuid.NewString(), + time: event.EventTimeStamp.AsTime(), + dataContentType: "application/cloudevents+protobuf", + dataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()), + data: routableEventBytes, + } + + return &message, nil } // Send implements AuditApi.Send -func (a *MockAuditApi) Send(context.Context, *RoutingIdentifier, *SerializedPayload) error { +func (a *MockAuditApi) Send(context.Context, *RoutingIdentifier, *CloudEvent) error { return nil } diff --git a/audit/api/api_mock_test.go b/audit/api/api_mock_test.go index bb8a1e0..ff6f42d 100644 --- a/audit/api/api_mock_test.go +++ b/audit/api/api_mock_test.go @@ -25,13 +25,13 @@ func TestMockAuditApi_Log(t *testing.T) { t.Run("ValidateAndSerialize", func(t *testing.T) { visibility := auditV1.Visibility_VISIBILITY_PUBLIC - serializedPayload, err := (*auditApi).ValidateAndSerialize( + cloudEvent, err := (*auditApi).ValidateAndSerialize( event, visibility, routingIdentifier, objectIdentifier) assert.NoError(t, err) - validateProtobufMessagePayload( - t, serializedPayload.GetPayload(), routingIdentifier, objectIdentifier, event, event.EventName, visibility) + validateRoutableEventPayload( + t, cloudEvent.data, routingIdentifier, objectIdentifier, event, event.EventName, visibility) }) t.Run("ValidateAndSerialize event nil", func(t *testing.T) { @@ -42,8 +42,8 @@ func TestMockAuditApi_Log(t *testing.T) { }) t.Run("Send", func(t *testing.T) { - var payload SerializedPayload = &routablePayload{} + var cloudEvent = CloudEvent{} - assert.Nil(t, (*auditApi).Send(context.Background(), routingIdentifier, &payload)) + assert.Nil(t, (*auditApi).Send(context.Background(), routingIdentifier, &cloudEvent)) }) } diff --git a/audit/api/api_routable.go b/audit/api/api_routable.go index 112933c..b276bee 100644 --- a/audit/api/api_routable.go +++ b/audit/api/api_routable.go @@ -4,27 +4,13 @@ import ( "context" "errors" "fmt" + "github.com/google/uuid" + "google.golang.org/protobuf/proto" "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/audit/messaging" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/gen/go/audit/v1" ) -// routablePayload implements SerializedPayload. -type routablePayload struct { - payload []byte - contentType string -} - -// GetPayload implements SerializedPayload.GetPayload. -func (p *routablePayload) GetPayload() []byte { - return p.payload -} - -// GetContentType implements SerializedPayload.GetContentType. -func (p *routablePayload) GetContentType() string { - return p.contentType -} - // routableTopicNameResolver implements TopicNameResolver. // Resolves topic names by concatenating topic type prefixes with routing identifiers. type routableTopicNameResolver struct { @@ -104,12 +90,12 @@ func (a *routableAuditApi) Log( objectIdentifier *auditV1.ObjectIdentifier, ) error { - serializedPayload, err := a.ValidateAndSerialize(event, visibility, routingIdentifier, objectIdentifier) + cloudEvent, err := a.ValidateAndSerialize(event, visibility, routingIdentifier, objectIdentifier) if err != nil { return err } - return a.Send(ctx, routingIdentifier, &serializedPayload) + return a.Send(ctx, routingIdentifier, cloudEvent) } // ValidateAndSerialize implements AuditApi.ValidateAndSerialize @@ -118,7 +104,7 @@ func (a *routableAuditApi) ValidateAndSerialize( visibility auditV1.Visibility, routingIdentifier *RoutingIdentifier, objectIdentifier *auditV1.ObjectIdentifier, -) (SerializedPayload, error) { +) (*CloudEvent, error) { routableEvent, err := validateAndSerializePartially( a.validator, @@ -131,15 +117,30 @@ func (a *routableAuditApi) ValidateAndSerialize( return nil, err } - return serializeToProtobufMessage(routableEvent) + routableEventBytes, err := proto.Marshal(routableEvent) + if err != nil { + return nil, err + } + + message := CloudEvent{ + specVersion: "1.0", + source: event.EventSource, + id: uuid.NewString(), + time: event.EventTimeStamp.AsTime(), + dataContentType: "application/cloudevents+protobuf", + dataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()), + data: routableEventBytes, + } + + return &message, nil } // Send implements AuditApi.Send func (a *routableAuditApi) Send( ctx context.Context, routingIdentifier *RoutingIdentifier, - serializedPayload *SerializedPayload, + cloudEvent *CloudEvent, ) error { - return send(a.topicNameResolver, a.messagingApi, ctx, routingIdentifier, serializedPayload) + return send(a.topicNameResolver, a.messagingApi, ctx, routingIdentifier, cloudEvent) } diff --git a/audit/api/api_routable_test.go b/audit/api/api_routable_test.go index cb42489..bd8c586 100644 --- a/audit/api/api_routable_test.go +++ b/audit/api/api_routable_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/google/uuid" "testing" "time" @@ -302,12 +303,18 @@ func TestRoutableAuditApi(t *testing.T) { // Check topic name assert.Equal(t, systemTopicName, *message.Properties.To) - // Check deserialized message - var protobufMessage auditV1.ProtobufMessage - assert.NoError(t, proto.Unmarshal(message.Data[0], &protobufMessage)) - assert.Equal(t, "audit.v1.RoutableAuditEvent", protobufMessage.ProtobufType) + // Check cloud event properties + applicationProperties := message.ApplicationProperties + assert.Equal(t, "1.0", applicationProperties["cloudEvents:specversion"]) + assert.Equal(t, "resource-manager", applicationProperties["cloudEvents:source"]) + _, isUuid := uuid.Parse(fmt.Sprintf("%s", applicationProperties["cloudEvents:id"])) + assert.True(t, true, isUuid) + assert.Equal(t, event.EventTimeStamp.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"]) + assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"]) + assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"]) - validateProtobufMessagePayload( + // Check deserialized message + validateRoutableEventPayload( t, message.Data[0], nil, @@ -370,16 +377,22 @@ func validateSentEvent( fmt.Sprintf("topic://%s/%s", topicPrefix, routingIdentifier.Identifier), *message.Properties.To) - // Check deserialized message - var protobufMessage auditV1.ProtobufMessage - assert.NoError(t, proto.Unmarshal(message.Data[0], &protobufMessage)) - assert.Equal(t, "audit.v1.RoutableAuditEvent", protobufMessage.ProtobufType) + // Check cloud event properties + applicationProperties := message.ApplicationProperties + assert.Equal(t, "1.0", applicationProperties["cloudEvents:specversion"]) + assert.Equal(t, "resource-manager", applicationProperties["cloudEvents:source"]) + _, isUuid := uuid.Parse(fmt.Sprintf("%s", applicationProperties["cloudEvents:id"])) + assert.True(t, true, isUuid) + assert.Equal(t, event.EventTimeStamp.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"]) + assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"]) + assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"]) - validateProtobufMessagePayload( + // Check deserialized message + validateRoutableEventPayload( t, message.Data[0], routingIdentifier, objectIdentifier, event, eventName, visibility) } -func validateProtobufMessagePayload( +func validateRoutableEventPayload( t *testing.T, payload []byte, routingIdentifier *RoutingIdentifier, @@ -389,14 +402,9 @@ func validateProtobufMessagePayload( visibility auditV1.Visibility, ) { - // Check deserialized message - var protobufMessage auditV1.ProtobufMessage - assert.NoError(t, proto.Unmarshal(payload, &protobufMessage)) - assert.Equal(t, "audit.v1.RoutableAuditEvent", protobufMessage.ProtobufType) - // Check routable audit event parameters var routableAuditEvent auditV1.RoutableAuditEvent - assert.NoError(t, proto.Unmarshal(protobufMessage.Value, &routableAuditEvent)) + assert.NoError(t, proto.Unmarshal(payload, &routableAuditEvent)) assert.Equal(t, eventName, routableAuditEvent.EventName) assert.Equal(t, visibility, routableAuditEvent.Visibility) diff --git a/audit/api/test_data.go b/audit/api/test_data.go index 8758450..7dc8a68 100644 --- a/audit/api/test_data.go +++ b/audit/api/test_data.go @@ -23,6 +23,8 @@ func NewOrganizationAuditEvent( ) { auditEvent := &auditV1.AuditEvent{ + EventSource: "resource-manager", + Region: auditV1.Region_REGION_EU01, SequenceNumber: wrapperspb.Int64(0), EventName: "ORGANIZATION_CREATED", EventTimeStamp: timestamppb.New(time.Now()), @@ -42,6 +44,7 @@ func NewOrganizationAuditEvent( Identifier: identifier.String(), Type: auditV1.ObjectType_OBJECT_TYPE_ORGANIZATION, } + auditEvent.ResourceContainerReference = &auditV1.AuditEvent_ObjectIdentifier{ObjectIdentifier: objectIdentifier} if customization != nil { (*customization)(auditEvent, routingIdentifier, objectIdentifier) @@ -107,6 +110,8 @@ func NewFolderAuditEvent( ) { auditEvent := &auditV1.AuditEvent{ + EventSource: "resource-manager", + Region: auditV1.Region_REGION_EU01, SequenceNumber: wrapperspb.Int64(0), EventName: "FOLDER_CREATED", EventTimeStamp: timestamppb.New(time.Now()), @@ -125,6 +130,7 @@ func NewFolderAuditEvent( Identifier: uuid.New().String(), Type: auditV1.ObjectType_OBJECT_TYPE_FOLDER, } + auditEvent.ResourceContainerReference = &auditV1.AuditEvent_ObjectIdentifier{ObjectIdentifier: objectIdentifier} if customization != nil { (*customization)(auditEvent, routingIdentifier, objectIdentifier) @@ -145,6 +151,8 @@ func NewProjectAuditEvent( ) { auditEvent := &auditV1.AuditEvent{ + EventSource: "resource-manager", + Region: auditV1.Region_REGION_EU01, SequenceNumber: wrapperspb.Int64(0), EventName: "PROJECT_CREATED", EventTimeStamp: timestamppb.New(time.Now()), @@ -164,6 +172,7 @@ func NewProjectAuditEvent( Identifier: identifier.String(), Type: auditV1.ObjectType_OBJECT_TYPE_PROJECT, } + auditEvent.ResourceContainerReference = &auditV1.AuditEvent_ObjectIdentifier{ObjectIdentifier: objectIdentifier} if customization != nil { (*customization)(auditEvent, routingIdentifier, objectIdentifier) @@ -176,6 +185,8 @@ func NewSystemAuditEvent( customization *func(*auditV1.AuditEvent)) *auditV1.AuditEvent { auditEvent := &auditV1.AuditEvent{ + EventSource: "resource-manager", + Region: auditV1.Region_REGION_EU01, SequenceNumber: wrapperspb.Int64(0), EventName: "SYSTEM_CHANGED", EventTimeStamp: timestamppb.New(time.Now()), @@ -184,6 +195,8 @@ func NewSystemAuditEvent( Id: uuid.NewString(), }, } + auditEvent.ResourceContainerReference = &auditV1.AuditEvent_ObjectName{ + ObjectName: auditV1.ObjectName_OBJECT_NAME_SYSTEM} if customization != nil { (*customization)(auditEvent) diff --git a/audit/messaging/messaging.go b/audit/messaging/messaging.go index af52849..a2e794c 100644 --- a/audit/messaging/messaging.go +++ b/audit/messaging/messaging.go @@ -7,7 +7,6 @@ import ( "log/slog" "strings" "time" - //"dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/audit/api" ) // Default connection timeout for the AMQP connection @@ -23,9 +22,10 @@ type MessagingApi interface { // * topic - the messaging topic where to send the data to // * data - the serialized data as byte array // * contentType - the contentType of the serialized data + // * applicationProperties - properties to send with the message (i.e. cloud event headers) // // It returns technical errors for connection issues or sending problems. - Send(ctx context.Context, topic string, data []byte, contentType string) error + Send(ctx context.Context, topic string, data []byte, contentType string, applicationProperties map[string]any) error } // AmqpConfig provides AMQP connection related parameters. @@ -124,8 +124,8 @@ func (a *AmqpMessagingApi) connect() error { // Send implements MessagingApi.Send. // If errors occur the connection to the messaging system will be closed and re-established. -func (a *AmqpMessagingApi) Send(ctx context.Context, topic string, data []byte, contentType string) error { - err := a.trySend(ctx, topic, data, contentType) +func (a *AmqpMessagingApi) Send(ctx context.Context, topic string, data []byte, contentType string, applicationProperties map[string]any) error { + err := a.trySend(ctx, topic, data, contentType, applicationProperties) if err == nil { return nil } @@ -138,11 +138,11 @@ func (a *AmqpMessagingApi) Send(ctx context.Context, topic string, data []byte, return err } - return a.trySend(ctx, topic, data, contentType) + return a.trySend(ctx, topic, data, contentType, applicationProperties) } // trySend actually sends the given data as amqp.Message to the messaging system. -func (a *AmqpMessagingApi) trySend(ctx context.Context, topic string, data []byte, contentType string) error { +func (a *AmqpMessagingApi) trySend(ctx context.Context, topic string, data []byte, contentType string, applicationProperties map[string]any) error { if !strings.HasPrefix(topic, AmqpTopicPrefix) { return fmt.Errorf( "topic %q name lacks mandatory prefix %q", @@ -165,7 +165,8 @@ func (a *AmqpMessagingApi) trySend(ctx context.Context, topic string, data []byt To: &topic, ContentType: &contentType, }, - Data: bytes, + ApplicationProperties: applicationProperties, + Data: bytes, } err = (*sender).Send(ctx, &message, nil) diff --git a/audit/messaging/messaging_test.go b/audit/messaging/messaging_test.go index 025787d..99e1b1d 100644 --- a/audit/messaging/messaging_test.go +++ b/audit/messaging/messaging_test.go @@ -65,7 +65,7 @@ func TestAmqpMessagingApi_Send(t *testing.T) { api, err := NewAmqpMessagingApi(AmqpConfig{URL: solaceContainer.AmqpConnectionString}) assert.NoError(t, err) - err = (*api).Send(ctx, "topic-name", []byte{}, "application/json") + err = (*api).Send(ctx, "topic-name", []byte{}, "application/json", make(map[string]any)) assert.EqualError(t, err, "topic \"topic-name\" name lacks mandatory prefix \"topic://\"") }) @@ -98,7 +98,7 @@ func TestAmqpMessagingApi_Send(t *testing.T) { // First the session is closed as it returns the expected error // Then the retry mechanism restarts the connection and successfully sends the data value := "test" - err = (*api).Send(ctx, topicName, []byte(value), "application/json") + err = (*api).Send(ctx, topicName, []byte(value), "application/json", make(map[string]any)) assert.NoError(t, err) // Check that the mock was called @@ -130,7 +130,7 @@ func TestAmqpMessagingApi_Send(t *testing.T) { // Instantiate mock sender senderMock := AmqpSenderMock{} - senderMock.On("Send", mock.Anything, mock.Anything, mock.Anything).Return(expectedError) + senderMock.On("Send", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(expectedError) senderMock.On("Close", mock.Anything).Return(nil) var amqpSender AmqpSender = &senderMock @@ -146,7 +146,7 @@ func TestAmqpMessagingApi_Send(t *testing.T) { // First the sender and session are closed as the sender returns the expected error // Then the retry mechanism restarts the connection and successfully sends the data value := "test" - err = (*api).Send(ctx, topicName, []byte(value), "application/json") + err = (*api).Send(ctx, topicName, []byte(value), "application/json", make(map[string]any)) assert.NoError(t, err) // Check that the mocks were called diff --git a/gen/go/audit/v1/audit_event.pb.go b/gen/go/audit/v1/audit_event.pb.go index bd9a71e..d8c345e 100644 --- a/gen/go/audit/v1/audit_event.pb.go +++ b/gen/go/audit/v1/audit_event.pb.go @@ -79,6 +79,52 @@ func (EventTrigger) EnumDescriptor() ([]byte, []int) { return file_audit_v1_audit_event_proto_rawDescGZIP(), []int{0} } +type Region int32 + +const ( + Region_REGION_UNSPECIFIED Region = 0 + Region_REGION_EU01 Region = 1 +) + +// Enum value maps for Region. +var ( + Region_name = map[int32]string{ + 0: "REGION_UNSPECIFIED", + 1: "REGION_EU01", + } + Region_value = map[string]int32{ + "REGION_UNSPECIFIED": 0, + "REGION_EU01": 1, + } +) + +func (x Region) Enum() *Region { + p := new(Region) + *p = x + return p +} + +func (x Region) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Region) Descriptor() protoreflect.EnumDescriptor { + return file_audit_v1_audit_event_proto_enumTypes[1].Descriptor() +} + +func (Region) Type() protoreflect.EnumType { + return &file_audit_v1_audit_event_proto_enumTypes[1] +} + +func (x Region) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Region.Descriptor instead. +func (Region) EnumDescriptor() ([]byte, []int) { + return file_audit_v1_audit_event_proto_rawDescGZIP(), []int{1} +} + type Principal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -284,28 +330,39 @@ type AuditEvent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Name of the source system + EventSource string `protobuf:"bytes,1,opt,name=event_source,json=eventSource,proto3" json:"event_source,omitempty"` + Region Region `protobuf:"varint,2,opt,name=region,proto3,enum=audit.v1.Region" json:"region,omitempty"` // Sequence number of event sent by the service to identify missing events. - SequenceNumber *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"` + SequenceNumber *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"` // Functional event name with pattern _, e.g. ORGANIZATION_CREATED // Important for filtering and translation / verbalization of event types // in the UI or data sinks. - EventName string `protobuf:"bytes,2,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` + EventName string `protobuf:"bytes,4,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` // The time when the event happened. Must not be a value in the future. - EventTimeStamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=event_time_stamp,json=eventTimeStamp,proto3" json:"event_time_stamp,omitempty"` - EventTrigger EventTrigger `protobuf:"varint,4,opt,name=event_trigger,json=eventTrigger,proto3,enum=audit.v1.EventTrigger" json:"event_trigger,omitempty"` + EventTimeStamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=event_time_stamp,json=eventTimeStamp,proto3" json:"event_time_stamp,omitempty"` + EventTrigger EventTrigger `protobuf:"varint,6,opt,name=event_trigger,json=eventTrigger,proto3,enum=audit.v1.EventTrigger" json:"event_trigger,omitempty"` // Request details - mandatory if event_trigger is set to "EVENT_REQUEST" - Request *RequestDetails `protobuf:"bytes,5,opt,name=request,proto3,oneof" json:"request,omitempty"` - Initiator *Principal `protobuf:"bytes,6,opt,name=initiator,proto3" json:"initiator,omitempty"` + Request *RequestDetails `protobuf:"bytes,7,opt,name=request,proto3,oneof" json:"request,omitempty"` + Initiator *Principal `protobuf:"bytes,8,opt,name=initiator,proto3" json:"initiator,omitempty"` // List of service account delegation principals. // -> Chain from service account to the actual user who initiated the action. - Principals []*Principal `protobuf:"bytes,7,rep,name=principals,proto3" json:"principals,omitempty"` - ResourceId *string `protobuf:"bytes,8,opt,name=resource_id,json=resourceId,proto3,oneof" json:"resource_id,omitempty"` - ResourceName *string `protobuf:"bytes,9,opt,name=resource_name,json=resourceName,proto3,oneof" json:"resource_name,omitempty"` - CorrelationId *string `protobuf:"bytes,10,opt,name=correlation_id,json=correlationId,proto3,oneof" json:"correlation_id,omitempty"` + Principals []*Principal `protobuf:"bytes,9,rep,name=principals,proto3" json:"principals,omitempty"` + // Identifier the audit log event refers to + // + // Types that are assignable to ResourceContainerReference: + // + // *AuditEvent_ObjectName + // *AuditEvent_ObjectIdentifier + ResourceContainerReference isAuditEvent_ResourceContainerReference `protobuf_oneof:"resource_container_reference"` + // The identifier of the actual resource (e.g. a VM) + ResourceId *string `protobuf:"bytes,12,opt,name=resource_id,json=resourceId,proto3,oneof" json:"resource_id,omitempty"` + ResourceName *string `protobuf:"bytes,13,opt,name=resource_name,json=resourceName,proto3,oneof" json:"resource_name,omitempty"` + CorrelationId *string `protobuf:"bytes,14,opt,name=correlation_id,json=correlationId,proto3,oneof" json:"correlation_id,omitempty"` // Result of the operation to publish with the event - Result *structpb.Struct `protobuf:"bytes,11,opt,name=result,proto3,oneof" json:"result,omitempty"` + Result *structpb.Struct `protobuf:"bytes,15,opt,name=result,proto3,oneof" json:"result,omitempty"` // Additional information to publish with the event - Details *structpb.Struct `protobuf:"bytes,12,opt,name=details,proto3,oneof" json:"details,omitempty"` + Details *structpb.Struct `protobuf:"bytes,16,opt,name=details,proto3,oneof" json:"details,omitempty"` } func (x *AuditEvent) Reset() { @@ -340,6 +397,20 @@ func (*AuditEvent) Descriptor() ([]byte, []int) { return file_audit_v1_audit_event_proto_rawDescGZIP(), []int{3} } +func (x *AuditEvent) GetEventSource() string { + if x != nil { + return x.EventSource + } + return "" +} + +func (x *AuditEvent) GetRegion() Region { + if x != nil { + return x.Region + } + return Region_REGION_UNSPECIFIED +} + func (x *AuditEvent) GetSequenceNumber() *wrapperspb.Int64Value { if x != nil { return x.SequenceNumber @@ -389,6 +460,27 @@ func (x *AuditEvent) GetPrincipals() []*Principal { return nil } +func (m *AuditEvent) GetResourceContainerReference() isAuditEvent_ResourceContainerReference { + if m != nil { + return m.ResourceContainerReference + } + return nil +} + +func (x *AuditEvent) GetObjectName() ObjectName { + if x, ok := x.GetResourceContainerReference().(*AuditEvent_ObjectName); ok { + return x.ObjectName + } + return ObjectName_OBJECT_NAME_UNSPECIFIED +} + +func (x *AuditEvent) GetObjectIdentifier() *ObjectIdentifier { + if x, ok := x.GetResourceContainerReference().(*AuditEvent_ObjectIdentifier); ok { + return x.ObjectIdentifier + } + return nil +} + func (x *AuditEvent) GetResourceId() string { if x != nil && x.ResourceId != nil { return *x.ResourceId @@ -424,6 +516,25 @@ func (x *AuditEvent) GetDetails() *structpb.Struct { return nil } +type isAuditEvent_ResourceContainerReference interface { + isAuditEvent_ResourceContainerReference() +} + +type AuditEvent_ObjectName struct { + // If it is a technical event not related to an organization, folder or project + // Will NOT be routed to the end-user, only for internal analysis -> + // Clarify what do in the router + ObjectName ObjectName `protobuf:"varint,10,opt,name=object_name,json=objectName,proto3,enum=audit.v1.ObjectName,oneof"` +} + +type AuditEvent_ObjectIdentifier struct { + ObjectIdentifier *ObjectIdentifier `protobuf:"bytes,11,opt,name=object_identifier,json=objectIdentifier,proto3,oneof"` +} + +func (*AuditEvent_ObjectName) isAuditEvent_ResourceContainerReference() {} + +func (*AuditEvent_ObjectIdentifier) isAuditEvent_ResourceContainerReference() {} + var File_audit_v1_audit_event_proto protoreflect.FileDescriptor var file_audit_v1_audit_event_proto_rawDesc = []byte{ @@ -437,118 +548,139 @@ var file_audit_v1_audit_event_proto_rawDesc = []byte{ 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x09, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, - 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, - 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x18, 0xff, 0x01, - 0x60, 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x08, - 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0xf0, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x65, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, - 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x08, 0x65, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x70, 0x01, 0x52, 0x0f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, - 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, - 0x01, 0x48, 0x00, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x88, 0x01, - 0x01, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x01, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x88, 0x01, 0x01, 0x12, - 0x30, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x02, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, - 0x01, 0x12, 0x31, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x4f, 0x0a, 0x0d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, - 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, - 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcb, 0x07, 0x0a, - 0x0a, 0x41, 0x75, 0x64, 0x69, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x59, 0x0a, 0x0f, 0x73, - 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x13, 0xba, 0x48, 0x10, 0xc8, 0x01, 0x01, 0x22, 0x0b, 0x28, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0xc8, - 0x01, 0x01, 0x72, 0x11, 0x32, 0x0f, 0x5e, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x5f, 0x5b, 0x41, - 0x2d, 0x5a, 0x5d, 0x2b, 0x24, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x51, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0xb2, 0x01, - 0x02, 0x38, 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x75, 0x64, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, - 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x37, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x75, 0x64, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x42, 0x06, - 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x12, 0x30, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, - 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x48, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x48, 0x02, 0x52, 0x0c, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x36, - 0x0a, 0x0e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, - 0xff, 0x01, 0x48, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, - 0x04, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x05, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x88, 0x01, 0x01, 0x3a, 0x7c, 0xba, 0x48, 0x79, 0x1a, 0x77, 0x0a, 0x0f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1b, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6d, 0x75, - 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x1a, 0x47, 0x74, 0x68, 0x69, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x3d, 0x3d, - 0x20, 0x33, 0x20, 0x26, 0x26, 0x20, 0x68, 0x61, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x21, 0x3d, - 0x20, 0x33, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, - 0x0a, 0x0c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x0a, - 0x0a, 0x08, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2a, 0x7e, 0x0a, 0x0c, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, - 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, - 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, - 0x47, 0x45, 0x52, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x10, 0x02, 0x12, - 0x19, 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, - 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, 0x42, 0x81, 0x01, 0x0a, 0x1c, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, 0x72, 0x7a, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, - 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x41, 0x75, 0x64, - 0x69, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0f, - 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x56, 0x31, 0xa2, - 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x41, 0x75, - 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x1a, 0x15, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x09, 0x50, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x25, + 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, + 0x48, 0x07, 0x72, 0x05, 0x18, 0xff, 0x01, 0x60, 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, + 0xf0, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, + 0x18, 0xff, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x36, 0x0a, + 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, + 0x72, 0x02, 0x70, 0x01, 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x70, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, + 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x48, 0x00, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x01, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x02, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0x4f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0xd7, 0x09, 0x0a, 0x0a, 0x41, 0x75, 0x64, 0x69, 0x74, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, + 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x10, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x0f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x13, 0xba, 0x48, 0x10, 0xc8, 0x01, + 0x01, 0x22, 0x0b, 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x52, 0x0e, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x38, + 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0xc8, 0x01, 0x01, 0x72, 0x11, 0x32, 0x0f, 0x5e, 0x5b, + 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x5f, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x24, 0x52, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0b, + 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0xb2, 0x01, 0x02, 0x38, 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x0d, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, + 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, + 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x48, 0x01, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x39, + 0x0a, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x09, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, + 0x61, 0x6c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x12, 0x37, + 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, + 0x18, 0xff, 0x01, 0x48, 0x02, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, + 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x48, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x0e, 0x63, 0x6f, + 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x48, 0x04, + 0x52, 0x0d, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, + 0x01, 0x01, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x05, 0x52, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x48, 0x06, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x88, 0x01, 0x01, + 0x3a, 0x7c, 0xba, 0x48, 0x79, 0x1a, 0x77, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, + 0x65, 0x20, 0x73, 0x65, 0x74, 0x1a, 0x47, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x20, 0x26, + 0x26, 0x20, 0x68, 0x61, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x21, 0x3d, 0x20, 0x33, 0x42, 0x25, + 0x0a, 0x1c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x05, + 0xba, 0x48, 0x02, 0x08, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2a, 0x7e, 0x0a, + 0x0c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, + 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, + 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, + 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, + 0x47, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, 0x2a, 0x31, 0x0a, + 0x06, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x47, 0x49, 0x4f, + 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x55, 0x30, 0x31, 0x10, 0x01, + 0x42, 0x81, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, 0x72, 0x7a, + 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x42, 0x0f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, + 0x64, 0x69, 0x74, 0x56, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x41, 0x75, + 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x14, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -563,35 +695,41 @@ func file_audit_v1_audit_event_proto_rawDescGZIP() []byte { return file_audit_v1_audit_event_proto_rawDescData } -var file_audit_v1_audit_event_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_audit_v1_audit_event_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_audit_v1_audit_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_audit_v1_audit_event_proto_goTypes = []interface{}{ (EventTrigger)(0), // 0: audit.v1.EventTrigger - (*Principal)(nil), // 1: audit.v1.Principal - (*RequestDetails)(nil), // 2: audit.v1.RequestDetails - (*RequestHeader)(nil), // 3: audit.v1.RequestHeader - (*AuditEvent)(nil), // 4: audit.v1.AuditEvent - (*structpb.Struct)(nil), // 5: google.protobuf.Struct - (*wrapperspb.Int64Value)(nil), // 6: google.protobuf.Int64Value - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (Region)(0), // 1: audit.v1.Region + (*Principal)(nil), // 2: audit.v1.Principal + (*RequestDetails)(nil), // 3: audit.v1.RequestDetails + (*RequestHeader)(nil), // 4: audit.v1.RequestHeader + (*AuditEvent)(nil), // 5: audit.v1.AuditEvent + (*structpb.Struct)(nil), // 6: google.protobuf.Struct + (*wrapperspb.Int64Value)(nil), // 7: google.protobuf.Int64Value + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (ObjectName)(0), // 9: audit.v1.ObjectName + (*ObjectIdentifier)(nil), // 10: audit.v1.ObjectIdentifier } var file_audit_v1_audit_event_proto_depIdxs = []int32{ - 5, // 0: audit.v1.RequestDetails.parameters:type_name -> google.protobuf.Struct - 5, // 1: audit.v1.RequestDetails.body:type_name -> google.protobuf.Struct - 3, // 2: audit.v1.RequestDetails.headers:type_name -> audit.v1.RequestHeader - 6, // 3: audit.v1.AuditEvent.sequence_number:type_name -> google.protobuf.Int64Value - 7, // 4: audit.v1.AuditEvent.event_time_stamp:type_name -> google.protobuf.Timestamp - 0, // 5: audit.v1.AuditEvent.event_trigger:type_name -> audit.v1.EventTrigger - 2, // 6: audit.v1.AuditEvent.request:type_name -> audit.v1.RequestDetails - 1, // 7: audit.v1.AuditEvent.initiator:type_name -> audit.v1.Principal - 1, // 8: audit.v1.AuditEvent.principals:type_name -> audit.v1.Principal - 5, // 9: audit.v1.AuditEvent.result:type_name -> google.protobuf.Struct - 5, // 10: audit.v1.AuditEvent.details:type_name -> google.protobuf.Struct - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 6, // 0: audit.v1.RequestDetails.parameters:type_name -> google.protobuf.Struct + 6, // 1: audit.v1.RequestDetails.body:type_name -> google.protobuf.Struct + 4, // 2: audit.v1.RequestDetails.headers:type_name -> audit.v1.RequestHeader + 1, // 3: audit.v1.AuditEvent.region:type_name -> audit.v1.Region + 7, // 4: audit.v1.AuditEvent.sequence_number:type_name -> google.protobuf.Int64Value + 8, // 5: audit.v1.AuditEvent.event_time_stamp:type_name -> google.protobuf.Timestamp + 0, // 6: audit.v1.AuditEvent.event_trigger:type_name -> audit.v1.EventTrigger + 3, // 7: audit.v1.AuditEvent.request:type_name -> audit.v1.RequestDetails + 2, // 8: audit.v1.AuditEvent.initiator:type_name -> audit.v1.Principal + 2, // 9: audit.v1.AuditEvent.principals:type_name -> audit.v1.Principal + 9, // 10: audit.v1.AuditEvent.object_name:type_name -> audit.v1.ObjectName + 10, // 11: audit.v1.AuditEvent.object_identifier:type_name -> audit.v1.ObjectIdentifier + 6, // 12: audit.v1.AuditEvent.result:type_name -> google.protobuf.Struct + 6, // 13: audit.v1.AuditEvent.details:type_name -> google.protobuf.Struct + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_audit_v1_audit_event_proto_init() } @@ -599,6 +737,7 @@ func file_audit_v1_audit_event_proto_init() { if File_audit_v1_audit_event_proto != nil { return } + file_audit_v1_common_proto_init() if !protoimpl.UnsafeEnabled { file_audit_v1_audit_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Principal); i { @@ -651,13 +790,16 @@ func file_audit_v1_audit_event_proto_init() { } file_audit_v1_audit_event_proto_msgTypes[0].OneofWrappers = []interface{}{} file_audit_v1_audit_event_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_audit_v1_audit_event_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_audit_v1_audit_event_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*AuditEvent_ObjectName)(nil), + (*AuditEvent_ObjectIdentifier)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_audit_v1_audit_event_proto_rawDesc, - NumEnums: 1, + NumEnums: 2, NumMessages: 4, NumExtensions: 0, NumServices: 0, diff --git a/gen/go/audit/v1/audit_event.pb.validate.go b/gen/go/audit/v1/audit_event.pb.validate.go index ebf419c..f5e0884 100644 --- a/gen/go/audit/v1/audit_event.pb.validate.go +++ b/gen/go/audit/v1/audit_event.pb.validate.go @@ -474,6 +474,10 @@ func (m *AuditEvent) validate(all bool) error { var errors []error + // no validation rules for EventSource + + // no validation rules for Region + if all { switch v := interface{}(m.GetSequenceNumber()).(type) { case interface{ ValidateAll() error }: @@ -599,6 +603,64 @@ func (m *AuditEvent) validate(all bool) error { } + switch v := m.ResourceContainerReference.(type) { + case *AuditEvent_ObjectName: + if v == nil { + err := AuditEventValidationError{ + field: "ResourceContainerReference", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for ObjectName + case *AuditEvent_ObjectIdentifier: + if v == nil { + err := AuditEventValidationError{ + field: "ResourceContainerReference", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetObjectIdentifier()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AuditEventValidationError{ + field: "ObjectIdentifier", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AuditEventValidationError{ + field: "ObjectIdentifier", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetObjectIdentifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuditEventValidationError{ + field: "ObjectIdentifier", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if m.Request != nil { if all { diff --git a/gen/go/audit/v1/common.pb.go b/gen/go/audit/v1/common.pb.go new file mode 100644 index 0000000..eeb64ba --- /dev/null +++ b/gen/go/audit/v1/common.pb.go @@ -0,0 +1,285 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc (unknown) +// source: audit/v1/common.proto + +package auditV1 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ObjectName int32 + +const ( + ObjectName_OBJECT_NAME_UNSPECIFIED ObjectName = 0 + // If the action happens on system level and doesn't relate to a known ObjectType. + ObjectName_OBJECT_NAME_SYSTEM ObjectName = 1 +) + +// Enum value maps for ObjectName. +var ( + ObjectName_name = map[int32]string{ + 0: "OBJECT_NAME_UNSPECIFIED", + 1: "OBJECT_NAME_SYSTEM", + } + ObjectName_value = map[string]int32{ + "OBJECT_NAME_UNSPECIFIED": 0, + "OBJECT_NAME_SYSTEM": 1, + } +) + +func (x ObjectName) Enum() *ObjectName { + p := new(ObjectName) + *p = x + return p +} + +func (x ObjectName) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ObjectName) Descriptor() protoreflect.EnumDescriptor { + return file_audit_v1_common_proto_enumTypes[0].Descriptor() +} + +func (ObjectName) Type() protoreflect.EnumType { + return &file_audit_v1_common_proto_enumTypes[0] +} + +func (x ObjectName) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ObjectName.Descriptor instead. +func (ObjectName) EnumDescriptor() ([]byte, []int) { + return file_audit_v1_common_proto_rawDescGZIP(), []int{0} +} + +// The type of the object the audit event refers to. +// Relevant for type-detection and lookups in the routing. +type ObjectType int32 + +const ( + ObjectType_OBJECT_TYPE_UNSPECIFIED ObjectType = 0 + ObjectType_OBJECT_TYPE_ORGANIZATION ObjectType = 1 + ObjectType_OBJECT_TYPE_FOLDER ObjectType = 2 + ObjectType_OBJECT_TYPE_PROJECT ObjectType = 3 +) + +// Enum value maps for ObjectType. +var ( + ObjectType_name = map[int32]string{ + 0: "OBJECT_TYPE_UNSPECIFIED", + 1: "OBJECT_TYPE_ORGANIZATION", + 2: "OBJECT_TYPE_FOLDER", + 3: "OBJECT_TYPE_PROJECT", + } + ObjectType_value = map[string]int32{ + "OBJECT_TYPE_UNSPECIFIED": 0, + "OBJECT_TYPE_ORGANIZATION": 1, + "OBJECT_TYPE_FOLDER": 2, + "OBJECT_TYPE_PROJECT": 3, + } +) + +func (x ObjectType) Enum() *ObjectType { + p := new(ObjectType) + *p = x + return p +} + +func (x ObjectType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ObjectType) Descriptor() protoreflect.EnumDescriptor { + return file_audit_v1_common_proto_enumTypes[1].Descriptor() +} + +func (ObjectType) Type() protoreflect.EnumType { + return &file_audit_v1_common_proto_enumTypes[1] +} + +func (x ObjectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ObjectType.Descriptor instead. +func (ObjectType) EnumDescriptor() ([]byte, []int) { + return file_audit_v1_common_proto_rawDescGZIP(), []int{1} +} + +type ObjectIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the respective entity (e.g. Identifier of an organization) + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // Type of the respective entity relevant for routing + Type ObjectType `protobuf:"varint,2,opt,name=type,proto3,enum=audit.v1.ObjectType" json:"type,omitempty"` +} + +func (x *ObjectIdentifier) Reset() { + *x = ObjectIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_audit_v1_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectIdentifier) ProtoMessage() {} + +func (x *ObjectIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_audit_v1_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectIdentifier.ProtoReflect.Descriptor instead. +func (*ObjectIdentifier) Descriptor() ([]byte, []int) { + return file_audit_v1_common_proto_rawDescGZIP(), []int{0} +} + +func (x *ObjectIdentifier) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *ObjectIdentifier) GetType() ObjectType { + if x != nil { + return x.Type + } + return ObjectType_OBJECT_TYPE_UNSPECIFIED +} + +var File_audit_v1_common_proto protoreflect.FileDescriptor + +var file_audit_v1_common_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, + 0x0a, 0x10, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x72, 0x03, + 0xb0, 0x01, 0x01, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, + 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0x41, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, + 0x41, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, + 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x01, 0x2a, 0x78, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x42, 0x4a, 0x45, 0x43, + 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x46, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, + 0x54, 0x10, 0x03, 0x42, 0x7d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, + 0x72, 0x7a, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, 0x64, 0x69, + 0x74, 0x56, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, + 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x14, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_audit_v1_common_proto_rawDescOnce sync.Once + file_audit_v1_common_proto_rawDescData = file_audit_v1_common_proto_rawDesc +) + +func file_audit_v1_common_proto_rawDescGZIP() []byte { + file_audit_v1_common_proto_rawDescOnce.Do(func() { + file_audit_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_v1_common_proto_rawDescData) + }) + return file_audit_v1_common_proto_rawDescData +} + +var file_audit_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_audit_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_audit_v1_common_proto_goTypes = []interface{}{ + (ObjectName)(0), // 0: audit.v1.ObjectName + (ObjectType)(0), // 1: audit.v1.ObjectType + (*ObjectIdentifier)(nil), // 2: audit.v1.ObjectIdentifier +} +var file_audit_v1_common_proto_depIdxs = []int32{ + 1, // 0: audit.v1.ObjectIdentifier.type:type_name -> audit.v1.ObjectType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_audit_v1_common_proto_init() } +func file_audit_v1_common_proto_init() { + if File_audit_v1_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_audit_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_audit_v1_common_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_audit_v1_common_proto_goTypes, + DependencyIndexes: file_audit_v1_common_proto_depIdxs, + EnumInfos: file_audit_v1_common_proto_enumTypes, + MessageInfos: file_audit_v1_common_proto_msgTypes, + }.Build() + File_audit_v1_common_proto = out.File + file_audit_v1_common_proto_rawDesc = nil + file_audit_v1_common_proto_goTypes = nil + file_audit_v1_common_proto_depIdxs = nil +} diff --git a/gen/go/audit/v1/event.pb.validate.go b/gen/go/audit/v1/common.pb.validate.go similarity index 53% rename from gen/go/audit/v1/event.pb.validate.go rename to gen/go/audit/v1/common.pb.validate.go index 64b1559..7fe75d4 100644 --- a/gen/go/audit/v1/event.pb.validate.go +++ b/gen/go/audit/v1/common.pb.validate.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-validate. DO NOT EDIT. -// source: audit/v1/event.proto +// source: audit/v1/common.proto package auditV1 @@ -35,46 +35,46 @@ var ( _ = sort.Sort ) -// Validate checks the field values on ProtobufMessage with the rules defined +// Validate checks the field values on ObjectIdentifier with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. -func (m *ProtobufMessage) Validate() error { +func (m *ObjectIdentifier) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ProtobufMessage with the rules +// ValidateAll checks the field values on ObjectIdentifier with the rules // defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// ProtobufMessageMultiError, or nil if none found. -func (m *ProtobufMessage) ValidateAll() error { +// ObjectIdentifierMultiError, or nil if none found. +func (m *ObjectIdentifier) ValidateAll() error { return m.validate(true) } -func (m *ProtobufMessage) validate(all bool) error { +func (m *ObjectIdentifier) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Value + // no validation rules for Identifier - // no validation rules for ProtobufType + // no validation rules for Type if len(errors) > 0 { - return ProtobufMessageMultiError(errors) + return ObjectIdentifierMultiError(errors) } return nil } -// ProtobufMessageMultiError is an error wrapping multiple validation errors -// returned by ProtobufMessage.ValidateAll() if the designated constraints +// ObjectIdentifierMultiError is an error wrapping multiple validation errors +// returned by ObjectIdentifier.ValidateAll() if the designated constraints // aren't met. -type ProtobufMessageMultiError []error +type ObjectIdentifierMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ProtobufMessageMultiError) Error() string { +func (m ObjectIdentifierMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -83,11 +83,11 @@ func (m ProtobufMessageMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ProtobufMessageMultiError) AllErrors() []error { return m } +func (m ObjectIdentifierMultiError) AllErrors() []error { return m } -// ProtobufMessageValidationError is the validation error returned by -// ProtobufMessage.Validate if the designated constraints aren't met. -type ProtobufMessageValidationError struct { +// ObjectIdentifierValidationError is the validation error returned by +// ObjectIdentifier.Validate if the designated constraints aren't met. +type ObjectIdentifierValidationError struct { field string reason string cause error @@ -95,22 +95,22 @@ type ProtobufMessageValidationError struct { } // Field function returns field value. -func (e ProtobufMessageValidationError) Field() string { return e.field } +func (e ObjectIdentifierValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ProtobufMessageValidationError) Reason() string { return e.reason } +func (e ObjectIdentifierValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ProtobufMessageValidationError) Cause() error { return e.cause } +func (e ObjectIdentifierValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ProtobufMessageValidationError) Key() bool { return e.key } +func (e ObjectIdentifierValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ProtobufMessageValidationError) ErrorName() string { return "ProtobufMessageValidationError" } +func (e ObjectIdentifierValidationError) ErrorName() string { return "ObjectIdentifierValidationError" } // Error satisfies the builtin error interface -func (e ProtobufMessageValidationError) Error() string { +func (e ObjectIdentifierValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -122,14 +122,14 @@ func (e ProtobufMessageValidationError) Error() string { } return fmt.Sprintf( - "invalid %sProtobufMessage.%s: %s%s", + "invalid %sObjectIdentifier.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ProtobufMessageValidationError{} +var _ error = ObjectIdentifierValidationError{} var _ interface { Field() string @@ -137,4 +137,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ProtobufMessageValidationError{} +} = ObjectIdentifierValidationError{} diff --git a/gen/go/audit/v1/event.pb.go b/gen/go/audit/v1/event.pb.go deleted file mode 100644 index 24ec97b..0000000 --- a/gen/go/audit/v1/event.pb.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc (unknown) -// source: audit/v1/event.proto - -package auditV1 - -import ( - _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ProtobufMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Serialized event - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - // Name of the protobuf type - ProtobufType string `protobuf:"bytes,2,opt,name=protobuf_type,json=protobufType,proto3" json:"protobuf_type,omitempty"` -} - -func (x *ProtobufMessage) Reset() { - *x = ProtobufMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_audit_v1_event_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtobufMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtobufMessage) ProtoMessage() {} - -func (x *ProtobufMessage) ProtoReflect() protoreflect.Message { - mi := &file_audit_v1_event_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProtobufMessage.ProtoReflect.Descriptor instead. -func (*ProtobufMessage) Descriptor() ([]byte, []int) { - return file_audit_v1_event_proto_rawDescGZIP(), []int{0} -} - -func (x *ProtobufMessage) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *ProtobufMessage) GetProtobufType() string { - if x != nil { - return x.ProtobufType - } - return "" -} - -var File_audit_v1_event_proto protoreflect.FileDescriptor - -var file_audit_v1_event_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, 0x0a, - 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x7a, 0x02, 0x10, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x2f, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, - 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x54, - 0x79, 0x70, 0x65, 0x42, 0x7c, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, - 0x72, 0x7a, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x56, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x14, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_audit_v1_event_proto_rawDescOnce sync.Once - file_audit_v1_event_proto_rawDescData = file_audit_v1_event_proto_rawDesc -) - -func file_audit_v1_event_proto_rawDescGZIP() []byte { - file_audit_v1_event_proto_rawDescOnce.Do(func() { - file_audit_v1_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_v1_event_proto_rawDescData) - }) - return file_audit_v1_event_proto_rawDescData -} - -var file_audit_v1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_audit_v1_event_proto_goTypes = []interface{}{ - (*ProtobufMessage)(nil), // 0: audit.v1.ProtobufMessage -} -var file_audit_v1_event_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_audit_v1_event_proto_init() } -func file_audit_v1_event_proto_init() { - if File_audit_v1_event_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_audit_v1_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtobufMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_audit_v1_event_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_audit_v1_event_proto_goTypes, - DependencyIndexes: file_audit_v1_event_proto_depIdxs, - MessageInfos: file_audit_v1_event_proto_msgTypes, - }.Build() - File_audit_v1_event_proto = out.File - file_audit_v1_event_proto_rawDesc = nil - file_audit_v1_event_proto_goTypes = nil - file_audit_v1_event_proto_depIdxs = nil -} diff --git a/gen/go/audit/v1/routable_event.pb.go b/gen/go/audit/v1/routable_event.pb.go index b813383..1f5a65b 100644 --- a/gen/go/audit/v1/routable_event.pb.go +++ b/gen/go/audit/v1/routable_event.pb.go @@ -72,164 +72,6 @@ func (Visibility) EnumDescriptor() ([]byte, []int) { return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{0} } -type ObjectName int32 - -const ( - ObjectName_OBJECT_NAME_UNSPECIFIED ObjectName = 0 - // If the action happens on system level and doesn't relate to a known ObjectType. - ObjectName_OBJECT_NAME_SYSTEM ObjectName = 1 -) - -// Enum value maps for ObjectName. -var ( - ObjectName_name = map[int32]string{ - 0: "OBJECT_NAME_UNSPECIFIED", - 1: "OBJECT_NAME_SYSTEM", - } - ObjectName_value = map[string]int32{ - "OBJECT_NAME_UNSPECIFIED": 0, - "OBJECT_NAME_SYSTEM": 1, - } -) - -func (x ObjectName) Enum() *ObjectName { - p := new(ObjectName) - *p = x - return p -} - -func (x ObjectName) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectName) Descriptor() protoreflect.EnumDescriptor { - return file_audit_v1_routable_event_proto_enumTypes[1].Descriptor() -} - -func (ObjectName) Type() protoreflect.EnumType { - return &file_audit_v1_routable_event_proto_enumTypes[1] -} - -func (x ObjectName) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectName.Descriptor instead. -func (ObjectName) EnumDescriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{1} -} - -// The type of the object the audit event refers to. -// Relevant for type-detection and lookups in the routing. -type ObjectType int32 - -const ( - ObjectType_OBJECT_TYPE_UNSPECIFIED ObjectType = 0 - ObjectType_OBJECT_TYPE_ORGANIZATION ObjectType = 1 - ObjectType_OBJECT_TYPE_FOLDER ObjectType = 2 - ObjectType_OBJECT_TYPE_PROJECT ObjectType = 3 -) - -// Enum value maps for ObjectType. -var ( - ObjectType_name = map[int32]string{ - 0: "OBJECT_TYPE_UNSPECIFIED", - 1: "OBJECT_TYPE_ORGANIZATION", - 2: "OBJECT_TYPE_FOLDER", - 3: "OBJECT_TYPE_PROJECT", - } - ObjectType_value = map[string]int32{ - "OBJECT_TYPE_UNSPECIFIED": 0, - "OBJECT_TYPE_ORGANIZATION": 1, - "OBJECT_TYPE_FOLDER": 2, - "OBJECT_TYPE_PROJECT": 3, - } -) - -func (x ObjectType) Enum() *ObjectType { - p := new(ObjectType) - *p = x - return p -} - -func (x ObjectType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectType) Descriptor() protoreflect.EnumDescriptor { - return file_audit_v1_routable_event_proto_enumTypes[2].Descriptor() -} - -func (ObjectType) Type() protoreflect.EnumType { - return &file_audit_v1_routable_event_proto_enumTypes[2] -} - -func (x ObjectType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectType.Descriptor instead. -func (ObjectType) EnumDescriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{2} -} - -type ObjectIdentifier struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the respective entity (e.g. Identifier of an organization) - Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - // Type of the respective entity relevant for routing - Type ObjectType `protobuf:"varint,2,opt,name=type,proto3,enum=audit.v1.ObjectType" json:"type,omitempty"` -} - -func (x *ObjectIdentifier) Reset() { - *x = ObjectIdentifier{} - if protoimpl.UnsafeEnabled { - mi := &file_audit_v1_routable_event_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectIdentifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectIdentifier) ProtoMessage() {} - -func (x *ObjectIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_audit_v1_routable_event_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ObjectIdentifier.ProtoReflect.Descriptor instead. -func (*ObjectIdentifier) Descriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{0} -} - -func (x *ObjectIdentifier) GetIdentifier() string { - if x != nil { - return x.Identifier - } - return "" -} - -func (x *ObjectIdentifier) GetType() ObjectType { - if x != nil { - return x.Type - } - return ObjectType_OBJECT_TYPE_UNSPECIFIED -} - type EncryptedData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -248,7 +90,7 @@ type EncryptedData struct { func (x *EncryptedData) Reset() { *x = EncryptedData{} if protoimpl.UnsafeEnabled { - mi := &file_audit_v1_routable_event_proto_msgTypes[1] + mi := &file_audit_v1_routable_event_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -261,7 +103,7 @@ func (x *EncryptedData) String() string { func (*EncryptedData) ProtoMessage() {} func (x *EncryptedData) ProtoReflect() protoreflect.Message { - mi := &file_audit_v1_routable_event_proto_msgTypes[1] + mi := &file_audit_v1_routable_event_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -274,7 +116,7 @@ func (x *EncryptedData) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptedData.ProtoReflect.Descriptor instead. func (*EncryptedData) Descriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{1} + return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{0} } func (x *EncryptedData) GetData() []byte { @@ -319,7 +161,7 @@ type UnencryptedData struct { func (x *UnencryptedData) Reset() { *x = UnencryptedData{} if protoimpl.UnsafeEnabled { - mi := &file_audit_v1_routable_event_proto_msgTypes[2] + mi := &file_audit_v1_routable_event_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -332,7 +174,7 @@ func (x *UnencryptedData) String() string { func (*UnencryptedData) ProtoMessage() {} func (x *UnencryptedData) ProtoReflect() protoreflect.Message { - mi := &file_audit_v1_routable_event_proto_msgTypes[2] + mi := &file_audit_v1_routable_event_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -345,7 +187,7 @@ func (x *UnencryptedData) ProtoReflect() protoreflect.Message { // Deprecated: Use UnencryptedData.ProtoReflect.Descriptor instead. func (*UnencryptedData) Descriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{2} + return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{1} } func (x *UnencryptedData) GetData() []byte { @@ -391,7 +233,7 @@ type RoutableAuditEvent struct { func (x *RoutableAuditEvent) Reset() { *x = RoutableAuditEvent{} if protoimpl.UnsafeEnabled { - mi := &file_audit_v1_routable_event_proto_msgTypes[3] + mi := &file_audit_v1_routable_event_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -404,7 +246,7 @@ func (x *RoutableAuditEvent) String() string { func (*RoutableAuditEvent) ProtoMessage() {} func (x *RoutableAuditEvent) ProtoReflect() protoreflect.Message { - mi := &file_audit_v1_routable_event_proto_msgTypes[3] + mi := &file_audit_v1_routable_event_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -417,7 +259,7 @@ func (x *RoutableAuditEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use RoutableAuditEvent.ProtoReflect.Descriptor instead. func (*RoutableAuditEvent) Descriptor() ([]byte, []int) { - return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{3} + return file_audit_v1_routable_event_proto_rawDescGZIP(), []int{2} } func (x *RoutableAuditEvent) GetEventName() string { @@ -518,88 +360,70 @@ var file_audit_v1_routable_event_proto_rawDesc = []byte{ 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x10, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0a, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, - 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x0a, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0b, 0xba, 0x48, 0x08, - 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xc5, - 0x01, 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, - 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x7a, 0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x2f, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x39, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, - 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0b, - 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x07, 0xba, 0x48, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x62, 0x0a, 0x0f, 0x55, 0x6e, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x7a, - 0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x54, 0x79, 0x70, 0x65, 0x22, 0xcb, 0x03, 0x0a, 0x12, 0x52, - 0x6f, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x64, 0x69, 0x74, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0xc8, 0x01, 0x01, 0x72, 0x11, 0x32, - 0x0f, 0x5e, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x5f, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x24, - 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x76, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x14, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, - 0x10, 0x01, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x37, - 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x12, 0x46, 0x0a, 0x10, 0x75, 0x6e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, - 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, - 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x75, 0x6e, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0d, 0x65, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x1b, 0x0a, 0x12, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x42, 0x0d, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x2a, 0x57, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, - 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, - 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53, - 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, - 0x02, 0x2a, 0x41, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1b, 0x0a, 0x17, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, - 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x53, 0x59, 0x53, 0x54, - 0x45, 0x4d, 0x10, 0x01, 0x2a, 0x78, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x1c, 0x0a, 0x18, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, - 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, - 0x12, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, 0x4c, - 0x44, 0x45, 0x52, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x42, 0x84, - 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, 0x72, 0x7a, 0x2e, 0x73, - 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, - 0x12, 0x52, 0x6f, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, - 0x75, 0x64, 0x69, 0x74, 0x56, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x41, - 0x75, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x14, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, 0x64, 0x69, - 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, + 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0xba, + 0x48, 0x07, 0xc8, 0x01, 0x01, 0x7a, 0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x2f, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x39, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, + 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0b, 0x6b, + 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x42, 0x07, 0xba, 0x48, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x62, 0x0a, 0x0f, 0x55, 0x6e, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x7a, 0x02, + 0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x54, 0x79, 0x70, 0x65, 0x22, 0xcb, 0x03, 0x0a, 0x12, 0x52, 0x6f, + 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x75, 0x64, 0x69, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x38, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0xc8, 0x01, 0x01, 0x72, 0x11, 0x32, 0x0f, + 0x5e, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x5f, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x2b, 0x24, 0x52, + 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, + 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, + 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x46, 0x0a, 0x10, 0x75, 0x6e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x75, + 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x75, 0x6e, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x1b, 0x0a, 0x12, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x42, 0x0d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x2a, 0x57, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, + 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, + 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53, 0x49, + 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, + 0x42, 0x84, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, 0x72, 0x7a, + 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x42, 0x12, 0x52, 0x6f, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x56, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, + 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x41, 0x75, 0x64, 0x69, + 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x41, 0x75, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x41, 0x75, + 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -614,29 +438,27 @@ func file_audit_v1_routable_event_proto_rawDescGZIP() []byte { return file_audit_v1_routable_event_proto_rawDescData } -var file_audit_v1_routable_event_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_audit_v1_routable_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_audit_v1_routable_event_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_audit_v1_routable_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_audit_v1_routable_event_proto_goTypes = []interface{}{ (Visibility)(0), // 0: audit.v1.Visibility - (ObjectName)(0), // 1: audit.v1.ObjectName - (ObjectType)(0), // 2: audit.v1.ObjectType - (*ObjectIdentifier)(nil), // 3: audit.v1.ObjectIdentifier - (*EncryptedData)(nil), // 4: audit.v1.EncryptedData - (*UnencryptedData)(nil), // 5: audit.v1.UnencryptedData - (*RoutableAuditEvent)(nil), // 6: audit.v1.RoutableAuditEvent + (*EncryptedData)(nil), // 1: audit.v1.EncryptedData + (*UnencryptedData)(nil), // 2: audit.v1.UnencryptedData + (*RoutableAuditEvent)(nil), // 3: audit.v1.RoutableAuditEvent + (ObjectName)(0), // 4: audit.v1.ObjectName + (*ObjectIdentifier)(nil), // 5: audit.v1.ObjectIdentifier } var file_audit_v1_routable_event_proto_depIdxs = []int32{ - 2, // 0: audit.v1.ObjectIdentifier.type:type_name -> audit.v1.ObjectType - 0, // 1: audit.v1.RoutableAuditEvent.visibility:type_name -> audit.v1.Visibility - 1, // 2: audit.v1.RoutableAuditEvent.object_name:type_name -> audit.v1.ObjectName - 3, // 3: audit.v1.RoutableAuditEvent.object_identifier:type_name -> audit.v1.ObjectIdentifier - 5, // 4: audit.v1.RoutableAuditEvent.unencrypted_data:type_name -> audit.v1.UnencryptedData - 4, // 5: audit.v1.RoutableAuditEvent.encrypted_data:type_name -> audit.v1.EncryptedData - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 0, // 0: audit.v1.RoutableAuditEvent.visibility:type_name -> audit.v1.Visibility + 4, // 1: audit.v1.RoutableAuditEvent.object_name:type_name -> audit.v1.ObjectName + 5, // 2: audit.v1.RoutableAuditEvent.object_identifier:type_name -> audit.v1.ObjectIdentifier + 2, // 3: audit.v1.RoutableAuditEvent.unencrypted_data:type_name -> audit.v1.UnencryptedData + 1, // 4: audit.v1.RoutableAuditEvent.encrypted_data:type_name -> audit.v1.EncryptedData + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_audit_v1_routable_event_proto_init() } @@ -644,20 +466,9 @@ func file_audit_v1_routable_event_proto_init() { if File_audit_v1_routable_event_proto != nil { return } + file_audit_v1_common_proto_init() if !protoimpl.UnsafeEnabled { file_audit_v1_routable_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectIdentifier); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_audit_v1_routable_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EncryptedData); i { case 0: return &v.state @@ -669,7 +480,7 @@ func file_audit_v1_routable_event_proto_init() { return nil } } - file_audit_v1_routable_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_audit_v1_routable_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnencryptedData); i { case 0: return &v.state @@ -681,7 +492,7 @@ func file_audit_v1_routable_event_proto_init() { return nil } } - file_audit_v1_routable_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_audit_v1_routable_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoutableAuditEvent); i { case 0: return &v.state @@ -694,7 +505,7 @@ func file_audit_v1_routable_event_proto_init() { } } } - file_audit_v1_routable_event_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_audit_v1_routable_event_proto_msgTypes[2].OneofWrappers = []interface{}{ (*RoutableAuditEvent_ObjectName)(nil), (*RoutableAuditEvent_ObjectIdentifier)(nil), (*RoutableAuditEvent_UnencryptedData)(nil), @@ -705,8 +516,8 @@ func file_audit_v1_routable_event_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_audit_v1_routable_event_proto_rawDesc, - NumEnums: 3, - NumMessages: 4, + NumEnums: 1, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/gen/go/audit/v1/routable_event.pb.validate.go b/gen/go/audit/v1/routable_event.pb.validate.go index b645c26..f09637c 100644 --- a/gen/go/audit/v1/routable_event.pb.validate.go +++ b/gen/go/audit/v1/routable_event.pb.validate.go @@ -35,110 +35,6 @@ var ( _ = sort.Sort ) -// Validate checks the field values on ObjectIdentifier with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *ObjectIdentifier) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectIdentifier with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ObjectIdentifierMultiError, or nil if none found. -func (m *ObjectIdentifier) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectIdentifier) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Identifier - - // no validation rules for Type - - if len(errors) > 0 { - return ObjectIdentifierMultiError(errors) - } - - return nil -} - -// ObjectIdentifierMultiError is an error wrapping multiple validation errors -// returned by ObjectIdentifier.ValidateAll() if the designated constraints -// aren't met. -type ObjectIdentifierMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectIdentifierMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectIdentifierMultiError) AllErrors() []error { return m } - -// ObjectIdentifierValidationError is the validation error returned by -// ObjectIdentifier.Validate if the designated constraints aren't met. -type ObjectIdentifierValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectIdentifierValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectIdentifierValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectIdentifierValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectIdentifierValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectIdentifierValidationError) ErrorName() string { return "ObjectIdentifierValidationError" } - -// Error satisfies the builtin error interface -func (e ObjectIdentifierValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectIdentifier.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectIdentifierValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectIdentifierValidationError{} - // Validate checks the field values on EncryptedData with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. diff --git a/proto/audit/v1/audit_event.proto b/proto/audit/v1/audit_event.proto index 9bf33ba..b29bad8 100644 --- a/proto/audit/v1/audit_event.proto +++ b/proto/audit/v1/audit_event.proto @@ -5,6 +5,8 @@ import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; +import "audit/v1/common.proto"; + package audit.v1; option go_package = "./audit;auditV1"; @@ -21,6 +23,11 @@ enum EventTrigger { EVENT_TRIGGER_REQUEST = 3; } +enum Region { + REGION_UNSPECIFIED = 0; + REGION_EU01 = 1; +} + message Principal { // A UUID or another kind of identifier string id = 1 [(buf.validate.field).required = true]; @@ -51,37 +58,53 @@ message AuditEvent { expression: "this.event_trigger == 3 && has(this.request) || this.event_trigger != 3" }; + // Name of the source system + string event_source = 1 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1]; + + Region region = 2 [(buf.validate.field).required = true]; + // Sequence number of event sent by the service to identify missing events. - google.protobuf.Int64Value sequence_number = 1 [(buf.validate.field).required = true, (buf.validate.field).int64.gte = -1]; + google.protobuf.Int64Value sequence_number = 3 [(buf.validate.field).required = true, (buf.validate.field).int64.gte = -1]; // Functional event name with pattern _, e.g. ORGANIZATION_CREATED // Important for filtering and translation / verbalization of event types // in the UI or data sinks. - string event_name = 2 [(buf.validate.field).required = true, (buf.validate.field).string.pattern = "^[A-Z]+_[A-Z]+$"]; + string event_name = 4 [(buf.validate.field).required = true, (buf.validate.field).string.pattern = "^[A-Z]+_[A-Z]+$"]; // The time when the event happened. Must not be a value in the future. - google.protobuf.Timestamp event_time_stamp = 3 [(buf.validate.field).required = true, (buf.validate.field).timestamp.lt_now = true]; + google.protobuf.Timestamp event_time_stamp = 5 [(buf.validate.field).required = true, (buf.validate.field).timestamp.lt_now = true]; - EventTrigger event_trigger = 4 [(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true]; + EventTrigger event_trigger = 6 [(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true]; // Request details - mandatory if event_trigger is set to "EVENT_REQUEST" - optional RequestDetails request = 5; + optional RequestDetails request = 7; - Principal initiator = 6 [(buf.validate.field).required = true]; + Principal initiator = 8 [(buf.validate.field).required = true]; // List of service account delegation principals. // -> Chain from service account to the actual user who initiated the action. - repeated Principal principals = 7; + repeated Principal principals = 9; - optional string resource_id = 8 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; + // Identifier the audit log event refers to + oneof resource_container_reference { + option (buf.validate.oneof).required = true; + // If it is a technical event not related to an organization, folder or project + // Will NOT be routed to the end-user, only for internal analysis -> + // Clarify what do in the router + ObjectName object_name = 10; + ObjectIdentifier object_identifier = 11; + } - optional string resource_name = 9 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; + // The identifier of the actual resource (e.g. a VM) + optional string resource_id = 12 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; - optional string correlation_id = 10 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; + optional string resource_name = 13 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; + + optional string correlation_id = 14 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 255]; // Result of the operation to publish with the event - optional google.protobuf.Struct result = 11; + optional google.protobuf.Struct result = 15; // Additional information to publish with the event - optional google.protobuf.Struct details = 12; + optional google.protobuf.Struct details = 16; } \ No newline at end of file diff --git a/proto/audit/v1/common.proto b/proto/audit/v1/common.proto new file mode 100644 index 0000000..251de42 --- /dev/null +++ b/proto/audit/v1/common.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +import "buf/validate/validate.proto"; + +package audit.v1; + +option go_package = "./audit;auditV1"; +option java_multiple_files = true; +option java_package = "com.schwarz.stackit.audit.v1"; + +enum ObjectName { + OBJECT_NAME_UNSPECIFIED = 0; + // If the action happens on system level and doesn't relate to a known ObjectType. + OBJECT_NAME_SYSTEM = 1; +} + +// The type of the object the audit event refers to. +// Relevant for type-detection and lookups in the routing. +enum ObjectType { + OBJECT_TYPE_UNSPECIFIED = 0; + OBJECT_TYPE_ORGANIZATION = 1; + OBJECT_TYPE_FOLDER = 2; + OBJECT_TYPE_PROJECT = 3; +} + +message ObjectIdentifier { + // Identifier of the respective entity (e.g. Identifier of an organization) + string identifier = 1 [(buf.validate.field).required = true, (buf.validate.field).string.uuid = true]; + + // Type of the respective entity relevant for routing + ObjectType type = 2 [(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true]; +} \ No newline at end of file diff --git a/proto/audit/v1/event.proto b/proto/audit/v1/event.proto deleted file mode 100644 index 3e970bc..0000000 --- a/proto/audit/v1/event.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -import "buf/validate/validate.proto"; - -package audit.v1; - -option go_package = "./audit;auditV1"; -option java_multiple_files = true; -option java_package = "com.schwarz.stackit.audit.v1"; - -message ProtobufMessage { - // Serialized event - bytes value = 1 [(buf.validate.field).required = true, (buf.validate.field).bytes.min_len = 1]; - - // Name of the protobuf type - string protobuf_type = 2 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1]; -} \ No newline at end of file diff --git a/proto/audit/v1/routable_event.proto b/proto/audit/v1/routable_event.proto index 0169c8d..5f44180 100644 --- a/proto/audit/v1/routable_event.proto +++ b/proto/audit/v1/routable_event.proto @@ -2,6 +2,8 @@ syntax = "proto3"; import "buf/validate/validate.proto"; +import "audit/v1/common.proto"; + package audit.v1; option go_package = "./audit;auditV1"; @@ -16,29 +18,6 @@ enum Visibility { VISIBILITY_PRIVATE = 2; } -enum ObjectName { - OBJECT_NAME_UNSPECIFIED = 0; - // If the action happens on system level and doesn't relate to a known ObjectType. - OBJECT_NAME_SYSTEM = 1; -} - -// The type of the object the audit event refers to. -// Relevant for type-detection and lookups in the routing. -enum ObjectType { - OBJECT_TYPE_UNSPECIFIED = 0; - OBJECT_TYPE_ORGANIZATION = 1; - OBJECT_TYPE_FOLDER = 2; - OBJECT_TYPE_PROJECT = 3; -} - -message ObjectIdentifier { - // Identifier of the respective entity (e.g. Identifier of an organization) - string identifier = 1 [(buf.validate.field).required = true, (buf.validate.field).string.uuid = true]; - - // Type of the respective entity relevant for routing - ObjectType type = 2 [(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true]; -} - message EncryptedData { // Encrypted serialized protobuf content (the actual audit event) bytes data = 1 [(buf.validate.field).required = true, (buf.validate.field).bytes.min_len = 1];