Skip to content

Commit

Permalink
Bump SpiceDB to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Apr 4, 2022
1 parent 103b4ba commit 39bae37
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine3.13 AS build
FROM golang:1.17-alpine3.15 AS build

WORKDIR /go/src/zed
COPY . /go/src/zed
Expand Down
11 changes: 6 additions & 5 deletions cmd/zed/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"github.com/spf13/cobra"

v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
"github.com/authzed/spicedb/pkg/commonerrors"
"github.com/authzed/spicedb/pkg/development"
core "github.com/authzed/spicedb/pkg/proto/core/v1"
"github.com/authzed/spicedb/pkg/tuple"
"github.com/authzed/spicedb/pkg/validationfile"
"github.com/authzed/spicedb/pkg/validationfile/blocks"
"github.com/charmbracelet/lipgloss"

"github.com/authzed/zed/internal/decode"
Expand Down Expand Up @@ -77,7 +78,7 @@ func validateCmdFunc(cmd *cobra.Command, args []string) error {
var parsed validationfile.ValidationFile
validateContents, err := decoder(&parsed)
if err != nil {
var errWithSource blocks.ErrorWithSource
var errWithSource commonerrors.ErrorWithSource
if errors.As(err, &errWithSource) {
ouputErrorWithSource(validateContents, errWithSource)
}
Expand All @@ -89,7 +90,7 @@ func validateCmdFunc(cmd *cobra.Command, args []string) error {
ctx := context.Background()
tuples := make([]*v0.RelationTuple, 0, len(parsed.Relationships.Relationships))
for _, rel := range parsed.Relationships.Relationships {
tuples = append(tuples, tuple.MustFromRelationship(rel))
tuples = append(tuples, core.ToV0RelationTuple(tuple.MustFromRelationship(rel)))
}
devCtx, devErrs, err := development.NewDevContext(ctx, &v0.RequestContext{
Schema: parsed.Schema.Schema,
Expand Down Expand Up @@ -129,14 +130,14 @@ func validateCmdFunc(cmd *cobra.Command, args []string) error {
return nil
}

func ouputErrorWithSource(validateContents []byte, errWithSource blocks.ErrorWithSource) {
func ouputErrorWithSource(validateContents []byte, errWithSource commonerrors.ErrorWithSource) {
lines := strings.Split(string(validateContents), "\n")

fmt.Printf("%s%s\n", errorPrefix, errorMessageStyle.Render(errWithSource.Error()))
errorLineNumber := int(errWithSource.LineNumber) - 1 // errWithSource.LineNumber is 1-indexed
for i := errorLineNumber - 3; i < errorLineNumber+3; i++ {
if i == errorLineNumber {
renderLine(lines, i, errWithSource.Source, errorLineNumber)
renderLine(lines, i, errWithSource.SourceCodeString, errorLineNumber)
} else {
renderLine(lines, i, "", errorLineNumber)
}
Expand Down
74 changes: 37 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@ require (
github.com/99designs/keyring v1.1.6
github.com/AlecAivazis/survey/v2 v2.3.2
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/authzed/authzed-go v0.4.2-0.20220207230446-c781fa7fa969
github.com/authzed/authzed-go v0.5.1-0.20220303182356-243e79ca06fa
github.com/authzed/connector-postgresql v0.2.1-0.20211110161636-5a22597732ae
github.com/authzed/grpcutil v0.0.0-20220104222419-f813f77722e5
github.com/authzed/spicedb v1.4.1-0.20220214225827-aea171d69d33
github.com/authzed/spicedb v1.5.1-0.20220401210826-94c69634c5d5
github.com/charmbracelet/lipgloss v0.4.0
github.com/cockroachdb/cockroach v20.1.17+incompatible
github.com/jzelinskie/cobrautil v0.0.9
github.com/jzelinskie/cobrautil v0.0.10
github.com/jzelinskie/stringz v0.0.1
github.com/mitchellh/go-homedir v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/open-policy-agent/opa v0.36.1
github.com/rs/zerolog v1.26.1
github.com/spf13/cobra v1.3.0
github.com/stretchr/testify v1.7.0
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.1
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
google.golang.org/grpc v1.44.0
google.golang.org/protobuf v1.27.1
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

require (
github.com/Masterminds/squirrel v1.5.2 // indirect
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytecodealliance/wasmtime-go v0.32.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
Expand All @@ -42,25 +41,25 @@ require (
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.3 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-ini/ini v1.66.2 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20210831071041-dd1540ef8252 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.2 // indirect
Expand All @@ -69,22 +68,22 @@ require (
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.10.1 // indirect
github.com/jackc/pgconn v1.11.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pglogrepl v0.0.0-20210731151948-9f1effd582c4 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.9.1 // indirect
github.com/jackc/pgx/v4 v4.14.1 // indirect
github.com/jackc/pgtype v1.10.0 // indirect
github.com/jackc/pgx/v4 v4.15.0 // indirect
github.com/jackc/puddle v1.2.1 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
Expand All @@ -100,14 +99,14 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/common v0.33.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/scylladb/go-set v1.0.2 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.8.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -116,31 +115,32 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/yashtewari/glob-intersection v0.0.0-20180916065949-5c77d914dd0b // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.28.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.3.0 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.3.0 // indirect
go.opentelemetry.io/otel v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.26.0 // indirect
go.opentelemetry.io/otel/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/trace v1.3.0 // indirect
go.opentelemetry.io/proto/otlp v0.11.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.6.0 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.6.0 // indirect
go.opentelemetry.io/otel v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.6.1 // indirect
go.opentelemetry.io/otel/metric v0.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.6.1 // indirect
go.opentelemetry.io/otel/trace v1.6.1 // indirect
go.opentelemetry.io/proto/otlp v0.15.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/automaxprocs v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect
google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.66.3 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 39bae37

Please sign in to comment.