Skip to content

Commit

Permalink
Fix caveat string encode to not emit spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Nov 4, 2024
1 parent ac7dfee commit fc5abf5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/tuple/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"sort"
"strings"

"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/structpb"

core "github.com/authzed/spicedb/pkg/proto/core/v1"
Expand Down Expand Up @@ -131,7 +132,9 @@ func StringCaveatContext(context *structpb.Struct) (string, error) {
return "", nil
}

contextBytes, err := context.MarshalJSON()
contextBytes, err := protojson.MarshalOptions{
Multiline: false,
}.Marshal(context)
if err != nil {
return "", err
}
Expand Down

0 comments on commit fc5abf5

Please sign in to comment.