Skip to content

Commit

Permalink
Use proto names when encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
strideynet committed Jan 3, 2025
1 parent 9235527 commit b8c5014
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tlsca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,12 @@ func (id *Identity) Subject() (pkix.Name, error) {
}

if id.JoinAttributes != nil {
encoded, err := protojson.Marshal(id.JoinAttributes)
encoded, err := protojson.MarshalOptions{
// Use the proto field names as this is what we use in the
// templating engine and this being consistent for any user who
// inspects the cert is kind.
UseProtoNames: true,
}.Marshal(id.JoinAttributes)
if err != nil {
return pkix.Name{}, trace.Wrap(err, "encoding join attributes as protojson")
}
Expand Down

0 comments on commit b8c5014

Please sign in to comment.