mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-15 04:17:25 +00:00
Fix visibility mapping in legacy api
This commit is contained in:
parent
9bd5be52b7
commit
da9ef5f707
1 changed files with 9 additions and 1 deletions
|
|
@ -244,6 +244,14 @@ func (a *LegacyAuditApi) convertAndSerializeIntoLegacyFormat(
|
||||||
return nil, ErrUnsupportedResourceReferenceType
|
return nil, ErrUnsupportedResourceReferenceType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var visibility string
|
||||||
|
switch routableEvent.Visibility {
|
||||||
|
case auditV1.Visibility_VISIBILITY_PUBLIC:
|
||||||
|
visibility = "PUBLIC"
|
||||||
|
case auditV1.Visibility_VISIBILITY_PRIVATE:
|
||||||
|
visibility = "PRIVATE"
|
||||||
|
}
|
||||||
|
|
||||||
// Details
|
// Details
|
||||||
var details = event.ProtoPayload.Request.AsMap()
|
var details = event.ProtoPayload.Request.AsMap()
|
||||||
|
|
||||||
|
|
@ -253,7 +261,7 @@ func (a *LegacyAuditApi) convertAndSerializeIntoLegacyFormat(
|
||||||
// Instantiate the legacy event - missing values are filled with defaults
|
// Instantiate the legacy event - missing values are filled with defaults
|
||||||
legacyAuditEvent := LegacyAuditEvent{
|
legacyAuditEvent := LegacyAuditEvent{
|
||||||
Severity: "INFO",
|
Severity: "INFO",
|
||||||
Visibility: routableEvent.Visibility.String(),
|
Visibility: visibility,
|
||||||
EventType: eventType,
|
EventType: eventType,
|
||||||
EventTimeStamp: event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime(),
|
EventTimeStamp: event.ProtoPayload.RequestMetadata.RequestAttributes.Time.AsTime(),
|
||||||
EventName: event.LogName,
|
EventName: event.LogName,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue