Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/authzed/zed

go 1.25.5
go 1.25.7

// 0.14.0 was published as 1.14.0 by mistake
retract v1.14.0
Expand All @@ -15,7 +15,7 @@ require (
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/authzed/authzed-go v1.7.0
github.com/authzed/grpcutil v0.0.0-20240123194739-2ea1e3d2d98b
github.com/authzed/spicedb v1.48.1-0.20260106174341-5243b5793a43
github.com/authzed/spicedb v1.49.1-0.20260205205028-286d6e84c0dd
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/ccoveille/go-safecast/v2 v2.0.0
github.com/cenkalti/backoff/v4 v4.3.0
Expand Down Expand Up @@ -107,6 +107,7 @@ require (
github.com/authzed/cel-go v0.20.2 // indirect
github.com/authzed/consistent v0.2.0 // indirect
github.com/authzed/ctxkey v0.0.0-20250226155515-d49f99185584 // indirect
github.com/authzed/jitterbug v0.0.0-20260128162915-e97d76daaa24 // indirect
github.com/aws/aws-sdk-go-v2 v1.40.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.3 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.3 // indirect
Expand Down Expand Up @@ -167,7 +168,6 @@ require (
github.com/docker/docker v28.0.0+incompatible // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/ecordell/optgen v0.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.35.0 // indirect
Expand Down Expand Up @@ -247,7 +247,6 @@ require (
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
Expand Down Expand Up @@ -279,7 +278,6 @@ require (
github.com/ldez/usetesting v0.5.0 // indirect
github.com/leonklingele/grouper v1.1.2 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/lthibault/jitterbug v2.0.0+incompatible // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/macabu/inamedparam v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
Expand Down
14 changes: 4 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,10 @@ github.com/authzed/ctxkey v0.0.0-20250226155515-d49f99185584 h1:mP7EpcUL90EKcf/F
github.com/authzed/ctxkey v0.0.0-20250226155515-d49f99185584/go.mod h1:wnimjr5RPPouIhZQ3ztDBLMUKKuUroj3U9Jy0PxeaEE=
github.com/authzed/grpcutil v0.0.0-20240123194739-2ea1e3d2d98b h1:wbh8IK+aMLTCey9sZasO7b6BWLAJnHHvb79fvWCXwxw=
github.com/authzed/grpcutil v0.0.0-20240123194739-2ea1e3d2d98b/go.mod h1:s3qC7V7XIbiNWERv7Lfljy/Lx25/V1Qlexb0WJuA8uQ=
github.com/authzed/spicedb v1.48.1-0.20260106174341-5243b5793a43 h1:t6AkBatxHw5/BdElHmE7mKGAj20lFrMjHXi1LltgQ6w=
github.com/authzed/spicedb v1.48.1-0.20260106174341-5243b5793a43/go.mod h1:8/LnI+Yw6By99u8yf1lkXjFvJQXnLglkx97b5ItA1+0=
github.com/authzed/jitterbug v0.0.0-20260128162915-e97d76daaa24 h1:BXaWSanmHFu3P0xWfTDPpwcJIQ/oSol29+CWe4lSGSU=
github.com/authzed/jitterbug v0.0.0-20260128162915-e97d76daaa24/go.mod h1:WvEk4YHnUsmbUaWA/VseQty3X91f6/jEHek5mjYDZUg=
github.com/authzed/spicedb v1.49.1-0.20260205205028-286d6e84c0dd h1:+plZfiKNZKiqtHbWOYPjk8hWSOm/pNA6KSxdIXoA0A4=
github.com/authzed/spicedb v1.49.1-0.20260205205028-286d6e84c0dd/go.mod h1:kee/xe1npMZ3pcU2eEUhhKnR/8B4UtVjVoSuYExkqDs=
github.com/aws/aws-sdk-go-v2 v1.40.1 h1:difXb4maDZkRH0x//Qkwcfpdg1XQVXEAEs2DdXldFFc=
github.com/aws/aws-sdk-go-v2 v1.40.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=
github.com/aws/aws-sdk-go-v2/config v1.32.3 h1:cpz7H2uMNTDa0h/5CYL5dLUEzPSLo2g0NkbxTRJtSSU=
Expand Down Expand Up @@ -924,8 +926,6 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo=
github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/ecordell/optgen v0.1.1 h1:ovcjYgTfxQzDgNVTVfr+ziHBfoCcetsar6v/gE93ezs=
github.com/ecordell/optgen v0.1.1/go.mod h1:+YZ4tk5pNGMoeH+Y4F4HeDDj0SLOlIgMMNae7az4h5g=
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
Expand Down Expand Up @@ -1286,8 +1286,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY=
github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y=
github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E=
github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
Expand Down Expand Up @@ -1389,8 +1387,6 @@ github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84Yrj
github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA=
github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4=
github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4=
github.com/lthibault/jitterbug v2.0.0+incompatible h1:qouq51IKzlMx25+15jbxhC/d79YyTj0q6XFoptNqaUw=
github.com/lthibault/jitterbug v2.0.0+incompatible/go.mod h1:2l7akWd27PScEs6YkjyUVj/8hKgNhbbQ3KiJgJtlf6o=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
Expand Down Expand Up @@ -2268,13 +2264,11 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNq
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY=
Expand Down
2 changes: 1 addition & 1 deletion internal/mcp/mcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestReadSchema(t *testing.T) {

// SpiceDB returns an error when no schema is defined, which is expected
require.Error(t, err)
assert.Contains(t, err.Error(), "No schema has been defined")
assert.Contains(t, err.Error(), "no schema has been defined")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message changed in the new version.

assert.Empty(t, schema)
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/backupformat/rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func validateAndCompileDefs(defs []compiler.SchemaDefinition) (string, error) {
}

for _, rawDef := range compiledSchema.ObjectDefinitions {
ts := schemapkg.NewTypeSystem(schemapkg.ResolverForCompiledSchema(*compiledSchema))
ts := schemapkg.NewTypeSystem(schemapkg.ResolverForCompiledSchema(compiledSchema))
def, err := schemapkg.NewDefinition(ts, rawDef)
if err != nil {
return "", fmt.Errorf("failed to create schema definition: %w", err)
Expand Down
32 changes: 17 additions & 15 deletions pkg/wasm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,20 @@ func runZedCommand(rootCmd *cobra.Command, requestContextJSON string, stringPara
reader := devCtx.Datastore.SnapshotReader(headRev)
relationships := []*core.RelationTuple{}

nsDefs, err := reader.ListAllNamespaces(ctx)
schemaReader, err := reader.SchemaReader()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are to use the new SchemaReader interface and stop using a part of the interface that was removed.

if err != nil {
return zedCommandResult{Error: err.Error()}
}
defMap, err := schemaReader.ListAllSchemaDefinitions(ctx)
if err != nil {
return zedCommandResult{Error: err.Error()}
}

for _, nsDef := range nsDefs {
it, err := reader.QueryRelationships(ctx, datastore.RelationshipsFilter{OptionalResourceType: nsDef.Definition.Name})
for _, def := range defMap {
if _, ok := def.(*core.NamespaceDefinition); !ok {
continue
}
it, err := reader.QueryRelationships(ctx, datastore.RelationshipsFilter{OptionalResourceType: def.GetName()})
if err != nil {
return zedCommandResult{Error: err.Error()}
}
Expand All @@ -189,18 +196,13 @@ func runZedCommand(rootCmd *cobra.Command, requestContextJSON string, stringPara
}
}

caveatDefs, err := reader.ListAllCaveats(ctx)
if err != nil {
return zedCommandResult{Error: err.Error()}
}

schemaDefinitions := make([]compiler.SchemaDefinition, 0, len(nsDefs)+len(caveatDefs))
for _, caveatDef := range caveatDefs {
schemaDefinitions = append(schemaDefinitions, caveatDef.Definition)
}

for _, nsDef := range nsDefs {
schemaDefinitions = append(schemaDefinitions, nsDef.Definition)
schemaDefinitions := make([]compiler.SchemaDefinition, 0, len(defMap))
for _, def := range defMap {
schemaDef, ok := def.(compiler.SchemaDefinition)
if !ok {
return zedCommandResult{Error: "could not cast read definition to compiled schemadefinition"}
}
schemaDefinitions = append(schemaDefinitions, schemaDef)
}

schemaText, _, err := generator.GenerateSchema(schemaDefinitions)
Expand Down
Loading