Skip to content

Commit

Permalink
Add support for metadata on namespaces and relations
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Jun 11, 2021
1 parent 349007b commit 8707d34
Show file tree
Hide file tree
Showing 10 changed files with 953 additions and 175 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ require (
github.com/dlmiddlecote/sqlstats v1.0.2
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/emirpasic/gods v1.12.0
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.3
github.com/google/go-cmp v0.5.5
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
Expand Down
4 changes: 4 additions & 0 deletions internal/namespace/caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/authzed/spicedb/internal/datastore"
pb "github.com/authzed/spicedb/pkg/REDACTEDapi/api"
"github.com/authzed/spicedb/pkg/namespace"
)

const (
Expand Down Expand Up @@ -96,6 +97,9 @@ func (nsc cachingManager) ReadNamespace(ctx context.Context, nsName string) (*pb
return nil, decimal.Zero, err
}

// Remove metadata.
loaded = namespace.StripMetadata(loaded)

// Save it to the cache
newEntry := cacheEntry{
definition: loaded,
Expand Down
268 changes: 268 additions & 0 deletions pkg/arrakisapi/api/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8707d34

Please sign in to comment.