From d53ea845be585f61e9435515762a9356e9236d19 Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Tue, 6 Aug 2024 12:11:25 -0700 Subject: [PATCH] Revert "Reverting contextual tuples in assertions API (#157) (#167)" This reverts commit 5b0b4941f3e0ae78475a6a4940f5a49cc243b257. --- docs/openapiv2/apidocs.swagger.json | 3 + openfga/v1/openfga_service.proto | 2 + proto/go.mod | 8 +- proto/go.sum | 15 +++ proto/openfga/v1/openfga_service.pb.go | 122 ++++++++++-------- .../openfga/v1/openfga_service.pb.validate.go | 29 +++++ 6 files changed, 121 insertions(+), 58 deletions(-) diff --git a/docs/openapiv2/apidocs.swagger.json b/docs/openapiv2/apidocs.swagger.json index 8991726f..6215902e 100644 --- a/docs/openapiv2/apidocs.swagger.json +++ b/docs/openapiv2/apidocs.swagger.json @@ -1478,6 +1478,9 @@ }, "expectation": { "type": "boolean" + }, + "contextual_tuples": { + "$ref": "#/definitions/ContextualTupleKeys" } }, "required": [ diff --git a/openfga/v1/openfga_service.proto b/openfga/v1/openfga_service.proto index 87b18b6a..7267673e 100644 --- a/openfga/v1/openfga_service.proto +++ b/openfga/v1/openfga_service.proto @@ -1588,6 +1588,8 @@ message Assertion { json_name = "expectation", (google.api.field_behavior) = REQUIRED ]; + + openfga.v1.ContextualTupleKeys contextual_tuples = 3 [json_name = "contextual_tuples"]; } message Assertions { diff --git a/proto/go.mod b/proto/go.mod index bee1325f..e34b7189 100644 --- a/proto/go.mod +++ b/proto/go.mod @@ -11,8 +11,8 @@ require ( ) require ( - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6 // indirect ) diff --git a/proto/go.sum b/proto/go.sum index 74827f50..7dc500b6 100644 --- a/proto/go.sum +++ b/proto/go.sum @@ -4,6 +4,7 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= +<<<<<<< HEAD golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= @@ -16,5 +17,19 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +======= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae h1:AH34z6WAGVNkllnKs5raNq3yRq93VnjBG6rpfub/jYk= +google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6 h1:DujSIu+2tC9Ht0aPNA7jgj23Iq8Ewi5sgkQ++wdvonE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +>>>>>>> parent of 5b0b494 (Reverting contextual tuples in assertions API (#157) (#167)) google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/proto/openfga/v1/openfga_service.pb.go b/proto/openfga/v1/openfga_service.pb.go index 38c21bc8..52dbb179 100644 --- a/proto/openfga/v1/openfga_service.pb.go +++ b/proto/openfga/v1/openfga_service.pb.go @@ -2643,8 +2643,9 @@ type Assertion struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TupleKey *AssertionTupleKey `protobuf:"bytes,1,opt,name=tuple_key,proto3" json:"tuple_key,omitempty"` - Expectation bool `protobuf:"varint,2,opt,name=expectation,proto3" json:"expectation,omitempty"` + TupleKey *AssertionTupleKey `protobuf:"bytes,1,opt,name=tuple_key,proto3" json:"tuple_key,omitempty"` + Expectation bool `protobuf:"varint,2,opt,name=expectation,proto3" json:"expectation,omitempty"` + ContextualTuples *ContextualTupleKeys `protobuf:"bytes,3,opt,name=contextual_tuples,proto3" json:"contextual_tuples,omitempty"` } func (x *Assertion) Reset() { @@ -2693,6 +2694,13 @@ func (x *Assertion) GetExpectation() bool { return false } +func (x *Assertion) GetContextualTuples() *ContextualTupleKeys { + if x != nil { + return x.ContextualTuples + } + return nil +} + type Assertions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3461,15 +3469,20 @@ var file_openfga_v1_openfga_service_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0x92, 0x41, 0x10, 0x4a, 0x0b, 0x22, 0x75, 0x73, 0x65, 0x72, 0x3a, 0x61, 0x6e, 0x6e, 0x65, 0x22, 0x78, 0x80, 0x04, 0xe0, 0x41, 0x02, 0xfa, 0x42, 0x12, 0x72, 0x10, 0x32, 0x0e, 0x5e, 0x5b, 0x5e, 0x5c, 0x73, 0x5d, 0x7b, 0x32, 0x2c, 0x35, 0x31, 0x32, 0x7d, - 0x24, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x7c, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x09, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x66, 0x67, - 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x75, - 0x70, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x0b, 0xe0, 0x41, 0x02, 0xfa, 0x42, 0x05, 0x8a, 0x01, - 0x02, 0x10, 0x01, 0x52, 0x09, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x25, - 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x48, 0x0a, 0x0a, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, + 0x24, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xcb, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, + 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x09, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x66, + 0x67, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x75, 0x70, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x0b, 0xe0, 0x41, 0x02, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x12, + 0x25, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x66, 0x67, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x74, + 0x75, 0x70, 0x6c, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x0a, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x66, 0x67, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, @@ -5145,49 +5158,50 @@ var file_openfga_v1_openfga_service_proto_depIdxs = []int32{ 52, // 43: openfga.v1.ListStoresRequest.page_size:type_name -> google.protobuf.Int32Value 60, // 44: openfga.v1.ListStoresResponse.stores:type_name -> openfga.v1.Store 42, // 45: openfga.v1.Assertion.tuple_key:type_name -> openfga.v1.AssertionTupleKey - 43, // 46: openfga.v1.Assertions.assertions:type_name -> openfga.v1.Assertion - 61, // 47: openfga.v1.WriteAuthorizationModelRequest.ConditionsEntry.value:type_name -> openfga.v1.Condition - 7, // 48: openfga.v1.OpenFGAService.Read:input_type -> openfga.v1.ReadRequest - 12, // 49: openfga.v1.OpenFGAService.Write:input_type -> openfga.v1.WriteRequest - 14, // 50: openfga.v1.OpenFGAService.Check:input_type -> openfga.v1.CheckRequest - 17, // 51: openfga.v1.OpenFGAService.Expand:input_type -> openfga.v1.ExpandRequest - 24, // 52: openfga.v1.OpenFGAService.ReadAuthorizationModels:input_type -> openfga.v1.ReadAuthorizationModelsRequest - 20, // 53: openfga.v1.OpenFGAService.ReadAuthorizationModel:input_type -> openfga.v1.ReadAuthorizationModelRequest - 22, // 54: openfga.v1.OpenFGAService.WriteAuthorizationModel:input_type -> openfga.v1.WriteAuthorizationModelRequest - 26, // 55: openfga.v1.OpenFGAService.WriteAssertions:input_type -> openfga.v1.WriteAssertionsRequest - 28, // 56: openfga.v1.OpenFGAService.ReadAssertions:input_type -> openfga.v1.ReadAssertionsRequest - 30, // 57: openfga.v1.OpenFGAService.ReadChanges:input_type -> openfga.v1.ReadChangesRequest - 32, // 58: openfga.v1.OpenFGAService.CreateStore:input_type -> openfga.v1.CreateStoreRequest - 34, // 59: openfga.v1.OpenFGAService.UpdateStore:input_type -> openfga.v1.UpdateStoreRequest - 36, // 60: openfga.v1.OpenFGAService.DeleteStore:input_type -> openfga.v1.DeleteStoreRequest - 38, // 61: openfga.v1.OpenFGAService.GetStore:input_type -> openfga.v1.GetStoreRequest - 40, // 62: openfga.v1.OpenFGAService.ListStores:input_type -> openfga.v1.ListStoresRequest - 5, // 63: openfga.v1.OpenFGAService.StreamedListObjects:input_type -> openfga.v1.StreamedListObjectsRequest - 1, // 64: openfga.v1.OpenFGAService.ListObjects:input_type -> openfga.v1.ListObjectsRequest - 3, // 65: openfga.v1.OpenFGAService.ListUsers:input_type -> openfga.v1.ListUsersRequest - 9, // 66: openfga.v1.OpenFGAService.Read:output_type -> openfga.v1.ReadResponse - 13, // 67: openfga.v1.OpenFGAService.Write:output_type -> openfga.v1.WriteResponse - 16, // 68: openfga.v1.OpenFGAService.Check:output_type -> openfga.v1.CheckResponse - 19, // 69: openfga.v1.OpenFGAService.Expand:output_type -> openfga.v1.ExpandResponse - 25, // 70: openfga.v1.OpenFGAService.ReadAuthorizationModels:output_type -> openfga.v1.ReadAuthorizationModelsResponse - 21, // 71: openfga.v1.OpenFGAService.ReadAuthorizationModel:output_type -> openfga.v1.ReadAuthorizationModelResponse - 23, // 72: openfga.v1.OpenFGAService.WriteAuthorizationModel:output_type -> openfga.v1.WriteAuthorizationModelResponse - 27, // 73: openfga.v1.OpenFGAService.WriteAssertions:output_type -> openfga.v1.WriteAssertionsResponse - 29, // 74: openfga.v1.OpenFGAService.ReadAssertions:output_type -> openfga.v1.ReadAssertionsResponse - 31, // 75: openfga.v1.OpenFGAService.ReadChanges:output_type -> openfga.v1.ReadChangesResponse - 33, // 76: openfga.v1.OpenFGAService.CreateStore:output_type -> openfga.v1.CreateStoreResponse - 35, // 77: openfga.v1.OpenFGAService.UpdateStore:output_type -> openfga.v1.UpdateStoreResponse - 37, // 78: openfga.v1.OpenFGAService.DeleteStore:output_type -> openfga.v1.DeleteStoreResponse - 39, // 79: openfga.v1.OpenFGAService.GetStore:output_type -> openfga.v1.GetStoreResponse - 41, // 80: openfga.v1.OpenFGAService.ListStores:output_type -> openfga.v1.ListStoresResponse - 6, // 81: openfga.v1.OpenFGAService.StreamedListObjects:output_type -> openfga.v1.StreamedListObjectsResponse - 2, // 82: openfga.v1.OpenFGAService.ListObjects:output_type -> openfga.v1.ListObjectsResponse - 4, // 83: openfga.v1.OpenFGAService.ListUsers:output_type -> openfga.v1.ListUsersResponse - 66, // [66:84] is the sub-list for method output_type - 48, // [48:66] is the sub-list for method input_type - 48, // [48:48] is the sub-list for extension type_name - 48, // [48:48] is the sub-list for extension extendee - 0, // [0:48] is the sub-list for field type_name + 46, // 46: openfga.v1.Assertion.contextual_tuples:type_name -> openfga.v1.ContextualTupleKeys + 43, // 47: openfga.v1.Assertions.assertions:type_name -> openfga.v1.Assertion + 61, // 48: openfga.v1.WriteAuthorizationModelRequest.ConditionsEntry.value:type_name -> openfga.v1.Condition + 7, // 49: openfga.v1.OpenFGAService.Read:input_type -> openfga.v1.ReadRequest + 12, // 50: openfga.v1.OpenFGAService.Write:input_type -> openfga.v1.WriteRequest + 14, // 51: openfga.v1.OpenFGAService.Check:input_type -> openfga.v1.CheckRequest + 17, // 52: openfga.v1.OpenFGAService.Expand:input_type -> openfga.v1.ExpandRequest + 24, // 53: openfga.v1.OpenFGAService.ReadAuthorizationModels:input_type -> openfga.v1.ReadAuthorizationModelsRequest + 20, // 54: openfga.v1.OpenFGAService.ReadAuthorizationModel:input_type -> openfga.v1.ReadAuthorizationModelRequest + 22, // 55: openfga.v1.OpenFGAService.WriteAuthorizationModel:input_type -> openfga.v1.WriteAuthorizationModelRequest + 26, // 56: openfga.v1.OpenFGAService.WriteAssertions:input_type -> openfga.v1.WriteAssertionsRequest + 28, // 57: openfga.v1.OpenFGAService.ReadAssertions:input_type -> openfga.v1.ReadAssertionsRequest + 30, // 58: openfga.v1.OpenFGAService.ReadChanges:input_type -> openfga.v1.ReadChangesRequest + 32, // 59: openfga.v1.OpenFGAService.CreateStore:input_type -> openfga.v1.CreateStoreRequest + 34, // 60: openfga.v1.OpenFGAService.UpdateStore:input_type -> openfga.v1.UpdateStoreRequest + 36, // 61: openfga.v1.OpenFGAService.DeleteStore:input_type -> openfga.v1.DeleteStoreRequest + 38, // 62: openfga.v1.OpenFGAService.GetStore:input_type -> openfga.v1.GetStoreRequest + 40, // 63: openfga.v1.OpenFGAService.ListStores:input_type -> openfga.v1.ListStoresRequest + 5, // 64: openfga.v1.OpenFGAService.StreamedListObjects:input_type -> openfga.v1.StreamedListObjectsRequest + 1, // 65: openfga.v1.OpenFGAService.ListObjects:input_type -> openfga.v1.ListObjectsRequest + 3, // 66: openfga.v1.OpenFGAService.ListUsers:input_type -> openfga.v1.ListUsersRequest + 9, // 67: openfga.v1.OpenFGAService.Read:output_type -> openfga.v1.ReadResponse + 13, // 68: openfga.v1.OpenFGAService.Write:output_type -> openfga.v1.WriteResponse + 16, // 69: openfga.v1.OpenFGAService.Check:output_type -> openfga.v1.CheckResponse + 19, // 70: openfga.v1.OpenFGAService.Expand:output_type -> openfga.v1.ExpandResponse + 25, // 71: openfga.v1.OpenFGAService.ReadAuthorizationModels:output_type -> openfga.v1.ReadAuthorizationModelsResponse + 21, // 72: openfga.v1.OpenFGAService.ReadAuthorizationModel:output_type -> openfga.v1.ReadAuthorizationModelResponse + 23, // 73: openfga.v1.OpenFGAService.WriteAuthorizationModel:output_type -> openfga.v1.WriteAuthorizationModelResponse + 27, // 74: openfga.v1.OpenFGAService.WriteAssertions:output_type -> openfga.v1.WriteAssertionsResponse + 29, // 75: openfga.v1.OpenFGAService.ReadAssertions:output_type -> openfga.v1.ReadAssertionsResponse + 31, // 76: openfga.v1.OpenFGAService.ReadChanges:output_type -> openfga.v1.ReadChangesResponse + 33, // 77: openfga.v1.OpenFGAService.CreateStore:output_type -> openfga.v1.CreateStoreResponse + 35, // 78: openfga.v1.OpenFGAService.UpdateStore:output_type -> openfga.v1.UpdateStoreResponse + 37, // 79: openfga.v1.OpenFGAService.DeleteStore:output_type -> openfga.v1.DeleteStoreResponse + 39, // 80: openfga.v1.OpenFGAService.GetStore:output_type -> openfga.v1.GetStoreResponse + 41, // 81: openfga.v1.OpenFGAService.ListStores:output_type -> openfga.v1.ListStoresResponse + 6, // 82: openfga.v1.OpenFGAService.StreamedListObjects:output_type -> openfga.v1.StreamedListObjectsResponse + 2, // 83: openfga.v1.OpenFGAService.ListObjects:output_type -> openfga.v1.ListObjectsResponse + 4, // 84: openfga.v1.OpenFGAService.ListUsers:output_type -> openfga.v1.ListUsersResponse + 67, // [67:85] is the sub-list for method output_type + 49, // [49:67] is the sub-list for method input_type + 49, // [49:49] is the sub-list for extension type_name + 49, // [49:49] is the sub-list for extension extendee + 0, // [0:49] is the sub-list for field type_name } func init() { file_openfga_v1_openfga_service_proto_init() } diff --git a/proto/openfga/v1/openfga_service.pb.validate.go b/proto/openfga/v1/openfga_service.pb.validate.go index 28d810f9..f673d753 100644 --- a/proto/openfga/v1/openfga_service.pb.validate.go +++ b/proto/openfga/v1/openfga_service.pb.validate.go @@ -6490,6 +6490,35 @@ func (m *Assertion) validate(all bool) error { // no validation rules for Expectation + if all { + switch v := interface{}(m.GetContextualTuples()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssertionValidationError{ + field: "ContextualTuples", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssertionValidationError{ + field: "ContextualTuples", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContextualTuples()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssertionValidationError{ + field: "ContextualTuples", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return AssertionMultiError(errors) }