mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 00:57:24 +00:00
Add request attributes to event details
This commit is contained in:
parent
07a26f986a
commit
b3adb22680
1 changed files with 10 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -139,7 +140,15 @@ func convertAndSerializeIntoLegacyFormat(
|
|||
}
|
||||
|
||||
// Details
|
||||
var details = event.ProtoPayload.Request.AsMap()
|
||||
serializedRequestAttributes, err := protojson.Marshal(event.ProtoPayload.RequestMetadata.RequestAttributes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var details map[string]interface{}
|
||||
err = json.Unmarshal(serializedRequestAttributes, &details)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Result
|
||||
var result = event.ProtoPayload.Response.AsMap()
|
||||
|
|
|
|||
Loading…
Reference in a new issue