From 83019686fbb22d6ab31e07d2d4538ea136136321 Mon Sep 17 00:00:00 2001 From: Ronen Hilewicz Date: Mon, 15 Jan 2024 17:51:58 -0500 Subject: [PATCH] Fix GetRelation validation --- go.mod | 2 +- go.sum | 4 ++++ pkg/ds/relation.go | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ccba4c7..ad3f453 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ go 1.20 require ( github.com/Masterminds/semver v1.5.0 github.com/aserto-dev/aserto-grpc v0.2.2 - github.com/aserto-dev/azm v0.0.18-0.20240115220008-a188ebaf19f0 + github.com/aserto-dev/azm v0.0.18-0.20240115224901-ba17d4698b57 github.com/aserto-dev/errors v0.0.6 github.com/aserto-dev/go-directory v0.30.10 github.com/bufbuild/protovalidate-go v0.4.3 diff --git a/go.sum b/go.sum index e245b79..e4a139a 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/aserto-dev/aserto-grpc v0.2.2 h1:i6rWdvydyqs7eBqsZHYdPPCC+xVwQve8KrBg github.com/aserto-dev/aserto-grpc v0.2.2/go.mod h1:uDMB5njLdoCa0Hr+TOg6A4gH85uNqTvufkM5sKtEjcE= github.com/aserto-dev/azm v0.0.18-0.20240115220008-a188ebaf19f0 h1:brplf7zeAOiPuKls+DiSvOGwXSUizo+7fZBgW1sXhvU= github.com/aserto-dev/azm v0.0.18-0.20240115220008-a188ebaf19f0/go.mod h1:m42yapoABuB2D+I+699p85AOhEZsvPaUrJWIQVQ2XgY= +github.com/aserto-dev/azm v0.0.18-0.20240115224901-ba17d4698b57 h1:zI7zX5swsQOlANJ4hQE1gjtXWt3H8cF7WHi68NK+ePM= +github.com/aserto-dev/azm v0.0.18-0.20240115224901-ba17d4698b57/go.mod h1:m42yapoABuB2D+I+699p85AOhEZsvPaUrJWIQVQ2XgY= github.com/aserto-dev/errors v0.0.6 h1:iH5fkJwBGFPbcdS4B8mwvNdwODlhDEXXPduZtjLh6vo= github.com/aserto-dev/errors v0.0.6/go.mod h1:kenI1gamsemaR2wS+M2un0kXIJ9exTrmeRT/fCFwlWc= github.com/aserto-dev/go-directory v0.30.10 h1:g4j5lzNndQOG6Uv+oc1Q4UzyZdtgCnGftHNIpahzcos= @@ -113,6 +115,7 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4 github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= @@ -248,6 +251,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/pkg/ds/relation.go b/pkg/ds/relation.go index adce79a..65745de 100644 --- a/pkg/ds/relation.go +++ b/pkg/ds/relation.go @@ -26,8 +26,9 @@ type relations struct { func Relation(i *dsc3.Relation) *relation { return &relation{safe.Relation(i)} } -func GetRelation(i *dsr3.GetRelationRequest) *relation { - return &relation{safe.GetRelation(i)} +func GetRelation(i *dsr3.GetRelationRequest) *relations { + r := safe.GetRelation(i) + return &relations{r, relation{r.SafeRelation}} } func GetRelations(i *dsr3.GetRelationsRequest) *relations {