mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
protoutil: add NewAny method for deterministic serialization (#2462)
This commit is contained in:
parent
b051c7db03
commit
6af0655206
20 changed files with 90 additions and 148 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"github.com/pomerium/pomerium/pkg/cryptutil"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
"github.com/pomerium/pomerium/pkg/protoutil"
|
||||
)
|
||||
|
||||
type encryptedRecordStream struct {
|
||||
|
@ -185,13 +186,8 @@ func (e *encryptedBackend) encrypt(in *anypb.Any) (out *anypb.Any, err error) {
|
|||
}
|
||||
|
||||
encrypted := cryptutil.Encrypt(e.cipher, plaintext, nil)
|
||||
|
||||
out, err = anypb.New(&wrapperspb.BytesValue{
|
||||
out = protoutil.NewAny(&wrapperspb.BytesValue{
|
||||
Value: encrypted,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue