mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-17 05:11:46 +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"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"google.golang.org/protobuf/encoding/protojson"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
@ -139,7 +140,15 @@ func convertAndSerializeIntoLegacyFormat(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Details
|
// 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
|
// Result
|
||||||
var result = event.ProtoPayload.Response.AsMap()
|
var result = event.ProtoPayload.Response.AsMap()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue