mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 09:07:26 +00:00
Compare commits
1 commit
main
...
v0.0.3-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2bf4c6366 |
20 changed files with 578 additions and 867 deletions
|
|
@ -107,36 +107,11 @@ type AuditApi interface {
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) error
|
) error
|
||||||
|
|
||||||
// LogWithTrace is a convenience method that validates, serializes and sends data over the wire.
|
|
||||||
// If the transactional outbox pattern should be used, the ValidateAndSerializeWithTrace method
|
|
||||||
// and Send method can be called separately. The method accepts traceParent and traceState
|
|
||||||
// parameters to put into attributes of the AuditLogEntry.
|
|
||||||
// If an error is returned it is the responsibility of the caller to retry. The api does not store,
|
|
||||||
// buffer events or retry failed invocation automatically.
|
|
||||||
//
|
|
||||||
// Parameters:
|
|
||||||
// * ctx - the context object
|
|
||||||
// * event - the auditV1.AuditEvent
|
|
||||||
// * visibility - route the event only internally or to the customer (no routing in the legacy solution)
|
|
||||||
// * routableIdentifier - the identifier of the object
|
|
||||||
// * traceParent - optional trace parent
|
|
||||||
// * traceState - optional trace state
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// * an error if the validation, serialization or send failed
|
|
||||||
LogWithTrace(
|
|
||||||
ctx context.Context,
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) error
|
|
||||||
|
|
||||||
// ValidateAndSerialize validates and serializes the event into a byte representation.
|
// ValidateAndSerialize validates and serializes the event into a byte representation.
|
||||||
// The result has to be sent explicitly by calling the Send method.
|
// The result has to be sent explicitly by calling the Send method.
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
|
// * ctx - the context object
|
||||||
// * event - the auditV1.AuditEvent
|
// * event - the auditV1.AuditEvent
|
||||||
// * visibility - route the event only internally or to the customer (no routing in the legacy solution)
|
// * visibility - route the event only internally or to the customer (no routing in the legacy solution)
|
||||||
// * routableIdentifier - the identifier of the object
|
// * routableIdentifier - the identifier of the object
|
||||||
|
|
@ -145,32 +120,12 @@ type AuditApi interface {
|
||||||
// * the CloudEvent (i.e. the serialized AuditLogEntry with metadata)
|
// * the CloudEvent (i.e. the serialized AuditLogEntry with metadata)
|
||||||
// * an error if validation or serialization failed
|
// * an error if validation or serialization failed
|
||||||
ValidateAndSerialize(
|
ValidateAndSerialize(
|
||||||
|
ctx context.Context,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) (*CloudEvent, error)
|
) (*CloudEvent, error)
|
||||||
|
|
||||||
// ValidateAndSerializeWithTrace validates and serializes the event into a byte representation.
|
|
||||||
// The result has to be sent explicitly by calling the Send method.
|
|
||||||
//
|
|
||||||
// Parameters:
|
|
||||||
// * event - the auditV1.AuditEvent
|
|
||||||
// * visibility - route the event only internally or to the customer (no routing in the legacy solution)
|
|
||||||
// * routableIdentifier - the identifier of the object
|
|
||||||
// * traceParent - optional trace parent
|
|
||||||
// * traceState - optional trace state
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// * the CloudEvent (i.e. the serialized AuditLogEntry with metadata)
|
|
||||||
// * an error if validation or serialization failed
|
|
||||||
ValidateAndSerializeWithTrace(
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) (*CloudEvent, error)
|
|
||||||
|
|
||||||
// Send the serialized content as byte array to the audit log system.
|
// Send the serialized content as byte array to the audit log system.
|
||||||
// If an error is returned it is the responsibility of the caller to
|
// If an error is returned it is the responsibility of the caller to
|
||||||
// retry. The api does not store, buffer events or retry failed
|
// retry. The api does not store, buffer events or retry failed
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import (
|
||||||
"dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/audit/messaging"
|
"dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/audit/messaging"
|
||||||
auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/gen/go/audit/v1"
|
auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/gen/go/audit/v1"
|
||||||
"errors"
|
"errors"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
@ -34,6 +36,7 @@ type LegacyTopicNameConfig struct {
|
||||||
type LegacyAuditApi struct {
|
type LegacyAuditApi struct {
|
||||||
messagingApi *messaging.Api
|
messagingApi *messaging.Api
|
||||||
topicNameResolver *TopicNameResolver
|
topicNameResolver *TopicNameResolver
|
||||||
|
tracer trace.Tracer
|
||||||
validator *ProtobufValidator
|
validator *ProtobufValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,6 +63,7 @@ func NewLegacyAuditApi(
|
||||||
var auditApi AuditApi = &LegacyAuditApi{
|
var auditApi AuditApi = &LegacyAuditApi{
|
||||||
messagingApi: messagingApi,
|
messagingApi: messagingApi,
|
||||||
topicNameResolver: &topicNameResolver,
|
topicNameResolver: &topicNameResolver,
|
||||||
|
tracer: otel.Tracer("legacy-audit-api"),
|
||||||
validator: &validator,
|
validator: &validator,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,20 +78,7 @@ func (a *LegacyAuditApi) Log(
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
return a.LogWithTrace(ctx, event, visibility, routableIdentifier, nil, nil)
|
cloudEvent, err := a.ValidateAndSerialize(ctx, event, visibility, routableIdentifier)
|
||||||
}
|
|
||||||
|
|
||||||
// LogWithTrace implements AuditApi.LogWithTrace
|
|
||||||
func (a *LegacyAuditApi) LogWithTrace(
|
|
||||||
ctx context.Context,
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) error {
|
|
||||||
|
|
||||||
cloudEvent, err := a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, traceParent, traceState)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -98,22 +89,14 @@ func (a *LegacyAuditApi) LogWithTrace(
|
||||||
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize.
|
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize.
|
||||||
// It serializes the event into the byte representation of the legacy audit log system.
|
// It serializes the event into the byte representation of the legacy audit log system.
|
||||||
func (a *LegacyAuditApi) ValidateAndSerialize(
|
func (a *LegacyAuditApi) ValidateAndSerialize(
|
||||||
|
ctx context.Context,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) (*CloudEvent, error) {
|
) (*CloudEvent, error) {
|
||||||
return a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAndSerializeWithTrace implements AuditApi.ValidateAndSerializeWithTrace.
|
ctx, span := a.tracer.Start(ctx, "validate-and-serialize")
|
||||||
// It serializes the event into the byte representation of the legacy audit log system.
|
defer span.End()
|
||||||
func (a *LegacyAuditApi) ValidateAndSerializeWithTrace(
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) (*CloudEvent, error) {
|
|
||||||
|
|
||||||
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -138,6 +121,8 @@ func (a *LegacyAuditApi) ValidateAndSerializeWithTrace(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceParent, traceState := TraceParentAndStateFromContext(ctx)
|
||||||
|
|
||||||
message := CloudEvent{
|
message := CloudEvent{
|
||||||
SpecVersion: "1.0",
|
SpecVersion: "1.0",
|
||||||
Source: event.ProtoPayload.ServiceName,
|
Source: event.ProtoPayload.ServiceName,
|
||||||
|
|
@ -147,8 +132,8 @@ func (a *LegacyAuditApi) ValidateAndSerializeWithTrace(
|
||||||
DataType: DataTypeLegacyAuditEventV1,
|
DataType: DataTypeLegacyAuditEventV1,
|
||||||
Subject: event.ProtoPayload.ResourceName,
|
Subject: event.ProtoPayload.ResourceName,
|
||||||
Data: legacyBytes,
|
Data: legacyBytes,
|
||||||
TraceParent: traceParent,
|
TraceParent: &traceParent,
|
||||||
TraceState: traceState,
|
TraceState: &traceState,
|
||||||
}
|
}
|
||||||
return &message, nil
|
return &message, nil
|
||||||
}
|
}
|
||||||
|
|
@ -160,5 +145,11 @@ func (a *LegacyAuditApi) Send(
|
||||||
cloudEvent *CloudEvent,
|
cloudEvent *CloudEvent,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
|
if cloudEvent != nil && cloudEvent.TraceParent != nil && cloudEvent.TraceState != nil {
|
||||||
|
ctx = AddTraceParentAndStateToContext(ctx, *cloudEvent.TraceParent, *cloudEvent.TraceState)
|
||||||
|
}
|
||||||
|
ctx, span := a.tracer.Start(ctx, "send")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
return send(a.topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
return send(a.topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/audit/messaging"
|
"dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/audit/messaging"
|
||||||
|
|
@ -25,6 +27,7 @@ var ErrTopicNameEmpty = errors.New("empty topic name provided")
|
||||||
// Note: The implementation will be deprecated and replaced with the "routableAuditApi" once the new audit log routing is implemented
|
// Note: The implementation will be deprecated and replaced with the "routableAuditApi" once the new audit log routing is implemented
|
||||||
type DynamicLegacyAuditApi struct {
|
type DynamicLegacyAuditApi struct {
|
||||||
messagingApi *messaging.Api
|
messagingApi *messaging.Api
|
||||||
|
tracer trace.Tracer
|
||||||
validator *ProtobufValidator
|
validator *ProtobufValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,6 +46,7 @@ func NewDynamicLegacyAuditApi(
|
||||||
// Audit api
|
// Audit api
|
||||||
var auditApi AuditApi = &DynamicLegacyAuditApi{
|
var auditApi AuditApi = &DynamicLegacyAuditApi{
|
||||||
messagingApi: messagingApi,
|
messagingApi: messagingApi,
|
||||||
|
tracer: otel.Tracer("dynamic-legacy-audit-api"),
|
||||||
validator: &validator,
|
validator: &validator,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,20 +61,7 @@ func (a *DynamicLegacyAuditApi) Log(
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
return a.LogWithTrace(ctx, event, visibility, routableIdentifier, nil, nil)
|
cloudEvent, err := a.ValidateAndSerialize(ctx, event, visibility, routableIdentifier)
|
||||||
}
|
|
||||||
|
|
||||||
// LogWithTrace implements AuditApi.LogWithTrace
|
|
||||||
func (a *DynamicLegacyAuditApi) LogWithTrace(
|
|
||||||
ctx context.Context,
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) error {
|
|
||||||
|
|
||||||
cloudEvent, err := a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, traceParent, traceState)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -81,22 +72,14 @@ func (a *DynamicLegacyAuditApi) LogWithTrace(
|
||||||
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize.
|
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize.
|
||||||
// It serializes the event into the byte representation of the legacy audit log system.
|
// It serializes the event into the byte representation of the legacy audit log system.
|
||||||
func (a *DynamicLegacyAuditApi) ValidateAndSerialize(
|
func (a *DynamicLegacyAuditApi) ValidateAndSerialize(
|
||||||
|
ctx context.Context,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) (*CloudEvent, error) {
|
) (*CloudEvent, error) {
|
||||||
return a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAndSerializeWithTrace implements AuditApi.ValidateAndSerializeWithTrace.
|
ctx, span := a.tracer.Start(ctx, "validate-and-serialize")
|
||||||
// It serializes the event into the byte representation of the legacy audit log system.
|
defer span.End()
|
||||||
func (a *DynamicLegacyAuditApi) ValidateAndSerializeWithTrace(
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) (*CloudEvent, error) {
|
|
||||||
|
|
||||||
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -121,6 +104,8 @@ func (a *DynamicLegacyAuditApi) ValidateAndSerializeWithTrace(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceParent, traceState := TraceParentAndStateFromContext(ctx)
|
||||||
|
|
||||||
message := CloudEvent{
|
message := CloudEvent{
|
||||||
SpecVersion: "1.0",
|
SpecVersion: "1.0",
|
||||||
Source: event.ProtoPayload.ServiceName,
|
Source: event.ProtoPayload.ServiceName,
|
||||||
|
|
@ -130,8 +115,8 @@ func (a *DynamicLegacyAuditApi) ValidateAndSerializeWithTrace(
|
||||||
DataType: DataTypeLegacyAuditEventV1,
|
DataType: DataTypeLegacyAuditEventV1,
|
||||||
Subject: event.ProtoPayload.ResourceName,
|
Subject: event.ProtoPayload.ResourceName,
|
||||||
Data: legacyBytes,
|
Data: legacyBytes,
|
||||||
TraceParent: traceParent,
|
TraceParent: &traceParent,
|
||||||
TraceState: traceState,
|
TraceState: &traceState,
|
||||||
}
|
}
|
||||||
return &message, nil
|
return &message, nil
|
||||||
}
|
}
|
||||||
|
|
@ -156,5 +141,11 @@ func (a *DynamicLegacyAuditApi) Send(
|
||||||
|
|
||||||
var topicNameResolver TopicNameResolver = &LegacyTopicNameResolver{topicName: topicName}
|
var topicNameResolver TopicNameResolver = &LegacyTopicNameResolver{topicName: topicName}
|
||||||
|
|
||||||
|
if cloudEvent != nil && cloudEvent.TraceParent != nil && cloudEvent.TraceState != nil {
|
||||||
|
ctx = AddTraceParentAndStateToContext(ctx, *cloudEvent.TraceParent, *cloudEvent.TraceState)
|
||||||
|
}
|
||||||
|
ctx, span := a.tracer.Start(ctx, "send")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
return send(&topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
return send(&topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -37,8 +38,6 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
topicSubscriptionTopicPattern := "audit-log/>"
|
topicSubscriptionTopicPattern := "audit-log/>"
|
||||||
traceParent := "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
traceState := "rojo=00f067aa0ba902b7,congo=t61rcWkgMzE"
|
|
||||||
|
|
||||||
// Check that event-type data-access is rejected as it is currently
|
// Check that event-type data-access is rejected as it is currently
|
||||||
// not supported by downstream services
|
// not supported by downstream services
|
||||||
|
|
@ -67,13 +66,11 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.ErrorIs(t, (*auditApi).LogWithTrace(
|
assert.ErrorIs(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
), ErrUnsupportedEventTypeDataAccess)
|
), ErrUnsupportedEventTypeDataAccess)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -102,19 +99,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private organization event", func(t *testing.T) {
|
t.Run("Log private organization event", func(t *testing.T) {
|
||||||
|
|
@ -141,19 +136,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of folder events
|
// Check logging of folder events
|
||||||
|
|
@ -181,19 +174,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private folder event", func(t *testing.T) {
|
t.Run("Log private folder event", func(t *testing.T) {
|
||||||
|
|
@ -220,19 +211,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of project events
|
// Check logging of project events
|
||||||
|
|
@ -260,19 +249,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private project event", func(t *testing.T) {
|
t.Run("Log private project event", func(t *testing.T) {
|
||||||
|
|
@ -299,19 +286,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of system events with identifier
|
// Check logging of system events with identifier
|
||||||
|
|
@ -339,13 +324,11 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -354,8 +337,8 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -397,13 +380,11 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -412,8 +393,8 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -455,19 +436,17 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
ctx := context.WithValue(ctx, ContextKeyTopic, topicName)
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessageWithDetails(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessageWithDetails(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -484,10 +463,13 @@ func TestDynamicLegacyAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := DynamicLegacyAuditApi{validator: &protobufValidator}
|
auditApi := DynamicLegacyAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
_, err := auditApi.ValidateAndSerialize(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, expectedError)
|
assert.ErrorIs(t, err, expectedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -498,7 +480,10 @@ func TestDynamicLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := DynamicLegacyAuditApi{validator: &protobufValidator}
|
auditApi := DynamicLegacyAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
|
|
@ -506,7 +491,7 @@ func TestDynamicLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDynamicLegacyAuditApi_Log_NilEvent(t *testing.T) {
|
func TestDynamicLegacyAuditApi_Log_NilEvent(t *testing.T) {
|
||||||
auditApi := DynamicLegacyAuditApi{}
|
auditApi := DynamicLegacyAuditApi{tracer: otel.Tracer("test")}
|
||||||
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, ErrEventNil)
|
assert.ErrorIs(t, err, ErrEventNil)
|
||||||
}
|
}
|
||||||
|
|
@ -522,7 +507,10 @@ func TestDynamicLegacyAuditApi_ConvertAndSerializeIntoLegacyFormatInvalidObjectI
|
||||||
validator.On("Validate", mock.Anything).Return(nil)
|
validator.On("Validate", mock.Anything).Return(nil)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := DynamicLegacyAuditApi{validator: &protobufValidator}
|
auditApi := DynamicLegacyAuditApi{
|
||||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, NewRoutableIdentifier(objectIdentifier))
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
_, err := auditApi.ValidateAndSerialize(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, NewRoutableIdentifier(objectIdentifier))
|
||||||
assert.ErrorIs(t, err, ErrUnsupportedRoutableType)
|
assert.ErrorIs(t, err, ErrUnsupportedRoutableType)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -39,8 +40,6 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
topicSubscriptionTopicPattern := "audit-log/>"
|
topicSubscriptionTopicPattern := "audit-log/>"
|
||||||
traceParent := "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
traceState := "rojo=00f067aa0ba902b7,congo=t61rcWkgMzE"
|
|
||||||
|
|
||||||
// Check that event-type data-access is rejected as it is currently
|
// Check that event-type data-access is rejected as it is currently
|
||||||
// not supported by downstream services
|
// not supported by downstream services
|
||||||
|
|
@ -68,13 +67,11 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
assert.ErrorIs(t, (*auditApi).LogWithTrace(
|
assert.ErrorIs(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
auditV1.Visibility_VISIBILITY_PUBLIC,
|
auditV1.Visibility_VISIBILITY_PUBLIC,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
), ErrUnsupportedEventTypeDataAccess)
|
), ErrUnsupportedEventTypeDataAccess)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -103,19 +100,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private organization event", func(t *testing.T) {
|
t.Run("Log private organization event", func(t *testing.T) {
|
||||||
|
|
@ -142,19 +137,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of folder events
|
// Check logging of folder events
|
||||||
|
|
@ -182,19 +175,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private folder event", func(t *testing.T) {
|
t.Run("Log private folder event", func(t *testing.T) {
|
||||||
|
|
@ -221,19 +212,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of project events
|
// Check logging of project events
|
||||||
|
|
@ -261,19 +250,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private project event", func(t *testing.T) {
|
t.Run("Log private project event", func(t *testing.T) {
|
||||||
|
|
@ -300,19 +287,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessage(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessage(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of system events with identifier
|
// Check logging of system events with identifier
|
||||||
|
|
@ -340,13 +325,11 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -355,8 +338,8 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -398,13 +381,11 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -413,8 +394,8 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -456,19 +437,17 @@ func TestLegacyAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier),
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
validateSentMessageWithDetails(t, topicName, message, event, &traceParent, &traceState)
|
validateSentMessageWithDetails(t, topicName, message, event)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -477,14 +456,12 @@ func validateSentMessage(
|
||||||
topicName string,
|
topicName string,
|
||||||
message *amqp.Message,
|
message *amqp.Message,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Check message properties
|
// Check message properties
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Equal(t, *traceParent, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Equal(t, *traceState, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -529,16 +506,14 @@ func validateSentMessageWithDetails(
|
||||||
topicName string,
|
topicName string,
|
||||||
message *amqp.Message,
|
message *amqp.Message,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
assert.Equal(t, topicName, *message.Properties.To)
|
assert.Equal(t, topicName, *message.Properties.To)
|
||||||
assert.Equal(t, ContentTypeCloudEventsJson, message.ApplicationProperties["cloudEvents:datacontenttype"])
|
assert.Equal(t, ContentTypeCloudEventsJson, message.ApplicationProperties["cloudEvents:datacontenttype"])
|
||||||
assert.Equal(t, DataTypeLegacyAuditEventV1, message.ApplicationProperties["cloudEvents:type"])
|
assert.Equal(t, DataTypeLegacyAuditEventV1, message.ApplicationProperties["cloudEvents:type"])
|
||||||
assert.Equal(t, *traceParent, message.ApplicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Equal(t, *traceState, message.ApplicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", message.ApplicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
var auditEvent LegacyAuditEvent
|
var auditEvent LegacyAuditEvent
|
||||||
|
|
@ -627,10 +602,13 @@ func TestLegacyAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.T) {
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := LegacyAuditApi{validator: &protobufValidator}
|
auditApi := LegacyAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
_, err := auditApi.ValidateAndSerialize(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, expectedError)
|
assert.ErrorIs(t, err, expectedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -641,7 +619,10 @@ func TestLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := LegacyAuditApi{validator: &protobufValidator}
|
auditApi := LegacyAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
|
|
@ -649,7 +630,7 @@ func TestLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLegacyAuditApi_Log_NilEvent(t *testing.T) {
|
func TestLegacyAuditApi_Log_NilEvent(t *testing.T) {
|
||||||
auditApi := LegacyAuditApi{}
|
auditApi := LegacyAuditApi{tracer: otel.Tracer("test")}
|
||||||
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, ErrEventNil)
|
assert.ErrorIs(t, err, ErrEventNil)
|
||||||
}
|
}
|
||||||
|
|
@ -665,7 +646,10 @@ func TestLegacyAuditApi_ConvertAndSerializeIntoLegacyFormatInvalidObjectIdentifi
|
||||||
validator.On("Validate", mock.Anything).Return(nil)
|
validator.On("Validate", mock.Anything).Return(nil)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := LegacyAuditApi{validator: &protobufValidator}
|
auditApi := LegacyAuditApi{
|
||||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, NewRoutableIdentifier(objectIdentifier))
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
_, err := auditApi.ValidateAndSerialize(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, NewRoutableIdentifier(objectIdentifier))
|
||||||
assert.ErrorIs(t, err, ErrUnsupportedRoutableType)
|
assert.ErrorIs(t, err, ErrUnsupportedRoutableType)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package api
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
@ -14,6 +16,7 @@ import (
|
||||||
|
|
||||||
// MockAuditApi is an implementation of AuditApi that does nothing and has no dependency to external systems.
|
// MockAuditApi is an implementation of AuditApi that does nothing and has no dependency to external systems.
|
||||||
type MockAuditApi struct {
|
type MockAuditApi struct {
|
||||||
|
tracer trace.Tracer
|
||||||
validator *ProtobufValidator
|
validator *ProtobufValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,7 +26,10 @@ func NewMockAuditApi() (*AuditApi, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
var auditApi AuditApi = &MockAuditApi{validator: &protobufValidator}
|
var auditApi AuditApi = &MockAuditApi{
|
||||||
|
tracer: otel.Tracer("mock-audit-api"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
return &auditApi, nil
|
return &auditApi, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,42 +42,20 @@ func (a *MockAuditApi) Log(
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
return a.LogWithTrace(ctx, event, visibility, routableIdentifier, nil, nil)
|
_, err := a.ValidateAndSerialize(ctx, event, visibility, routableIdentifier)
|
||||||
}
|
|
||||||
|
|
||||||
// LogWithTrace implements AuditApi.LogWithTrace.
|
|
||||||
// Validates and serializes the event but doesn't send it.
|
|
||||||
func (a *MockAuditApi) LogWithTrace(
|
|
||||||
_ context.Context,
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) error {
|
|
||||||
|
|
||||||
_, err := a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, traceParent, traceState)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize
|
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize
|
||||||
func (a *MockAuditApi) ValidateAndSerialize(
|
func (a *MockAuditApi) ValidateAndSerialize(
|
||||||
|
ctx context.Context,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) (*CloudEvent, error) {
|
) (*CloudEvent, error) {
|
||||||
|
|
||||||
return a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, nil, nil)
|
ctx, span := a.tracer.Start(ctx, "validate-and-serialize")
|
||||||
}
|
defer span.End()
|
||||||
|
|
||||||
// ValidateAndSerializeWithTrace implements AuditApi.ValidateAndSerializeWithTrace
|
|
||||||
func (a *MockAuditApi) ValidateAndSerializeWithTrace(
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) (*CloudEvent, error) {
|
|
||||||
|
|
||||||
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
routableEvent, err := validateAndSerializePartially(a.validator, event, visibility, routableIdentifier)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -89,6 +73,8 @@ func (a *MockAuditApi) ValidateAndSerializeWithTrace(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceParent, traceState := TraceParentAndStateFromContext(ctx)
|
||||||
|
|
||||||
message := CloudEvent{
|
message := CloudEvent{
|
||||||
SpecVersion: "1.0",
|
SpecVersion: "1.0",
|
||||||
Source: event.ProtoPayload.ServiceName,
|
Source: event.ProtoPayload.ServiceName,
|
||||||
|
|
@ -98,8 +84,8 @@ func (a *MockAuditApi) ValidateAndSerializeWithTrace(
|
||||||
DataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()),
|
DataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()),
|
||||||
Subject: event.ProtoPayload.ResourceName,
|
Subject: event.ProtoPayload.ResourceName,
|
||||||
Data: routableEventBytes,
|
Data: routableEventBytes,
|
||||||
TraceParent: traceParent,
|
TraceParent: &traceParent,
|
||||||
TraceState: traceState,
|
TraceState: &traceState,
|
||||||
}
|
}
|
||||||
|
|
||||||
return &message, nil
|
return &message, nil
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ func TestMockAuditApi_Log(t *testing.T) {
|
||||||
|
|
||||||
t.Run("ValidateAndSerialize", func(t *testing.T) {
|
t.Run("ValidateAndSerialize", func(t *testing.T) {
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
cloudEvent, err := (*auditApi).ValidateAndSerializeWithTrace(
|
cloudEvent, err := (*auditApi).ValidateAndSerialize(
|
||||||
event, visibility, routableObjectIdentifier, nil, nil)
|
context.Background(), event, visibility, routableObjectIdentifier)
|
||||||
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ func TestMockAuditApi_Log(t *testing.T) {
|
||||||
|
|
||||||
t.Run("ValidateAndSerialize event nil", func(t *testing.T) {
|
t.Run("ValidateAndSerialize event nil", func(t *testing.T) {
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
_, err := (*auditApi).ValidateAndSerialize(nil, visibility, routableObjectIdentifier)
|
_, err := (*auditApi).ValidateAndSerialize(context.Background(), nil, visibility, routableObjectIdentifier)
|
||||||
|
|
||||||
assert.ErrorIs(t, err, ErrEventNil)
|
assert.ErrorIs(t, err, ErrEventNil)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
@ -57,6 +59,7 @@ type topicNameConfig struct {
|
||||||
type routableAuditApi struct {
|
type routableAuditApi struct {
|
||||||
messagingApi *messaging.Api
|
messagingApi *messaging.Api
|
||||||
topicNameResolver *TopicNameResolver
|
topicNameResolver *TopicNameResolver
|
||||||
|
tracer trace.Tracer
|
||||||
validator *ProtobufValidator
|
validator *ProtobufValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,6 +99,7 @@ func newRoutableAuditApi(
|
||||||
var auditApi AuditApi = &routableAuditApi{
|
var auditApi AuditApi = &routableAuditApi{
|
||||||
messagingApi: messagingApi,
|
messagingApi: messagingApi,
|
||||||
topicNameResolver: &topicNameResolver,
|
topicNameResolver: &topicNameResolver,
|
||||||
|
tracer: otel.Tracer("routable-audit-api"),
|
||||||
validator: &validator,
|
validator: &validator,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,20 +114,7 @@ func (a *routableAuditApi) Log(
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
return a.LogWithTrace(ctx, event, visibility, routableIdentifier, nil, nil)
|
cloudEvent, err := a.ValidateAndSerialize(ctx, event, visibility, routableIdentifier)
|
||||||
}
|
|
||||||
|
|
||||||
// LogWithTrace implements AuditApi.LogWithTrace
|
|
||||||
func (a *routableAuditApi) LogWithTrace(
|
|
||||||
ctx context.Context,
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) error {
|
|
||||||
|
|
||||||
cloudEvent, err := a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, traceParent, traceState)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -133,22 +124,14 @@ func (a *routableAuditApi) LogWithTrace(
|
||||||
|
|
||||||
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize
|
// ValidateAndSerialize implements AuditApi.ValidateAndSerialize
|
||||||
func (a *routableAuditApi) ValidateAndSerialize(
|
func (a *routableAuditApi) ValidateAndSerialize(
|
||||||
|
ctx context.Context,
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
routableIdentifier *RoutableIdentifier,
|
routableIdentifier *RoutableIdentifier,
|
||||||
) (*CloudEvent, error) {
|
) (*CloudEvent, error) {
|
||||||
|
|
||||||
return a.ValidateAndSerializeWithTrace(event, visibility, routableIdentifier, nil, nil)
|
ctx, span := a.tracer.Start(ctx, "validate-and-serialize")
|
||||||
}
|
defer span.End()
|
||||||
|
|
||||||
// ValidateAndSerializeWithTrace implements AuditApi.ValidateAndSerializeWithTrace
|
|
||||||
func (a *routableAuditApi) ValidateAndSerializeWithTrace(
|
|
||||||
event *auditV1.AuditLogEntry,
|
|
||||||
visibility auditV1.Visibility,
|
|
||||||
routableIdentifier *RoutableIdentifier,
|
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) (*CloudEvent, error) {
|
|
||||||
|
|
||||||
routableEvent, err := validateAndSerializePartially(
|
routableEvent, err := validateAndSerializePartially(
|
||||||
a.validator,
|
a.validator,
|
||||||
|
|
@ -171,6 +154,8 @@ func (a *routableAuditApi) ValidateAndSerializeWithTrace(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
traceParent, traceState := TraceParentAndStateFromContext(ctx)
|
||||||
|
|
||||||
message := CloudEvent{
|
message := CloudEvent{
|
||||||
SpecVersion: "1.0",
|
SpecVersion: "1.0",
|
||||||
Source: event.ProtoPayload.ServiceName,
|
Source: event.ProtoPayload.ServiceName,
|
||||||
|
|
@ -180,8 +165,8 @@ func (a *routableAuditApi) ValidateAndSerializeWithTrace(
|
||||||
DataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()),
|
DataType: fmt.Sprintf("%v", routableEvent.ProtoReflect().Descriptor().FullName()),
|
||||||
Subject: event.ProtoPayload.ResourceName,
|
Subject: event.ProtoPayload.ResourceName,
|
||||||
Data: routableEventBytes,
|
Data: routableEventBytes,
|
||||||
TraceParent: traceParent,
|
TraceParent: &traceParent,
|
||||||
TraceState: traceState,
|
TraceState: &traceState,
|
||||||
}
|
}
|
||||||
|
|
||||||
return &message, nil
|
return &message, nil
|
||||||
|
|
@ -194,5 +179,11 @@ func (a *routableAuditApi) Send(
|
||||||
cloudEvent *CloudEvent,
|
cloudEvent *CloudEvent,
|
||||||
) error {
|
) error {
|
||||||
|
|
||||||
|
if cloudEvent != nil && cloudEvent.TraceParent != nil && cloudEvent.TraceState != nil {
|
||||||
|
ctx = AddTraceParentAndStateToContext(ctx, *cloudEvent.TraceParent, *cloudEvent.TraceState)
|
||||||
|
}
|
||||||
|
ctx, span := a.tracer.Start(ctx, "send")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
return send(a.topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
return send(a.topicNameResolver, a.messagingApi, ctx, routableIdentifier, cloudEvent)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -39,9 +40,6 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
validator, err := protovalidate.New()
|
validator, err := protovalidate.New()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
traceParent := "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
traceState := "rojo=00f067aa0ba902b7,congo=t61rcWkgMzE"
|
|
||||||
|
|
||||||
// Instantiate the audit api
|
// Instantiate the audit api
|
||||||
organizationTopicPrefix := "org"
|
organizationTopicPrefix := "org"
|
||||||
projectTopicPrefix := "project"
|
projectTopicPrefix := "project"
|
||||||
|
|
@ -75,14 +73,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.ErrorIs(t, (*auditApi).LogWithTrace(
|
assert.ErrorIs(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)), ErrUnsupportedEventTypeDataAccess)
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
), ErrUnsupportedEventTypeDataAccess)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of organization events
|
// Check logging of organization events
|
||||||
|
|
@ -99,14 +94,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
@ -118,9 +110,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.organization.created",
|
"stackit.resourcemanager.v2.organization.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private organization event", func(t *testing.T) {
|
t.Run("Log private organization event", func(t *testing.T) {
|
||||||
|
|
@ -140,14 +130,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
|
|
@ -160,9 +147,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.organization.created",
|
"stackit.resourcemanager.v2.organization.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of folder events
|
// Check logging of folder events
|
||||||
|
|
@ -179,14 +164,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
@ -198,9 +180,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.folder.created",
|
"stackit.resourcemanager.v2.folder.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private folder event", func(t *testing.T) {
|
t.Run("Log private folder event", func(t *testing.T) {
|
||||||
|
|
@ -218,14 +198,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
|
|
@ -238,9 +215,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.folder.created",
|
"stackit.resourcemanager.v2.folder.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of project events
|
// Check logging of project events
|
||||||
|
|
@ -257,14 +232,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
|
|
@ -277,9 +249,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.project.created",
|
"stackit.resourcemanager.v2.project.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Log private project event", func(t *testing.T) {
|
t.Run("Log private project event", func(t *testing.T) {
|
||||||
|
|
@ -295,14 +265,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
|
|
@ -315,9 +282,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.project.created",
|
"stackit.resourcemanager.v2.project.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check logging of system events with identifier
|
// Check logging of system events with identifier
|
||||||
|
|
@ -334,13 +299,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -359,8 +322,8 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
||||||
assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"])
|
assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"])
|
||||||
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
||||||
assert.Nil(t, applicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, applicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
validateRoutableEventPayload(
|
validateRoutableEventPayload(
|
||||||
|
|
@ -386,13 +349,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||||
assert.NoError(t,
|
assert.NoError(t,
|
||||||
(*auditApi).LogWithTrace(
|
(*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
RoutableSystemIdentifier,
|
RoutableSystemIdentifier,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
// Receive the event from solace
|
// Receive the event from solace
|
||||||
|
|
@ -411,8 +372,8 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
||||||
assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"])
|
assert.Equal(t, "application/cloudevents+protobuf", applicationProperties["cloudEvents:datacontenttype"])
|
||||||
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
||||||
assert.Nil(t, applicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Nil(t, applicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
validateRoutableEventPayload(
|
validateRoutableEventPayload(
|
||||||
|
|
@ -438,14 +399,11 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
|
|
||||||
// Log the event to solace
|
// Log the event to solace
|
||||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||||
assert.NoError(t, (*auditApi).LogWithTrace(
|
assert.NoError(t, (*auditApi).Log(
|
||||||
ctx,
|
ctx,
|
||||||
event,
|
event,
|
||||||
visibility,
|
visibility,
|
||||||
NewRoutableIdentifier(objectIdentifier),
|
NewRoutableIdentifier(objectIdentifier)))
|
||||||
&traceParent,
|
|
||||||
&traceState,
|
|
||||||
))
|
|
||||||
|
|
||||||
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
message, err := solaceContainer.NextMessageFromQueue(ctx, queueName, true)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
@ -457,9 +415,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
||||||
objectIdentifier,
|
objectIdentifier,
|
||||||
event,
|
event,
|
||||||
"stackit.resourcemanager.v2.organization.created",
|
"stackit.resourcemanager.v2.organization.created",
|
||||||
visibility,
|
visibility)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -471,8 +427,6 @@ func validateSentEvent(
|
||||||
event *auditV1.AuditLogEntry,
|
event *auditV1.AuditLogEntry,
|
||||||
operationName string,
|
operationName string,
|
||||||
visibility auditV1.Visibility,
|
visibility auditV1.Visibility,
|
||||||
traceParent *string,
|
|
||||||
traceState *string,
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Check topic name
|
// Check topic name
|
||||||
|
|
@ -489,8 +443,8 @@ func validateSentEvent(
|
||||||
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
assert.Equal(t, event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime().UnixMilli(), applicationProperties["cloudEvents:time"])
|
||||||
assert.Equal(t, ContentTypeCloudEventsProtobuf, applicationProperties["cloudEvents:datacontenttype"])
|
assert.Equal(t, ContentTypeCloudEventsProtobuf, applicationProperties["cloudEvents:datacontenttype"])
|
||||||
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
assert.Equal(t, "audit.v1.RoutableAuditEvent", applicationProperties["cloudEvents:type"])
|
||||||
assert.Equal(t, *traceParent, applicationProperties["cloudEvents:traceparent"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:traceparent"])
|
||||||
assert.Equal(t, *traceState, applicationProperties["cloudEvents:tracestate"])
|
assert.Equal(t, "", applicationProperties["cloudEvents:tracestate"])
|
||||||
|
|
||||||
// Check deserialized message
|
// Check deserialized message
|
||||||
validateRoutableEventPayload(
|
validateRoutableEventPayload(
|
||||||
|
|
@ -546,10 +500,13 @@ func TestRoutableAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.T) {
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := routableAuditApi{validator: &protobufValidator}
|
auditApi := routableAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
_, err := auditApi.ValidateAndSerialize(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, expectedError)
|
assert.ErrorIs(t, err, expectedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -560,15 +517,18 @@ func TestRoutableAuditApi_Log_ValidationFailed(t *testing.T) {
|
||||||
validator.On("Validate", mock.Anything).Return(expectedError)
|
validator.On("Validate", mock.Anything).Return(expectedError)
|
||||||
var protobufValidator ProtobufValidator = validator
|
var protobufValidator ProtobufValidator = validator
|
||||||
|
|
||||||
auditApi := routableAuditApi{validator: &protobufValidator}
|
auditApi := routableAuditApi{
|
||||||
|
tracer: otel.Tracer("test"),
|
||||||
|
validator: &protobufValidator,
|
||||||
|
}
|
||||||
|
|
||||||
event := newSystemAuditEvent(nil)
|
event := newSystemAuditEvent(nil)
|
||||||
err := auditApi.LogWithTrace(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier, nil, nil)
|
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, expectedError)
|
assert.ErrorIs(t, err, expectedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRoutableAuditApi_Log_NilEvent(t *testing.T) {
|
func TestRoutableAuditApi_Log_NilEvent(t *testing.T) {
|
||||||
auditApi := routableAuditApi{}
|
auditApi := routableAuditApi{tracer: otel.Tracer("test")}
|
||||||
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
err := auditApi.Log(context.Background(), nil, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||||
assert.ErrorIs(t, err, ErrEventNil)
|
assert.ErrorIs(t, err, ErrEventNil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
@ -73,6 +74,9 @@ type AuditLogEntryBuilder struct {
|
||||||
// Example: eu01
|
// Example: eu01
|
||||||
location string
|
location string
|
||||||
|
|
||||||
|
// Opentelemetry tracer
|
||||||
|
tracer trace.Tracer
|
||||||
|
|
||||||
// The ID of the K8s Pod, Service-Instance, etc. (must be unique for a sending service)
|
// The ID of the K8s Pod, Service-Instance, etc. (must be unique for a sending service)
|
||||||
workerId string
|
workerId string
|
||||||
}
|
}
|
||||||
|
|
@ -113,6 +117,7 @@ func NewAuditLogEntryBuilder() *AuditLogEntryBuilder {
|
||||||
AuditTime: nil,
|
AuditTime: nil,
|
||||||
},
|
},
|
||||||
location: "",
|
location: "",
|
||||||
|
tracer: otel.Tracer("audit-log-entry-builder"),
|
||||||
workerId: "",
|
workerId: "",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -317,7 +322,10 @@ func (builder *AuditLogEntryBuilder) WithResponseTime(responseTime time.Time) *A
|
||||||
// Returns:
|
// Returns:
|
||||||
// - The auditV1.AuditLogEntry protobuf message or
|
// - The auditV1.AuditLogEntry protobuf message or
|
||||||
// - Error if the entry cannot be built
|
// - Error if the entry cannot be built
|
||||||
func (builder *AuditLogEntryBuilder) Build(_ context.Context, sequenceNumber SequenceNumber) (*auditV1.AuditLogEntry, error) {
|
func (builder *AuditLogEntryBuilder) Build(ctx context.Context, sequenceNumber SequenceNumber) (*auditV1.AuditLogEntry, error) {
|
||||||
|
_, span := builder.tracer.Start(ctx, "build-audit-log-entry")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
auditTime := time.Now()
|
auditTime := time.Now()
|
||||||
builder.auditMetadata.AuditTime = &auditTime
|
builder.auditMetadata.AuditTime = &auditTime
|
||||||
|
|
||||||
|
|
@ -362,8 +370,6 @@ func (builder *AuditLogEntryBuilder) Build(_ context.Context, sequenceNumber Seq
|
||||||
builder.auditResponse,
|
builder.auditResponse,
|
||||||
details,
|
details,
|
||||||
builder.auditMetadata,
|
builder.auditMetadata,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -399,9 +405,6 @@ func NewAuditEventBuilder(
|
||||||
// The sequence number generator can be used to get and revert sequence numbers to build audit log events
|
// The sequence number generator can be used to get and revert sequence numbers to build audit log events
|
||||||
sequenceNumberGenerator *utils.SequenceNumberGenerator,
|
sequenceNumberGenerator *utils.SequenceNumberGenerator,
|
||||||
|
|
||||||
// Tracer
|
|
||||||
tracer trace.Tracer,
|
|
||||||
|
|
||||||
// The service name in lowercase (allowed characters are [a-z-]).
|
// The service name in lowercase (allowed characters are [a-z-]).
|
||||||
serviceName string,
|
serviceName string,
|
||||||
|
|
||||||
|
|
@ -418,7 +421,7 @@ func NewAuditEventBuilder(
|
||||||
WithRequiredWorkerId(workerId).
|
WithRequiredWorkerId(workerId).
|
||||||
WithRequiredLocation(location),
|
WithRequiredLocation(location),
|
||||||
sequenceNumberGenerator: sequenceNumberGenerator,
|
sequenceNumberGenerator: sequenceNumberGenerator,
|
||||||
tracer: tracer,
|
tracer: otel.Tracer("audit-event-builder"),
|
||||||
visibility: auditV1.Visibility_VISIBILITY_PUBLIC,
|
visibility: auditV1.Visibility_VISIBILITY_PUBLIC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -616,6 +619,10 @@ func (builder *AuditEventBuilder) Build(ctx context.Context, sequenceNumber Sequ
|
||||||
return nil, nil, fmt.Errorf("audit log entry builder not set")
|
return nil, nil, fmt.Errorf("audit log entry builder not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx, span := builder.tracer.Start(ctx, "build-audit-event")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
visibility := builder.visibility
|
||||||
objectId := builder.auditLogEntryBuilder.auditParams.ObjectId
|
objectId := builder.auditLogEntryBuilder.auditParams.ObjectId
|
||||||
objectType := builder.auditLogEntryBuilder.auditParams.ObjectType
|
objectType := builder.auditLogEntryBuilder.auditParams.ObjectType
|
||||||
var routingIdentifier *RoutableIdentifier
|
var routingIdentifier *RoutableIdentifier
|
||||||
|
|
@ -638,19 +645,8 @@ func (builder *AuditEventBuilder) Build(ctx context.Context, sequenceNumber Sequ
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, span := builder.tracer.Start(ctx, "create-audit-event")
|
|
||||||
defer span.End()
|
|
||||||
|
|
||||||
w3cTraceParent := TraceParentFromSpan(span)
|
|
||||||
var traceParent = &w3cTraceParent
|
|
||||||
var traceState *string = nil
|
|
||||||
visibility := builder.visibility
|
|
||||||
|
|
||||||
// Validate and serialize the protobuf event into a cloud event
|
// Validate and serialize the protobuf event into a cloud event
|
||||||
_, validateSerializeSpan := builder.tracer.Start(ctx, "validate-and-serialize-audit-event")
|
cloudEvent, err := (*builder.api).ValidateAndSerialize(ctx, auditLogEntry, visibility, routingIdentifier)
|
||||||
cloudEvent, err := (*builder.api).ValidateAndSerializeWithTrace(auditLogEntry, visibility, routingIdentifier, traceParent, traceState)
|
|
||||||
validateSerializeSpan.End()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"github.com/bufbuild/protovalidate-go"
|
"github.com/bufbuild/protovalidate-go"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go.opentelemetry.io/otel"
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||||
|
|
@ -118,8 +117,6 @@ func Test_AuditLogEntryBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, "projects/1/logs/admin-activity", logEntry.LogName)
|
assert.Equal(t, "projects/1/logs/admin-activity", logEntry.LogName)
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Nil(t, logEntry.CorrelationId)
|
assert.Nil(t, logEntry.CorrelationId)
|
||||||
|
|
@ -236,8 +233,6 @@ func Test_AuditLogEntryBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, "projects/1/logs/policy-denied", logEntry.LogName)
|
assert.Equal(t, "projects/1/logs/policy-denied", logEntry.LogName)
|
||||||
assert.Equal(t, map[string]string{"key": "label"}, logEntry.Labels)
|
assert.Equal(t, map[string]string{"key": "label"}, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_ERROR, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_ERROR, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Equal(t, "correlationId", *logEntry.CorrelationId)
|
assert.Equal(t, "correlationId", *logEntry.CorrelationId)
|
||||||
|
|
@ -327,8 +322,6 @@ func Test_AuditLogEntryBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Nil(t, logEntry.CorrelationId)
|
assert.Nil(t, logEntry.CorrelationId)
|
||||||
|
|
@ -519,9 +512,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("nothing set", func(t *testing.T) {
|
t.Run("nothing set", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
Build(context.Background(), SequenceNumber(1))
|
Build(context.Background(), SequenceNumber(1))
|
||||||
|
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
@ -533,9 +525,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("details missing", func(t *testing.T) {
|
t.Run("details missing", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredObjectId("objectId").
|
WithRequiredObjectId("objectId").
|
||||||
WithRequiredObjectType(ObjectTypeProject).
|
WithRequiredObjectType(ObjectTypeProject).
|
||||||
Build(context.Background(), SequenceNumber(1))
|
Build(context.Background(), SequenceNumber(1))
|
||||||
|
|
@ -549,11 +540,10 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("required only", func(t *testing.T) {
|
t.Run("required only", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
objectId := uuid.NewString()
|
objectId := uuid.NewString()
|
||||||
operation := "stackit.demo-service.v1.operation"
|
operation := "stackit.demo-service.v1.operation"
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredObjectId(objectId).
|
WithRequiredObjectId(objectId).
|
||||||
WithRequiredObjectType(ObjectTypeProject).
|
WithRequiredObjectType(ObjectTypeProject).
|
||||||
WithRequiredOperation(operation).
|
WithRequiredOperation(operation).
|
||||||
|
|
@ -587,8 +577,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
||||||
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
||||||
assert.NotNil(t, cloudEvent.Time)
|
assert.NotNil(t, cloudEvent.Time)
|
||||||
assert.Equal(t, "00-00000000000000000000000000000000-0000000000000000-00", *cloudEvent.TraceParent)
|
assert.Equal(t, "", *cloudEvent.TraceParent)
|
||||||
assert.Nil(t, cloudEvent.TraceState)
|
assert.Equal(t, "", *cloudEvent.TraceState)
|
||||||
|
|
||||||
var routableAuditEvent auditV1.RoutableAuditEvent
|
var routableAuditEvent auditV1.RoutableAuditEvent
|
||||||
assert.NotNil(t, cloudEvent.Data)
|
assert.NotNil(t, cloudEvent.Data)
|
||||||
|
|
@ -605,8 +595,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("projects/%s/logs/admin-activity", objectId), logEntry.LogName)
|
assert.Equal(t, fmt.Sprintf("projects/%s/logs/admin-activity", objectId), logEntry.LogName)
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Nil(t, logEntry.CorrelationId)
|
assert.Nil(t, logEntry.CorrelationId)
|
||||||
|
|
@ -676,7 +664,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("with details", func(t *testing.T) {
|
t.Run("with details", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
objectId := uuid.NewString()
|
objectId := uuid.NewString()
|
||||||
operation := "stackit.demo-service.v1.operation"
|
operation := "stackit.demo-service.v1.operation"
|
||||||
|
|
@ -688,7 +675,7 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
responseBody := map[string]interface{}{"key": "response"}
|
responseBody := map[string]interface{}{"key": "response"}
|
||||||
responseBodyBytes, err := ResponseBodyToBytes(responseBody)
|
responseBodyBytes, err := ResponseBodyToBytes(responseBody)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredObjectId(objectId).
|
WithRequiredObjectId(objectId).
|
||||||
WithRequiredObjectType(ObjectTypeProject).
|
WithRequiredObjectType(ObjectTypeProject).
|
||||||
WithRequiredOperation(operation).
|
WithRequiredOperation(operation).
|
||||||
|
|
@ -737,8 +724,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
||||||
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
||||||
assert.NotNil(t, cloudEvent.Time)
|
assert.NotNil(t, cloudEvent.Time)
|
||||||
assert.Equal(t, "00-00000000000000000000000000000000-0000000000000000-00", *cloudEvent.TraceParent)
|
assert.Equal(t, "", *cloudEvent.TraceParent)
|
||||||
assert.Nil(t, cloudEvent.TraceState)
|
assert.Equal(t, "", *cloudEvent.TraceState)
|
||||||
|
|
||||||
var routableAuditEvent auditV1.RoutableAuditEvent
|
var routableAuditEvent auditV1.RoutableAuditEvent
|
||||||
assert.NotNil(t, cloudEvent.Data)
|
assert.NotNil(t, cloudEvent.Data)
|
||||||
|
|
@ -755,8 +742,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("projects/%s/logs/admin-activity", objectId), logEntry.LogName)
|
assert.Equal(t, fmt.Sprintf("projects/%s/logs/admin-activity", objectId), logEntry.LogName)
|
||||||
assert.Equal(t, map[string]string{"key": "label"}, logEntry.Labels)
|
assert.Equal(t, map[string]string{"key": "label"}, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_ERROR, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_ERROR, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Equal(t, "correlationId", *logEntry.CorrelationId)
|
assert.Equal(t, "correlationId", *logEntry.CorrelationId)
|
||||||
|
|
@ -833,11 +818,10 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("system event with object reference", func(t *testing.T) {
|
t.Run("system event with object reference", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
objectId := uuid.NewString()
|
objectId := uuid.NewString()
|
||||||
operation := "stackit.demo-service.v1.operation"
|
operation := "stackit.demo-service.v1.operation"
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredObjectId(objectId).
|
WithRequiredObjectId(objectId).
|
||||||
WithRequiredObjectType(ObjectTypeProject).
|
WithRequiredObjectType(ObjectTypeProject).
|
||||||
WithRequiredOperation(operation).
|
WithRequiredOperation(operation).
|
||||||
|
|
@ -858,8 +842,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
||||||
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
assert.Equal(t, fmt.Sprintf("projects/%s", objectId), cloudEvent.Subject)
|
||||||
assert.NotNil(t, cloudEvent.Time)
|
assert.NotNil(t, cloudEvent.Time)
|
||||||
assert.Equal(t, "00-00000000000000000000000000000000-0000000000000000-00", *cloudEvent.TraceParent)
|
assert.Equal(t, "", *cloudEvent.TraceParent)
|
||||||
assert.Nil(t, cloudEvent.TraceState)
|
assert.Equal(t, "", *cloudEvent.TraceState)
|
||||||
|
|
||||||
var routableAuditEvent auditV1.RoutableAuditEvent
|
var routableAuditEvent auditV1.RoutableAuditEvent
|
||||||
assert.NotNil(t, cloudEvent.Data)
|
assert.NotNil(t, cloudEvent.Data)
|
||||||
|
|
@ -876,8 +860,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Nil(t, logEntry.CorrelationId)
|
assert.Nil(t, logEntry.CorrelationId)
|
||||||
|
|
@ -948,10 +930,9 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("system event", func(t *testing.T) {
|
t.Run("system event", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
operation := "stackit.demo-service.v1.operation"
|
operation := "stackit.demo-service.v1.operation"
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredOperation(operation).
|
WithRequiredOperation(operation).
|
||||||
AsSystemEvent()
|
AsSystemEvent()
|
||||||
|
|
||||||
|
|
@ -970,8 +951,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
assert.Equal(t, "1.0", cloudEvent.SpecVersion)
|
||||||
assert.Equal(t, fmt.Sprintf("system/%s", uuid.Nil.String()), cloudEvent.Subject)
|
assert.Equal(t, fmt.Sprintf("system/%s", uuid.Nil.String()), cloudEvent.Subject)
|
||||||
assert.NotNil(t, cloudEvent.Time)
|
assert.NotNil(t, cloudEvent.Time)
|
||||||
assert.Equal(t, "00-00000000000000000000000000000000-0000000000000000-00", *cloudEvent.TraceParent)
|
assert.Equal(t, "", *cloudEvent.TraceParent)
|
||||||
assert.Nil(t, cloudEvent.TraceState)
|
assert.Equal(t, "", *cloudEvent.TraceState)
|
||||||
|
|
||||||
var routableAuditEvent auditV1.RoutableAuditEvent
|
var routableAuditEvent auditV1.RoutableAuditEvent
|
||||||
assert.NotNil(t, cloudEvent.Data)
|
assert.NotNil(t, cloudEvent.Data)
|
||||||
|
|
@ -988,8 +969,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
assert.Equal(t, fmt.Sprintf("system/%s/logs/system-event", uuid.Nil.String()), logEntry.LogName)
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
assert.Equal(t, auditV1.LogSeverity_LOG_SEVERITY_DEFAULT, logEntry.Severity)
|
||||||
assert.NotNil(t, logEntry.Timestamp)
|
assert.NotNil(t, logEntry.Timestamp)
|
||||||
assert.Nil(t, logEntry.CorrelationId)
|
assert.Nil(t, logEntry.CorrelationId)
|
||||||
|
|
@ -1060,7 +1039,6 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("with responsebody unserialized", func(t *testing.T) {
|
t.Run("with responsebody unserialized", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
objectId := uuid.NewString()
|
objectId := uuid.NewString()
|
||||||
operation := "stackit.demo-service.v1.operation"
|
operation := "stackit.demo-service.v1.operation"
|
||||||
|
|
@ -1070,7 +1048,7 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
requestTime := time.Now().AddDate(0, 0, -2).UTC()
|
requestTime := time.Now().AddDate(0, 0, -2).UTC()
|
||||||
responseTime := time.Now().AddDate(0, 0, -1).UTC()
|
responseTime := time.Now().AddDate(0, 0, -1).UTC()
|
||||||
responseBody := map[string]interface{}{"key": "response"}
|
responseBody := map[string]interface{}{"key": "response"}
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithRequiredObjectId(objectId).
|
WithRequiredObjectId(objectId).
|
||||||
WithRequiredObjectType(ObjectTypeProject).
|
WithRequiredObjectType(ObjectTypeProject).
|
||||||
WithRequiredOperation(operation).
|
WithRequiredOperation(operation).
|
||||||
|
|
@ -1134,9 +1112,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("no entry builder", func(t *testing.T) {
|
t.Run("no entry builder", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01").
|
cloudEvent, routingIdentifier, err := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01").
|
||||||
WithAuditLogEntryBuilder(nil).Build(context.Background(), SequenceNumber(1))
|
WithAuditLogEntryBuilder(nil).Build(context.Background(), SequenceNumber(1))
|
||||||
|
|
||||||
assert.EqualError(t, err, "audit log entry builder not set")
|
assert.EqualError(t, err, "audit log entry builder not set")
|
||||||
|
|
@ -1147,9 +1124,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("next sequence number", func(t *testing.T) {
|
t.Run("next sequence number", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01")
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01")
|
||||||
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
||||||
assert.Equal(t, SequenceNumber(1), builder.NextSequenceNumber())
|
assert.Equal(t, SequenceNumber(1), builder.NextSequenceNumber())
|
||||||
})
|
})
|
||||||
|
|
@ -1157,9 +1133,8 @@ func Test_AuditEventBuilder(t *testing.T) {
|
||||||
t.Run("revert sequence number", func(t *testing.T) {
|
t.Run("revert sequence number", func(t *testing.T) {
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", "worker-id", "eu01")
|
builder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", "worker-id", "eu01")
|
||||||
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
||||||
builder.RevertSequenceNumber()
|
builder.RevertSequenceNumber()
|
||||||
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
assert.Equal(t, SequenceNumber(0), builder.NextSequenceNumber())
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"github.com/bufbuild/protovalidate-go"
|
"github.com/bufbuild/protovalidate-go"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go.opentelemetry.io/otel"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -15,10 +14,9 @@ func Test_LogEvent(t *testing.T) {
|
||||||
|
|
||||||
api, _ := NewMockAuditApi()
|
api, _ := NewMockAuditApi()
|
||||||
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
sequenceNumberGenerator := utils.NewDefaultSequenceNumberGenerator()
|
||||||
tracer := otel.Tracer("test-tracer")
|
|
||||||
|
|
||||||
t.Run("new format", func(t *testing.T) {
|
t.Run("new format", func(t *testing.T) {
|
||||||
eventBuilder := NewAuditEventBuilder(api, sequenceNumberGenerator, tracer, "demo-service", uuid.NewString(), "eu01")
|
eventBuilder := NewAuditEventBuilder(api, sequenceNumberGenerator, "demo-service", uuid.NewString(), "eu01")
|
||||||
|
|
||||||
cloudEvent, _, err := eventBuilder.
|
cloudEvent, _, err := eventBuilder.
|
||||||
WithRequiredApiRequest(ApiRequest{
|
WithRequiredApiRequest(ApiRequest{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"go.opentelemetry.io/otel/trace"
|
|
||||||
"google.golang.org/protobuf/encoding/protojson"
|
"google.golang.org/protobuf/encoding/protojson"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
|
|
@ -294,12 +293,6 @@ func NewAuditLogEntry(
|
||||||
|
|
||||||
// Required metadata
|
// Required metadata
|
||||||
auditMetadata AuditMetadata,
|
auditMetadata AuditMetadata,
|
||||||
|
|
||||||
// Optional W3C trace parent
|
|
||||||
userProvidedTraceParent *string,
|
|
||||||
|
|
||||||
// Optional W3C trace state
|
|
||||||
userProvidedTraceState *string,
|
|
||||||
) (*auditV1.AuditLogEntry, error) {
|
) (*auditV1.AuditLogEntry, error) {
|
||||||
|
|
||||||
// Get request headers
|
// Get request headers
|
||||||
|
|
@ -407,8 +400,6 @@ func NewAuditLogEntry(
|
||||||
CorrelationId: auditRequest.RequestCorrelationId,
|
CorrelationId: auditRequest.RequestCorrelationId,
|
||||||
Timestamp: timestamppb.New(concreteAuditTime),
|
Timestamp: timestamppb.New(concreteAuditTime),
|
||||||
Severity: auditMetadata.AuditLogSeverity,
|
Severity: auditMetadata.AuditLogSeverity,
|
||||||
TraceParent: userProvidedTraceParent,
|
|
||||||
TraceState: userProvidedTraceState,
|
|
||||||
}
|
}
|
||||||
return &event, nil
|
return &event, nil
|
||||||
}
|
}
|
||||||
|
|
@ -431,29 +422,6 @@ func GetCalledServiceNameFromRequest(request *ApiRequest, fallbackName string) s
|
||||||
return calledServiceName
|
return calledServiceName
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuditSpan is an abstraction for trace.Span that can easier be tested
|
|
||||||
type AuditSpan interface {
|
|
||||||
SpanContext() trace.SpanContext
|
|
||||||
}
|
|
||||||
|
|
||||||
// TraceParentFromSpan returns W3C conform trace parent from AuditSpan
|
|
||||||
func TraceParentFromSpan(span AuditSpan) string {
|
|
||||||
traceVersion := "00"
|
|
||||||
traceId := span.SpanContext().TraceID().String()
|
|
||||||
parentId := span.SpanContext().SpanID().String()
|
|
||||||
// Trace flags according to W3C documentation:
|
|
||||||
// https://www.w3.org/TR/trace-context/#sampled-flag
|
|
||||||
var traceFlags = "00"
|
|
||||||
if span.SpanContext().TraceFlags().IsSampled() {
|
|
||||||
traceFlags = "01"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Format: <version>-<trace-id>-<parent-id>-<trace-flags>
|
|
||||||
// Example: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
w3cTraceParent := fmt.Sprintf("%s-%s-%s-%s", traceVersion, traceId, parentId, traceFlags)
|
|
||||||
return w3cTraceParent
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPbInt64Value returns protobuf int64 wrapper if value is not nil.
|
// NewPbInt64Value returns protobuf int64 wrapper if value is not nil.
|
||||||
func NewPbInt64Value(value *int64) *wrapperspb.Int64Value {
|
func NewPbInt64Value(value *int64) *wrapperspb.Int64Value {
|
||||||
if value != nil {
|
if value != nil {
|
||||||
|
|
|
||||||
|
|
@ -1,72 +1,21 @@
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/gen/go/audit/v1"
|
auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/gen/go/audit/v1"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go.opentelemetry.io/otel"
|
|
||||||
"go.opentelemetry.io/otel/trace"
|
|
||||||
"google.golang.org/protobuf/encoding/protojson"
|
"google.golang.org/protobuf/encoding/protojson"
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type mockSpan struct {
|
|
||||||
spanContext trace.SpanContext
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *mockSpan) SpanContext() trace.SpanContext {
|
|
||||||
return s.spanContext
|
|
||||||
}
|
|
||||||
|
|
||||||
func Test_TraceParentFromSpan(t *testing.T) {
|
|
||||||
tracer := otel.Tracer("test")
|
|
||||||
|
|
||||||
verifyTraceParent := func(traceParent string, span trace.Span, isSampled bool) {
|
|
||||||
parts := strings.Split(traceParent, "-")
|
|
||||||
assert.Equal(t, 4, len(parts))
|
|
||||||
|
|
||||||
// trace version
|
|
||||||
assert.Equal(t, "00", parts[0])
|
|
||||||
assert.Equal(t, span.SpanContext().TraceID().String(), parts[1])
|
|
||||||
assert.Equal(t, span.SpanContext().SpanID().String(), parts[2])
|
|
||||||
|
|
||||||
var traceFlags = "00"
|
|
||||||
if isSampled {
|
|
||||||
traceFlags = "01"
|
|
||||||
}
|
|
||||||
assert.Equal(t, traceFlags, parts[3])
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Run("sampled", func(t *testing.T) {
|
|
||||||
_, span := tracer.Start(context.Background(), "test")
|
|
||||||
updatedFlags := span.SpanContext().TraceFlags().WithSampled(true)
|
|
||||||
updatedContext := span.SpanContext().WithTraceFlags(updatedFlags)
|
|
||||||
|
|
||||||
mockedSpan := mockSpan{
|
|
||||||
spanContext: updatedContext,
|
|
||||||
}
|
|
||||||
|
|
||||||
traceParent := TraceParentFromSpan(&mockedSpan)
|
|
||||||
verifyTraceParent(traceParent, span, true)
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("non-sampled", func(t *testing.T) {
|
|
||||||
_, span := tracer.Start(context.Background(), "test")
|
|
||||||
traceParent := TraceParentFromSpan(span)
|
|
||||||
verifyTraceParent(traceParent, span, false)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func Test_GetCalledServiceNameFromRequest(t *testing.T) {
|
func Test_GetCalledServiceNameFromRequest(t *testing.T) {
|
||||||
|
|
||||||
t.Run("request is nil", func(t *testing.T) {
|
t.Run("request is nil", func(t *testing.T) {
|
||||||
|
|
@ -684,9 +633,7 @@ func Test_NewAuditLogEntry(t *testing.T) {
|
||||||
auditRequest,
|
auditRequest,
|
||||||
auditResponse,
|
auditResponse,
|
||||||
nil,
|
nil,
|
||||||
auditMetadata,
|
auditMetadata)
|
||||||
nil,
|
|
||||||
nil)
|
|
||||||
|
|
||||||
assert.Equal(t, logName, logEntry.LogName)
|
assert.Equal(t, logName, logEntry.LogName)
|
||||||
assert.Equal(t, insertId, logEntry.InsertId)
|
assert.Equal(t, insertId, logEntry.InsertId)
|
||||||
|
|
@ -694,8 +641,6 @@ func Test_NewAuditLogEntry(t *testing.T) {
|
||||||
assert.Equal(t, severity, logEntry.Severity)
|
assert.Equal(t, severity, logEntry.Severity)
|
||||||
assert.NoError(t, logEntry.Timestamp.CheckValid())
|
assert.NoError(t, logEntry.Timestamp.CheckValid())
|
||||||
assert.Nil(t, logEntry.Labels)
|
assert.Nil(t, logEntry.Labels)
|
||||||
assert.Nil(t, logEntry.TraceParent)
|
|
||||||
assert.Nil(t, logEntry.TraceState)
|
|
||||||
|
|
||||||
payload := logEntry.ProtoPayload
|
payload := logEntry.ProtoPayload
|
||||||
assert.NotNil(t, payload)
|
assert.NotNil(t, payload)
|
||||||
|
|
@ -813,16 +758,11 @@ func Test_NewAuditLogEntry(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
eventMetadata := map[string]interface{}{"key": "value"}
|
eventMetadata := map[string]interface{}{"key": "value"}
|
||||||
|
|
||||||
traceParent := "traceParent"
|
|
||||||
traceState := "traceState"
|
|
||||||
logEntry, _ := NewAuditLogEntry(
|
logEntry, _ := NewAuditLogEntry(
|
||||||
auditRequest,
|
auditRequest,
|
||||||
auditResponse,
|
auditResponse,
|
||||||
&eventMetadata,
|
&eventMetadata,
|
||||||
auditMetadata,
|
auditMetadata)
|
||||||
&traceParent,
|
|
||||||
&traceState)
|
|
||||||
|
|
||||||
assert.Equal(t, logName, logEntry.LogName)
|
assert.Equal(t, logName, logEntry.LogName)
|
||||||
assert.Equal(t, insertId, logEntry.InsertId)
|
assert.Equal(t, insertId, logEntry.InsertId)
|
||||||
|
|
@ -830,8 +770,6 @@ func Test_NewAuditLogEntry(t *testing.T) {
|
||||||
assert.Equal(t, correlationId, *logEntry.CorrelationId)
|
assert.Equal(t, correlationId, *logEntry.CorrelationId)
|
||||||
assert.Equal(t, timestamppb.New(auditTime), logEntry.Timestamp)
|
assert.Equal(t, timestamppb.New(auditTime), logEntry.Timestamp)
|
||||||
assert.Equal(t, severity, logEntry.Severity)
|
assert.Equal(t, severity, logEntry.Severity)
|
||||||
assert.Equal(t, &traceParent, logEntry.TraceParent)
|
|
||||||
assert.Equal(t, &traceState, logEntry.TraceState)
|
|
||||||
assert.NotNil(t, logEntry.ProtoPayload)
|
assert.NotNil(t, logEntry.ProtoPayload)
|
||||||
|
|
||||||
payload := logEntry.ProtoPayload
|
payload := logEntry.ProtoPayload
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,6 @@ func newOrganizationAuditEvent(
|
||||||
CorrelationId: &correlationId,
|
CorrelationId: &correlationId,
|
||||||
Timestamp: timestamppb.New(time.Now()),
|
Timestamp: timestamppb.New(time.Now()),
|
||||||
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
||||||
TraceParent: nil,
|
|
||||||
TraceState: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
objectIdentifier := &auditV1.ObjectIdentifier{
|
objectIdentifier := &auditV1.ObjectIdentifier{
|
||||||
|
|
@ -189,8 +187,6 @@ func newFolderAuditEvent(
|
||||||
CorrelationId: &correlationId,
|
CorrelationId: &correlationId,
|
||||||
Timestamp: timestamppb.New(time.Now()),
|
Timestamp: timestamppb.New(time.Now()),
|
||||||
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
||||||
TraceParent: nil,
|
|
||||||
TraceState: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
objectIdentifier := &auditV1.ObjectIdentifier{
|
objectIdentifier := &auditV1.ObjectIdentifier{
|
||||||
|
|
@ -281,8 +277,6 @@ func newProjectAuditEvent(
|
||||||
CorrelationId: &correlationId,
|
CorrelationId: &correlationId,
|
||||||
Timestamp: timestamppb.New(time.Now()),
|
Timestamp: timestamppb.New(time.Now()),
|
||||||
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
||||||
TraceParent: nil,
|
|
||||||
TraceState: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
objectIdentifier := &auditV1.ObjectIdentifier{
|
objectIdentifier := &auditV1.ObjectIdentifier{
|
||||||
|
|
@ -368,8 +362,6 @@ func newProjectSystemAuditEvent(
|
||||||
CorrelationId: &correlationId,
|
CorrelationId: &correlationId,
|
||||||
Timestamp: timestamppb.New(time.Now()),
|
Timestamp: timestamppb.New(time.Now()),
|
||||||
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
||||||
TraceParent: nil,
|
|
||||||
TraceState: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if customization != nil {
|
if customization != nil {
|
||||||
|
|
@ -450,8 +442,6 @@ func newSystemAuditEvent(
|
||||||
CorrelationId: &correlationId,
|
CorrelationId: &correlationId,
|
||||||
Timestamp: timestamppb.New(time.Now()),
|
Timestamp: timestamppb.New(time.Now()),
|
||||||
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
Severity: auditV1.LogSeverity_LOG_SEVERITY_DEFAULT,
|
||||||
TraceParent: nil,
|
|
||||||
TraceState: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if customization != nil {
|
if customization != nil {
|
||||||
|
|
|
||||||
34
audit/api/trace.go
Normal file
34
audit/api/trace.go
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"go.opentelemetry.io/otel/propagation"
|
||||||
|
)
|
||||||
|
|
||||||
|
const traceParentHeader = "traceparent"
|
||||||
|
const traceStateHeader = "tracestate"
|
||||||
|
|
||||||
|
// TraceParentAndStateFromContext returns W3C conform trace parent and state from context
|
||||||
|
func TraceParentAndStateFromContext(ctx context.Context) (string, string) {
|
||||||
|
mapCarrier := propagation.MapCarrier{}
|
||||||
|
propagator := propagation.TraceContext{}
|
||||||
|
propagator.Inject(ctx, mapCarrier)
|
||||||
|
|
||||||
|
// Get trace parent from context w3c conform format
|
||||||
|
// Format: <version>-<trace-id>-<parent-id>-<trace-flags>
|
||||||
|
// Example: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
||||||
|
traceParent := mapCarrier[traceParentHeader]
|
||||||
|
traceState := mapCarrier[traceStateHeader]
|
||||||
|
|
||||||
|
return traceParent, traceState
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddTraceParentAndStateToContext adds trace and state related information to the given context.
|
||||||
|
func AddTraceParentAndStateToContext(ctx context.Context, traceParent string, traceState string) context.Context {
|
||||||
|
mapCarrier := propagation.MapCarrier{}
|
||||||
|
mapCarrier[traceParentHeader] = traceParent
|
||||||
|
mapCarrier[traceStateHeader] = traceState
|
||||||
|
|
||||||
|
propagator := propagation.TraceContext{}
|
||||||
|
return propagator.Extract(ctx, mapCarrier)
|
||||||
|
}
|
||||||
42
audit/api/trace_test.go
Normal file
42
audit/api/trace_test.go
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_AddTraceParentAndStateToContext(t *testing.T) {
|
||||||
|
expectedTraceParent := "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
||||||
|
expectedTraceState := "key1=value1,key2=value2"
|
||||||
|
ctx := AddTraceParentAndStateToContext(
|
||||||
|
context.Background(),
|
||||||
|
expectedTraceParent,
|
||||||
|
expectedTraceState)
|
||||||
|
|
||||||
|
span := trace.SpanFromContext(ctx)
|
||||||
|
|
||||||
|
assert.Equal(t, "00f067aa0ba902b7", span.SpanContext().SpanID().String())
|
||||||
|
assert.Equal(t, "4bf92f3577b34da6a3ce929d0e0e4736", span.SpanContext().TraceID().String())
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test_TraceParentAndStateFromContext(t *testing.T) {
|
||||||
|
tracer := otel.Tracer("test")
|
||||||
|
|
||||||
|
expectedTraceParent := "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
||||||
|
expectedTraceState := "key1=value1,key2=value2"
|
||||||
|
ctx := AddTraceParentAndStateToContext(
|
||||||
|
context.Background(),
|
||||||
|
expectedTraceParent,
|
||||||
|
expectedTraceState)
|
||||||
|
|
||||||
|
ctx, span := tracer.Start(ctx, "test")
|
||||||
|
traceParent, traceState := TraceParentAndStateFromContext(ctx)
|
||||||
|
|
||||||
|
assert.Equal(t, expectedTraceParent, traceParent)
|
||||||
|
assert.Equal(t, expectedTraceState, traceState)
|
||||||
|
assert.Equal(t, "00f067aa0ba902b7", span.SpanContext().SpanID().String())
|
||||||
|
assert.Equal(t, "4bf92f3577b34da6a3ce929d0e0e4736", span.SpanContext().TraceID().String())
|
||||||
|
}
|
||||||
|
|
@ -240,28 +240,6 @@ type AuditLogEntry struct {
|
||||||
//
|
//
|
||||||
// Required: true
|
// Required: true
|
||||||
Severity LogSeverity `protobuf:"varint,7,opt,name=severity,proto3,enum=audit.v1.LogSeverity" json:"severity,omitempty"`
|
Severity LogSeverity `protobuf:"varint,7,opt,name=severity,proto3,enum=audit.v1.LogSeverity" json:"severity,omitempty"`
|
||||||
// Customer set W3C conform trace parent header:
|
|
||||||
// https://www.w3.org/TR/trace-context/#traceparent-header
|
|
||||||
//
|
|
||||||
// Format: <version>-<trace-id>-<parent-id>-<trace-flags>
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
//
|
|
||||||
// "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
//
|
|
||||||
// Required: false
|
|
||||||
TraceParent *string `protobuf:"bytes,8,opt,name=trace_parent,json=traceParent,proto3,oneof" json:"trace_parent,omitempty"`
|
|
||||||
// Customer set W3C conform trace state header:
|
|
||||||
// https://www.w3.org/TR/trace-context/#tracestate-header
|
|
||||||
//
|
|
||||||
// Format: <key1>=<value1>[,<keyN>=<valueN>]
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
//
|
|
||||||
// "rojo=00f067aa0ba902b7,congo=t61rcWkgMzE"
|
|
||||||
//
|
|
||||||
// Required: false
|
|
||||||
TraceState *string `protobuf:"bytes,9,opt,name=trace_state,json=traceState,proto3,oneof" json:"trace_state,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AuditLogEntry) Reset() {
|
func (x *AuditLogEntry) Reset() {
|
||||||
|
|
@ -343,20 +321,6 @@ func (x *AuditLogEntry) GetSeverity() LogSeverity {
|
||||||
return LogSeverity_LOG_SEVERITY_UNSPECIFIED
|
return LogSeverity_LOG_SEVERITY_UNSPECIFIED
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AuditLogEntry) GetTraceParent() string {
|
|
||||||
if x != nil && x.TraceParent != nil {
|
|
||||||
return *x.TraceParent
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *AuditLogEntry) GetTraceState() string {
|
|
||||||
if x != nil && x.TraceState != nil {
|
|
||||||
return *x.TraceState
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// Common audit log format for STACKIT API operations.
|
// Common audit log format for STACKIT API operations.
|
||||||
type AuditLog struct {
|
type AuditLog struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
|
|
@ -1519,7 +1483,7 @@ 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,
|
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,
|
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,
|
0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x22, 0xfd, 0x05, 0x0a, 0x0d, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x45,
|
0x74, 0x6f, 0x22, 0xe2, 0x04, 0x0a, 0x0d, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x45,
|
||||||
0x6e, 0x74, 0x72, 0x79, 0x12, 0x78, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
0x6e, 0x74, 0x72, 0x79, 0x12, 0x78, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x5d, 0xba, 0x48, 0x5a, 0xc8, 0x01, 0x01, 0x72, 0x55,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x5d, 0xba, 0x48, 0x5a, 0xc8, 0x01, 0x01, 0x72, 0x55,
|
||||||
0x32, 0x53, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30,
|
0x32, 0x53, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30,
|
||||||
|
|
@ -1552,291 +1516,281 @@ var file_audit_v1_audit_event_proto_rawDesc = []byte{
|
||||||
0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x61, 0x75,
|
0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x61, 0x75,
|
||||||
0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69,
|
0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69,
|
||||||
0x74, 0x79, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52,
|
0x74, 0x79, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52,
|
||||||
0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x52, 0x0a, 0x0c, 0x74, 0x72, 0x61,
|
0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62,
|
||||||
0x63, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42,
|
0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||||
0x2a, 0xba, 0x48, 0x27, 0x72, 0x25, 0x32, 0x23, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x2d,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
||||||
0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x2d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d,
|
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||||
0x39, 0x5d, 0x2b, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0x48, 0x01, 0x52, 0x0b, 0x74,
|
0x3a, 0x02, 0x38, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61,
|
||||||
0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a,
|
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0xab, 0x06, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69,
|
||||||
0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01,
|
0x74, 0x4c, 0x6f, 0x67, 0x12, 0x2d, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f,
|
||||||
0x28, 0x09, 0x48, 0x02, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65,
|
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8,
|
||||||
0x88, 0x01, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74,
|
0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e,
|
||||||
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x61, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
|
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xba, 0x48, 0x4d,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x11,
|
0xc8, 0x01, 0x01, 0x72, 0x48, 0x10, 0x01, 0x18, 0xff, 0x01, 0x32, 0x41, 0x5e, 0x73, 0x74, 0x61,
|
||||||
0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69,
|
0x63, 0x6b, 0x69, 0x74, 0x5c, 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b,
|
||||||
0x64, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65,
|
0x5c, 0x2e, 0x28, 0x3f, 0x3a, 0x76, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x5c, 0x2e, 0x29, 0x3f,
|
||||||
0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61,
|
0x28, 0x3f, 0x3a, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x2e, 0x5d, 0x2b, 0x5c, 0x2e,
|
||||||
0x74, 0x65, 0x22, 0xab, 0x06, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x12,
|
0x29, 0x3f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x24, 0x52, 0x0d, 0x6f,
|
||||||
0x2d, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x63, 0x0a, 0x0d,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10,
|
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
|
||||||
0x01, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x77,
|
0x01, 0x28, 0x09, 0x42, 0x3e, 0xba, 0x48, 0x3b, 0xc8, 0x01, 0x01, 0x72, 0x36, 0x10, 0x01, 0x18,
|
||||||
0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
0xff, 0x01, 0x32, 0x2f, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xba, 0x48, 0x4d, 0xc8, 0x01, 0x01, 0x72, 0x48,
|
0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x28, 0x3f, 0x3a, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d,
|
||||||
0x10, 0x01, 0x18, 0xff, 0x01, 0x32, 0x41, 0x5e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x69, 0x74, 0x5c,
|
0x39, 0x2d, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5f, 0x5d, 0x2b,
|
||||||
0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x5c, 0x2e, 0x28, 0x3f, 0x3a,
|
0x29, 0x2a, 0x24, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d,
|
||||||
0x76, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x5c, 0x2e, 0x29, 0x3f, 0x28, 0x3f, 0x3a, 0x5b, 0x61,
|
0x65, 0x12, 0x55, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
||||||
0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x2e, 0x5d, 0x2b, 0x5c, 0x2e, 0x29, 0x3f, 0x5b, 0x61, 0x2d,
|
0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
|
||||||
0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x24, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
|
0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e,
|
||||||
0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75,
|
0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0xba, 0x48,
|
||||||
0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3e,
|
0x03, 0xc8, 0x01, 0x01, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61,
|
||||||
0xba, 0x48, 0x3b, 0xc8, 0x01, 0x01, 0x72, 0x36, 0x10, 0x01, 0x18, 0xff, 0x01, 0x32, 0x2f, 0x5e,
|
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4a, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x68,
|
||||||
|
0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05,
|
||||||
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e,
|
||||||
|
0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66,
|
||||||
|
0x6f, 0x52, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4c, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f,
|
||||||
|
0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
|
||||||
|
0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01,
|
||||||
|
0x01, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||||
|
0x74, 0x61, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 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, 0x00, 0x52, 0x07,
|
||||||
|
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x11, 0x72, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18,
|
||||||
|
0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31,
|
||||||
|
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
|
0x61, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x08, 0x72,
|
||||||
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x09, 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
|
0x73, 0x65, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
|
0x61, 0x18, 0x0a, 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, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42,
|
||||||
|
0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f,
|
||||||
|
0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, 0x65, 0x74,
|
||||||
|
0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf3, 0x02, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e,
|
||||||
|
0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x0c,
|
||||||
|
0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b,
|
||||||
|
0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0f, 0x70,
|
||||||
|
0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01,
|
||||||
|
0x18, 0xff, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x45, 0x6d,
|
||||||
|
0x61, 0x69, 0x6c, 0x12, 0x6e, 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61,
|
||||||
|
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x42, 0x37, 0xba, 0x48, 0x34, 0x72, 0x32, 0x32, 0x30, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d,
|
||||||
|
0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x2f, 0x73, 0x65,
|
||||||
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x5b,
|
||||||
|
0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x24, 0x48, 0x00, 0x52, 0x12, 0x73, 0x65,
|
||||||
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65,
|
||||||
|
0x88, 0x01, 0x01, 0x12, 0x6d, 0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61,
|
||||||
|
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61,
|
||||||
|
0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41,
|
||||||
|
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63,
|
||||||
|
0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e,
|
||||||
|
0x66, 0x6f, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61,
|
||||||
|
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x11,
|
||||||
|
0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66,
|
||||||
|
0x6f, 0x12, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x42, 0x39, 0xba, 0x48, 0x36, 0xc8, 0x01, 0x01, 0x72, 0x31, 0x32, 0x2f, 0x5e,
|
||||||
0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d,
|
0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d,
|
||||||
0x2b, 0x28, 0x3f, 0x3a, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x2f,
|
0x2b, 0x28, 0x3f, 0x3a, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x2f,
|
||||||
0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5f, 0x5d, 0x2b, 0x29, 0x2a, 0x24, 0x52, 0x0c,
|
0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5f, 0x5d, 0x2b, 0x29, 0x2a, 0x24, 0x52, 0x08,
|
||||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x13,
|
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d,
|
||||||
0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69,
|
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xba, 0x48,
|
||||||
0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x75, 0x64, 0x69,
|
0x24, 0x72, 0x22, 0x32, 0x20, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x28, 0x3f, 0x3a,
|
||||||
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
0x5c, 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x29, 0x2a, 0x5c, 0x2e, 0x5b, 0x61, 0x2d,
|
||||||
0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52,
|
0x7a, 0x2d, 0x5d, 0x2b, 0x24, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
|
||||||
0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
|
0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65,
|
||||||
0x6e, 0x66, 0x6f, 0x12, 0x4a, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61,
|
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73,
|
||||||
0x1b, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64,
|
||||||
0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x61, 0x75,
|
0x22, 0x89, 0x0b, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f,
|
||||||
0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12,
|
0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0xa8, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x49,
|
||||||
0x4c, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64,
|
0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x75, 0x64, 0x69,
|
0x09, 0x42, 0x2b, 0xba, 0x48, 0x28, 0xc8, 0x01, 0x01, 0x72, 0x23, 0x32, 0x21, 0x5e, 0x5b, 0x61,
|
||||||
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61,
|
0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x2d, 0x25, 0x2e, 0x5d, 0x2b, 0x2f, 0x5b, 0x61,
|
||||||
0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0f, 0x72, 0x65,
|
0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x2d, 0x25, 0x2e, 0x5d, 0x2b, 0x24, 0x52, 0x09,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a,
|
0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x64,
|
||||||
0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17,
|
0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75,
|
||||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d,
|
||||||
0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65,
|
0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||||
0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,
|
||||||
0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
|
0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73,
|
||||||
0x32, 0x1a, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
0x1a, 0xae, 0x04, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x02,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0xba, 0x48,
|
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01,
|
||||||
0x03, 0xc8, 0x01, 0x01, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65,
|
0x01, 0x12, 0x4a, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x0e, 0x32, 0x25, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74,
|
||||||
0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x48, 0x74,
|
||||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63,
|
0x74, 0x70, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01,
|
||||||
0x74, 0x48, 0x01, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x88, 0x01, 0x01,
|
0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x51, 0x0a,
|
||||||
0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01,
|
0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f,
|
||||||
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
|
||||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x02, 0x52, 0x08, 0x6d,
|
0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72,
|
0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f,
|
0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73,
|
||||||
0x6e, 0x73, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
0x12, 0x21, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d,
|
||||||
0x22, 0xf3, 0x02, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x04, 0x70,
|
||||||
0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6e, 0x63,
|
0x61, 0x74, 0x68, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba,
|
0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x68,
|
||||||
0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6e, 0x63,
|
0x6f, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x06, 0x20,
|
||||||
0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69,
|
0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52,
|
||||||
0x70, 0x61, 0x6c, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
|
0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79,
|
||||||
0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x0e,
|
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x88,
|
||||||
0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x6e,
|
0x01, 0x01, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xba, 0x48,
|
0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0b, 0xba, 0x48,
|
||||||
0x34, 0x72, 0x32, 0x32, 0x30, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x2f, 0x5b, 0x61,
|
0x08, 0xc8, 0x01, 0x01, 0xb2, 0x01, 0x02, 0x38, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12,
|
||||||
0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x26, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||||
0x2d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d,
|
0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70,
|
||||||
0x39, 0x2d, 0x5d, 0x2b, 0x24, 0x48, 0x00, 0x52, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18,
|
||||||
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6d,
|
0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31,
|
||||||
0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
|
||||||
0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66,
|
0x74, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04,
|
||||||
0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e,
|
0x61, 0x75, 0x74, 0x68, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45,
|
||||||
0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52,
|
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||||
0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44,
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
||||||
0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x17, 0x0a,
|
0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||||
0x15, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
0x79, 0x1a, 0x87, 0x03, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57,
|
||||||
0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x69,
|
||||||
0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x55, 0x0a, 0x08,
|
0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f,
|
||||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39,
|
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74,
|
||||||
0xba, 0x48, 0x36, 0xc8, 0x01, 0x01, 0x72, 0x31, 0x32, 0x2f, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d,
|
0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, 0x02, 0x28, 0x00,
|
||||||
0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x28, 0x3f, 0x3a, 0x2f,
|
0x48, 0x00, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49,
|
||||||
0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x2d, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x30,
|
0x74, 0x65, 0x6d, 0x73, 0x88, 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18,
|
||||||
0x2d, 0x39, 0x2d, 0x5f, 0x5d, 0x2b, 0x29, 0x2a, 0x24, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75,
|
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||||
0x72, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c,
|
||||||
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xba, 0x48, 0x24, 0x72, 0x22, 0x32, 0x20,
|
0x75, 0x65, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, 0x02, 0x28, 0x00, 0x48, 0x01, 0x52, 0x04, 0x73,
|
||||||
0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x28, 0x3f, 0x3a, 0x5c, 0x2e, 0x5b, 0x61, 0x2d,
|
0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||||
0x7a, 0x2d, 0x5d, 0x2b, 0x29, 0x2a, 0x5c, 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x2d, 0x5d, 0x2b, 0x24,
|
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e,
|
||||||
0x48, 0x00, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01,
|
0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74,
|
||||||
0x01, 0x12, 0x1d, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01,
|
0x65, 0x78, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61,
|
||||||
0x28, 0x08, 0x48, 0x01, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01,
|
0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65,
|
||||||
0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42,
|
0x72, 0x73, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x0a, 0x0a, 0x08, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x22, 0x89, 0x0b, 0x0a, 0x10,
|
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
|
0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0b, 0xba, 0x48,
|
||||||
0x1a, 0xa8, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x49, 0x0a, 0x09, 0x70, 0x72, 0x69,
|
0x08, 0xc8, 0x01, 0x01, 0xb2, 0x01, 0x02, 0x38, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x1a,
|
||||||
0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xba, 0x48,
|
|
||||||
0x28, 0xc8, 0x01, 0x01, 0x72, 0x23, 0x32, 0x21, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a,
|
|
||||||
0x30, 0x2d, 0x39, 0x2d, 0x25, 0x2e, 0x5d, 0x2b, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a,
|
|
||||||
0x30, 0x2d, 0x39, 0x2d, 0x25, 0x2e, 0x5d, 0x2b, 0x24, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63,
|
|
||||||
0x69, 0x70, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65,
|
|
||||||
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63,
|
|
||||||
0x65, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x18, 0x03, 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, 0x42, 0x06, 0xba, 0x48, 0x03,
|
|
||||||
0xc8, 0x01, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x1a, 0xae, 0x04, 0x0a, 0x07,
|
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
|
|
||||||
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x06,
|
|
||||||
0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61,
|
|
||||||
0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
|
|
||||||
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x4d, 0x65, 0x74,
|
|
||||||
0x68, 0x6f, 0x64, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01,
|
|
||||||
0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x51, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64,
|
|
||||||
0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x75, 0x64, 0x69,
|
|
||||||
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f,
|
|
||||||
0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65,
|
|
||||||
0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8,
|
|
||||||
0x01, 0x01, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x70,
|
|
||||||
0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01,
|
|
||||||
0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1e,
|
|
||||||
0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48,
|
|
||||||
0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x22,
|
|
||||||
0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a,
|
|
||||||
0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65,
|
|
||||||
0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28,
|
|
||||||
0x09, 0x48, 0x01, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a,
|
|
||||||
0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 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, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x08, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48,
|
|
||||||
0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b,
|
|
||||||
0x32, 0x1f, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72,
|
|
||||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x41, 0x75, 0x74,
|
|
||||||
0x68, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x1a,
|
|
||||||
0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
|
0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
|
||||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
||||||
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f,
|
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f,
|
||||||
0x69, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x87, 0x03, 0x0a,
|
0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x74, 0x65,
|
||||||
0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x6e, 0x75, 0x6d,
|
0x6d, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x8e, 0x02, 0x0a, 0x0a,
|
||||||
0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18,
|
0x48, 0x74, 0x74, 0x70, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1b, 0x0a, 0x17, 0x48, 0x54,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c,
|
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x48, 0x54, 0x54, 0x50, 0x5f,
|
||||||
0x75, 0x65, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, 0x02, 0x28, 0x00, 0x48, 0x00, 0x52, 0x10, 0x6e,
|
0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x01, 0x12, 0x13,
|
||||||
0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x88,
|
0x0a, 0x0f, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x47, 0x45,
|
||||||
0x01, 0x01, 0x12, 0x3d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
0x54, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48,
|
||||||
0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
0x4f, 0x44, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x54, 0x54,
|
||||||
0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0xba,
|
0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x10, 0x04, 0x12,
|
||||||
0x48, 0x04, 0x22, 0x02, 0x28, 0x00, 0x48, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x88, 0x01,
|
0x13, 0x0a, 0x0f, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x50,
|
||||||
0x01, 0x12, 0x4a, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03,
|
0x55, 0x54, 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54,
|
||||||
0x28, 0x0b, 0x32, 0x30, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74,
|
0x48, 0x4f, 0x44, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13,
|
||||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52,
|
0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x4e,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45,
|
0x45, 0x43, 0x54, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45,
|
||||||
0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x3b, 0x0a,
|
0x54, 0x48, 0x4f, 0x44, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x08, 0x12, 0x15,
|
||||||
0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
|
0x0a, 0x11, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x54, 0x52,
|
||||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
|
0x41, 0x43, 0x45, 0x10, 0x09, 0x12, 0x15, 0x0a, 0x11, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45,
|
||||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0xb2,
|
0x54, 0x48, 0x4f, 0x44, 0x5f, 0x50, 0x41, 0x54, 0x43, 0x48, 0x10, 0x0a, 0x22, 0xe1, 0x01, 0x0a,
|
||||||
0x01, 0x02, 0x38, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65,
|
0x0f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||||
0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
0x12, 0x27, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x70, 0x18, 0x01, 0x20,
|
||||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x70, 0x01, 0x52,
|
||||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
0x08, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x70, 0x12, 0x4a, 0x0a, 0x1a, 0x63, 0x61, 0x6c,
|
||||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x72,
|
0x6c, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x07, 0x0a,
|
0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba,
|
||||||
0x05, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x8e, 0x02, 0x0a, 0x0a, 0x48, 0x74, 0x74, 0x70, 0x4d,
|
0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x17, 0x63, 0x61,
|
||||||
0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1b, 0x0a, 0x17, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45,
|
0x6c, 0x6c, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72,
|
||||||
0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
|
0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x59, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f,
|
0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x44, 0x5f, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x54, 0x54,
|
0x0b, 0x32, 0x22, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74,
|
||||||
0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x47, 0x45, 0x54, 0x10, 0x02, 0x12, 0x14,
|
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x65,
|
||||||
0x0a, 0x10, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x48, 0x45,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x11, 0x72,
|
||||||
0x41, 0x44, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
|
||||||
0x48, 0x4f, 0x44, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x54,
|
0x22, 0xb4, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74,
|
||||||
0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x50, 0x55, 0x54, 0x10, 0x05, 0x12,
|
0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f,
|
||||||
0x16, 0x0a, 0x12, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x44,
|
0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f,
|
||||||
0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x48, 0x54, 0x54, 0x50, 0x5f,
|
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74,
|
||||||
0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, 0x07,
|
0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x1a,
|
||||||
0x12, 0x17, 0x0a, 0x13, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f,
|
0x02, 0x28, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||||
0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x48, 0x54, 0x54,
|
0x28, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||||
0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x09,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d,
|
||||||
0x12, 0x15, 0x0a, 0x11, 0x48, 0x54, 0x54, 0x50, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f,
|
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x0d, 0x65, 0x72, 0x72,
|
||||||
0x50, 0x41, 0x54, 0x43, 0x48, 0x10, 0x0a, 0x22, 0xe1, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75,
|
0x6f, 0x72, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x09, 0x63,
|
0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a,
|
0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72,
|
||||||
0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x70, 0x01, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c,
|
0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x5c, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f,
|
||||||
0x65, 0x72, 0x49, 0x70, 0x12, 0x4a, 0x0a, 0x1a, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x73,
|
0x6e, 0x73, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04,
|
||||||
0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e,
|
||||||
0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01,
|
0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
|
||||||
0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x17, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x53,
|
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01,
|
||||||
0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74,
|
0x01, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69,
|
||||||
0x12, 0x59, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72,
|
0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f,
|
||||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61,
|
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xba, 0x04, 0x0a, 0x1c, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
|
0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61,
|
||||||
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x63, 0x0a, 0x10, 0x73, 0x79, 0x73, 0x74,
|
||||||
0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x65, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xb4, 0x02, 0x0a, 0x10,
|
0x28, 0x0b, 0x32, 0x36, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65,
|
||||||
0x12, 0x48, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
|
0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
0x6d, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x79,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c,
|
0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x5a, 0x0a,
|
||||||
0x75, 0x65, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x0a,
|
0x0d, 0x69, 0x64, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x02,
|
||||||
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x65, 0x72,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e,
|
||||||
0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65,
|
||||||
0x09, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x64, 0x70,
|
||||||
0x65, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x64, 0x65,
|
0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x64, 0x70,
|
||||||
0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f,
|
0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x1a, 0x6f, 0x0a, 0x0f, 0x53, 0x79, 0x73,
|
||||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74,
|
0x74, 0x65, 0x6d, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x47, 0x0a, 0x10,
|
||||||
0x72, 0x75, 0x63, 0x74, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69,
|
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||||
0x6c, 0x73, 0x12, 0x5c, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x61,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||||
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48,
|
||||||
0x23, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69,
|
0x00, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||||
0x62, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x12, 0x72, 0x65,
|
0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xd3, 0x01, 0x0a, 0x0c, 0x49,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
|
0x64, 0x70, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x0c, 0x70,
|
||||||
0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x67, 0x65, 0x22, 0xba, 0x04, 0x0a, 0x1c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63,
|
0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x70,
|
||||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
|
0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0f, 0x70, 0x72,
|
||||||
0x6e, 0x66, 0x6f, 0x12, 0x63, 0x0a, 0x10, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x72,
|
0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20,
|
||||||
0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e,
|
0x01, 0x28, 0x09, 0x42, 0x0d, 0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18,
|
||||||
0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0xff, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x45, 0x6d, 0x61,
|
||||||
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f,
|
0x69, 0x6c, 0x12, 0x47, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65,
|
||||||
0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x69, 0x6e,
|
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
|
||||||
0x63, 0x69, 0x70, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50,
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
|
||||||
0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x5a, 0x0a, 0x0d, 0x69, 0x64, 0x70, 0x5f,
|
0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f,
|
||||||
0x33, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||||
0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74,
|
0x42, 0x12, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x05, 0xba,
|
||||||
0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x64, 0x70, 0x50, 0x72, 0x69, 0x6e, 0x63,
|
0x48, 0x02, 0x08, 0x01, 0x2a, 0x96, 0x02, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x76, 0x65,
|
||||||
0x69, 0x70, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x64, 0x70, 0x50, 0x72, 0x69, 0x6e, 0x63,
|
0x72, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45,
|
||||||
0x69, 0x70, 0x61, 0x6c, 0x1a, 0x6f, 0x0a, 0x0f, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72,
|
0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
|
||||||
0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x47, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69,
|
0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49,
|
||||||
0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x54, 0x59, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x64, 0x12, 0x17, 0x0a, 0x12,
|
||||||
0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x42,
|
||||||
0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x65,
|
0x55, 0x47, 0x10, 0xc8, 0x01, 0x12, 0x16, 0x0a, 0x11, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56,
|
||||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01,
|
0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xac, 0x02, 0x12, 0x18, 0x0a,
|
||||||
0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74,
|
0x13, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x4f,
|
||||||
0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xd3, 0x01, 0x0a, 0x0c, 0x49, 0x64, 0x70, 0x50, 0x72, 0x69,
|
0x54, 0x49, 0x43, 0x45, 0x10, 0x90, 0x03, 0x12, 0x19, 0x0a, 0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x53,
|
||||||
0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69,
|
0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10,
|
||||||
0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48,
|
0xf4, 0x03, 0x12, 0x17, 0x0a, 0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49,
|
||||||
0x07, 0xc8, 0x01, 0x01, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69,
|
0x54, 0x59, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0xd8, 0x04, 0x12, 0x1a, 0x0a, 0x15, 0x4c,
|
||||||
0x70, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70,
|
0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x52, 0x49, 0x54,
|
||||||
0x61, 0x6c, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d,
|
0x49, 0x43, 0x41, 0x4c, 0x10, 0xbc, 0x05, 0x12, 0x17, 0x0a, 0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x53,
|
||||||
0xba, 0x48, 0x0a, 0xc8, 0x01, 0x01, 0x72, 0x05, 0x10, 0x01, 0x18, 0xff, 0x01, 0x52, 0x0e, 0x70,
|
0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0xa0, 0x06,
|
||||||
0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x47, 0x0a,
|
0x12, 0x1b, 0x0a, 0x16, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59,
|
||||||
0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
0x5f, 0x45, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x84, 0x07, 0x42, 0x31, 0x0a,
|
||||||
0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x63, 0x68, 0x77, 0x61, 0x72, 0x7a, 0x2e, 0x73, 0x74, 0x61,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,
|
0x63, 0x6b, 0x69, 0x74, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a,
|
||||||
0x48, 0x00, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64,
|
0x0f, 0x2e, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x56, 0x31,
|
||||||
0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x12, 0x0a, 0x09, 0x61,
|
|
||||||
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x2a,
|
|
||||||
0x96, 0x02, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12,
|
|
||||||
0x1c, 0x0a, 0x18, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f,
|
|
||||||
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a,
|
|
||||||
0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45,
|
|
||||||
0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x64, 0x12, 0x17, 0x0a, 0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x53,
|
|
||||||
0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0xc8, 0x01,
|
|
||||||
0x12, 0x16, 0x0a, 0x11, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59,
|
|
||||||
0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xac, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x4c, 0x4f, 0x47, 0x5f,
|
|
||||||
0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10,
|
|
||||||
0x90, 0x03, 0x12, 0x19, 0x0a, 0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49,
|
|
||||||
0x54, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0xf4, 0x03, 0x12, 0x17, 0x0a,
|
|
||||||
0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x52,
|
|
||||||
0x52, 0x4f, 0x52, 0x10, 0xd8, 0x04, 0x12, 0x1a, 0x0a, 0x15, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45,
|
|
||||||
0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10,
|
|
||||||
0xbc, 0x05, 0x12, 0x17, 0x0a, 0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49,
|
|
||||||
0x54, 0x59, 0x5f, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0xa0, 0x06, 0x12, 0x1b, 0x0a, 0x16, 0x4c,
|
|
||||||
0x4f, 0x47, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x4d, 0x45, 0x52,
|
|
||||||
0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x84, 0x07, 0x42, 0x31, 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, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x61, 0x75,
|
|
||||||
0x64, 0x69, 0x74, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -127,14 +127,6 @@ func (m *AuditLogEntry) validate(all bool) error {
|
||||||
// no validation rules for CorrelationId
|
// no validation rules for CorrelationId
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.TraceParent != nil {
|
|
||||||
// no validation rules for TraceParent
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.TraceState != nil {
|
|
||||||
// no validation rules for TraceState
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return AuditLogEntryMultiError(errors)
|
return AuditLogEntryMultiError(errors)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,28 +85,6 @@ message AuditLogEntry {
|
||||||
(buf.validate.field).required = true,
|
(buf.validate.field).required = true,
|
||||||
(buf.validate.field).enum.defined_only = true
|
(buf.validate.field).enum.defined_only = true
|
||||||
];
|
];
|
||||||
|
|
||||||
// Customer set W3C conform trace parent header:
|
|
||||||
// https://www.w3.org/TR/trace-context/#traceparent-header
|
|
||||||
//
|
|
||||||
// Format: <version>-<trace-id>-<parent-id>-<trace-flags>
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
// "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
|
|
||||||
//
|
|
||||||
// Required: false
|
|
||||||
optional string trace_parent = 8 [(buf.validate.field).string.pattern = "^[0-9]+-[a-z0-9]+-[a-z0-9]+-[0-9]+$"];
|
|
||||||
|
|
||||||
// Customer set W3C conform trace state header:
|
|
||||||
// https://www.w3.org/TR/trace-context/#tracestate-header
|
|
||||||
//
|
|
||||||
// Format: <key1>=<value1>[,<keyN>=<valueN>]
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
// "rojo=00f067aa0ba902b7,congo=t61rcWkgMzE"
|
|
||||||
//
|
|
||||||
// Required: false
|
|
||||||
optional string trace_state = 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The severity of the event described in a log entry, expressed as one of the
|
// The severity of the event described in a log entry, expressed as one of the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue