mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
authorize: audit logging (#2050)
* authorize: add databroker server and record version to result, force sync via polling * authorize: audit logging
This commit is contained in:
parent
00e56212ec
commit
f4c4fe314a
18 changed files with 1395 additions and 1390 deletions
27
pkg/grpc/crypt/crypt.go
Normal file
27
pkg/grpc/crypt/crypt.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Package crypt contains cryptographic protobuf messages.
|
||||
package crypt
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
// MarshalZerologObject fills the zerolog event fields.
|
||||
func (x *SealedMessage) MarshalZerologObject(evt *zerolog.Event) {
|
||||
evt.Str("@type", "type.googleapis.com/pomerium.crypt.SealedMessage").
|
||||
Str("key_id", x.GetKeyId()).
|
||||
Str("data_encryption_key", base64.StdEncoding.EncodeToString(x.GetDataEncryptionKey())).
|
||||
Str("message_type", x.GetMessageType()).
|
||||
Str("encrypted_message", base64.StdEncoding.EncodeToString(x.GetEncryptedMessage()))
|
||||
}
|
||||
|
||||
// UnmarshalFromRawZerolog unmarshals a raw zerolog object into the sealed message.
|
||||
func (x *SealedMessage) UnmarshalFromRawZerolog(raw []byte) error {
|
||||
opts := protojson.UnmarshalOptions{
|
||||
AllowPartial: true,
|
||||
DiscardUnknown: true,
|
||||
}
|
||||
return opts.Unmarshal(raw, x)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue