snapshot of https://github.com/ory/keto.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
CI / Run lints and checks (push) Failing after 47s
CI / Run tests (push) Failing after 1s
CI / Run race tests (push) Failing after 5s
CI / Build CLI docs (push) Has been skipped
CI / Run buf actions (push) Failing after 5s
CodeQL / Analyze (go) (push) Failing after 3s
CodeQL / Analyze (javascript) (push) Failing after 2s
Docker Image Scanners / scanners (push) Failing after 3s
Format / format (push) Failing after 3s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Draft newsletter (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-16 01:08:34 +05:00
commit 9456a4e922
2560 changed files with 120911 additions and 0 deletions

201
gen/go/LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

23
gen/go/go.mod Normal file
View File

@@ -0,0 +1,23 @@
module github.com/ory/keto/gen/go
go 1.25.5
require (
connectrpc.com/connect v1.20.0
github.com/stretchr/testify v1.11.1
google.golang.org/grpc v1.82.1
google.golang.org/protobuf v1.36.11
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.39.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

63
gen/go/go.sum Normal file
View File

@@ -0,0 +1,63 @@
connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ=
connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I=
go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0=
go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM=
go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY=
go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg=
go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg=
go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw=
go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A=
go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A=
go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus=
golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1:RmoJA1ujG+/lRGNfUnOMfhCy5EipVMyvUE+KNbPbTlw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE=
google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -0,0 +1,113 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/opl/v1alpha1/syntax_service.proto
package oplconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha1 "github.com/ory/keto/gen/go/ory/keto/opl/v1alpha1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// SyntaxServiceName is the fully-qualified name of the SyntaxService service.
SyntaxServiceName = "ory.keto.opl.v1alpha1.SyntaxService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// SyntaxServiceCheckProcedure is the fully-qualified name of the SyntaxService's Check RPC.
SyntaxServiceCheckProcedure = "/ory.keto.opl.v1alpha1.SyntaxService/Check"
)
// SyntaxServiceClient is a client for the ory.keto.opl.v1alpha1.SyntaxService service.
type SyntaxServiceClient interface {
// Performs a syntax check request.
Check(context.Context, *connect.Request[v1alpha1.CheckRequest]) (*connect.Response[v1alpha1.CheckResponse], error)
}
// NewSyntaxServiceClient constructs a client for the ory.keto.opl.v1alpha1.SyntaxService service.
// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
// connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewSyntaxServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SyntaxServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
syntaxServiceMethods := v1alpha1.File_ory_keto_opl_v1alpha1_syntax_service_proto.Services().ByName("SyntaxService").Methods()
return &syntaxServiceClient{
check: connect.NewClient[v1alpha1.CheckRequest, v1alpha1.CheckResponse](
httpClient,
baseURL+SyntaxServiceCheckProcedure,
connect.WithSchema(syntaxServiceMethods.ByName("Check")),
connect.WithClientOptions(opts...),
),
}
}
// syntaxServiceClient implements SyntaxServiceClient.
type syntaxServiceClient struct {
check *connect.Client[v1alpha1.CheckRequest, v1alpha1.CheckResponse]
}
// Check calls ory.keto.opl.v1alpha1.SyntaxService.Check.
func (c *syntaxServiceClient) Check(ctx context.Context, req *connect.Request[v1alpha1.CheckRequest]) (*connect.Response[v1alpha1.CheckResponse], error) {
return c.check.CallUnary(ctx, req)
}
// SyntaxServiceHandler is an implementation of the ory.keto.opl.v1alpha1.SyntaxService service.
type SyntaxServiceHandler interface {
// Performs a syntax check request.
Check(context.Context, *connect.Request[v1alpha1.CheckRequest]) (*connect.Response[v1alpha1.CheckResponse], error)
}
// NewSyntaxServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewSyntaxServiceHandler(svc SyntaxServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
syntaxServiceMethods := v1alpha1.File_ory_keto_opl_v1alpha1_syntax_service_proto.Services().ByName("SyntaxService").Methods()
syntaxServiceCheckHandler := connect.NewUnaryHandler(
SyntaxServiceCheckProcedure,
svc.Check,
connect.WithSchema(syntaxServiceMethods.ByName("Check")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.opl.v1alpha1.SyntaxService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case SyntaxServiceCheckProcedure:
syntaxServiceCheckHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedSyntaxServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedSyntaxServiceHandler struct{}
func (UnimplementedSyntaxServiceHandler) Check(context.Context, *connect.Request[v1alpha1.CheckRequest]) (*connect.Response[v1alpha1.CheckResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.opl.v1alpha1.SyntaxService.Check is not implemented"))
}

View File

@@ -0,0 +1,302 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/opl/v1alpha1/syntax_service.proto
package opl
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type CheckRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CheckRequest) Reset() {
*x = CheckRequest{}
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CheckRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckRequest) ProtoMessage() {}
func (x *CheckRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescGZIP(), []int{0}
}
func (x *CheckRequest) GetContent() []byte {
if x != nil {
return x.Content
}
return nil
}
type CheckResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
ParseErrors []*ParseError `protobuf:"bytes,1,rep,name=parse_errors,json=parseErrors,proto3" json:"parse_errors,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CheckResponse) Reset() {
*x = CheckResponse{}
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CheckResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckResponse) ProtoMessage() {}
func (x *CheckResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescGZIP(), []int{1}
}
func (x *CheckResponse) GetParseErrors() []*ParseError {
if x != nil {
return x.ParseErrors
}
return nil
}
type ParseError struct {
state protoimpl.MessageState `protogen:"open.v1"`
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Start *SourcePosition `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"`
End *SourcePosition `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ParseError) Reset() {
*x = ParseError{}
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ParseError) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ParseError) ProtoMessage() {}
func (x *ParseError) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ParseError.ProtoReflect.Descriptor instead.
func (*ParseError) Descriptor() ([]byte, []int) {
return file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescGZIP(), []int{2}
}
func (x *ParseError) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *ParseError) GetStart() *SourcePosition {
if x != nil {
return x.Start
}
return nil
}
func (x *ParseError) GetEnd() *SourcePosition {
if x != nil {
return x.End
}
return nil
}
type SourcePosition struct {
state protoimpl.MessageState `protogen:"open.v1"`
Line uint32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`
Column uint32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SourcePosition) Reset() {
*x = SourcePosition{}
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SourcePosition) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SourcePosition) ProtoMessage() {}
func (x *SourcePosition) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SourcePosition.ProtoReflect.Descriptor instead.
func (*SourcePosition) Descriptor() ([]byte, []int) {
return file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescGZIP(), []int{3}
}
func (x *SourcePosition) GetLine() uint32 {
if x != nil {
return x.Line
}
return 0
}
func (x *SourcePosition) GetColumn() uint32 {
if x != nil {
return x.Column
}
return 0
}
var File_ory_keto_opl_v1alpha1_syntax_service_proto protoreflect.FileDescriptor
const file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDesc = "" +
"\n" +
"*ory/keto/opl/v1alpha1/syntax_service.proto\x12\x15ory.keto.opl.v1alpha1\"(\n" +
"\fCheckRequest\x12\x18\n" +
"\acontent\x18\x01 \x01(\fR\acontent\"U\n" +
"\rCheckResponse\x12D\n" +
"\fparse_errors\x18\x01 \x03(\v2!.ory.keto.opl.v1alpha1.ParseErrorR\vparseErrors\"\x9c\x01\n" +
"\n" +
"ParseError\x12\x18\n" +
"\amessage\x18\x01 \x01(\tR\amessage\x12;\n" +
"\x05start\x18\x02 \x01(\v2%.ory.keto.opl.v1alpha1.SourcePositionR\x05start\x127\n" +
"\x03end\x18\x03 \x01(\v2%.ory.keto.opl.v1alpha1.SourcePositionR\x03end\"<\n" +
"\x0eSourcePosition\x12\x12\n" +
"\x04line\x18\x01 \x01(\rR\x04line\x12\x16\n" +
"\x06column\x18\x02 \x01(\rR\x06column2c\n" +
"\rSyntaxService\x12R\n" +
"\x05Check\x12#.ory.keto.opl.v1alpha1.CheckRequest\x1a$.ory.keto.opl.v1alpha1.CheckResponseB\xdc\x01\n" +
"\x19com.ory.keto.opl.v1alpha1B\x12SyntaxServiceProtoP\x01Z4github.com/ory/keto/gen/go/ory/keto/opl/v1alpha1;opl\xa2\x02\x03OKO\xaa\x02\x15Ory.Keto.Opl.V1alpha1\xca\x02\x15Ory\\Keto\\Opl\\V1alpha1\xe2\x02!Ory\\Keto\\Opl\\V1alpha1\\GPBMetadata\xea\x02\x18Ory::Keto::Opl::V1alpha1b\x06proto3"
var (
file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescOnce sync.Once
file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescData []byte
)
func file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescGZIP() []byte {
file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescOnce.Do(func() {
file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDesc), len(file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDesc)))
})
return file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDescData
}
var file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_ory_keto_opl_v1alpha1_syntax_service_proto_goTypes = []any{
(*CheckRequest)(nil), // 0: ory.keto.opl.v1alpha1.CheckRequest
(*CheckResponse)(nil), // 1: ory.keto.opl.v1alpha1.CheckResponse
(*ParseError)(nil), // 2: ory.keto.opl.v1alpha1.ParseError
(*SourcePosition)(nil), // 3: ory.keto.opl.v1alpha1.SourcePosition
}
var file_ory_keto_opl_v1alpha1_syntax_service_proto_depIdxs = []int32{
2, // 0: ory.keto.opl.v1alpha1.CheckResponse.parse_errors:type_name -> ory.keto.opl.v1alpha1.ParseError
3, // 1: ory.keto.opl.v1alpha1.ParseError.start:type_name -> ory.keto.opl.v1alpha1.SourcePosition
3, // 2: ory.keto.opl.v1alpha1.ParseError.end:type_name -> ory.keto.opl.v1alpha1.SourcePosition
0, // 3: ory.keto.opl.v1alpha1.SyntaxService.Check:input_type -> ory.keto.opl.v1alpha1.CheckRequest
1, // 4: ory.keto.opl.v1alpha1.SyntaxService.Check:output_type -> ory.keto.opl.v1alpha1.CheckResponse
4, // [4:5] is the sub-list for method output_type
3, // [3:4] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_ory_keto_opl_v1alpha1_syntax_service_proto_init() }
func file_ory_keto_opl_v1alpha1_syntax_service_proto_init() {
if File_ory_keto_opl_v1alpha1_syntax_service_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDesc), len(file_ory_keto_opl_v1alpha1_syntax_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_opl_v1alpha1_syntax_service_proto_goTypes,
DependencyIndexes: file_ory_keto_opl_v1alpha1_syntax_service_proto_depIdxs,
MessageInfos: file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes,
}.Build()
File_ory_keto_opl_v1alpha1_syntax_service_proto = out.File
file_ory_keto_opl_v1alpha1_syntax_service_proto_goTypes = nil
file_ory_keto_opl_v1alpha1_syntax_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,130 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/opl/v1alpha1/syntax_service.proto
package opl
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
SyntaxService_Check_FullMethodName = "/ory.keto.opl.v1alpha1.SyntaxService/Check"
)
// SyntaxServiceClient is the client API for SyntaxService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service that checks the syntax of an OPL file.
type SyntaxServiceClient interface {
// Performs a syntax check request.
Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
}
type syntaxServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSyntaxServiceClient(cc grpc.ClientConnInterface) SyntaxServiceClient {
return &syntaxServiceClient{cc}
}
func (c *syntaxServiceClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckResponse)
err := c.cc.Invoke(ctx, SyntaxService_Check_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// SyntaxServiceServer is the server API for SyntaxService service.
// All implementations must embed UnimplementedSyntaxServiceServer
// for forward compatibility.
//
// The service that checks the syntax of an OPL file.
type SyntaxServiceServer interface {
// Performs a syntax check request.
Check(context.Context, *CheckRequest) (*CheckResponse, error)
mustEmbedUnimplementedSyntaxServiceServer()
}
// UnimplementedSyntaxServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSyntaxServiceServer struct{}
func (UnimplementedSyntaxServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Check not implemented")
}
func (UnimplementedSyntaxServiceServer) mustEmbedUnimplementedSyntaxServiceServer() {}
func (UnimplementedSyntaxServiceServer) testEmbeddedByValue() {}
// UnsafeSyntaxServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SyntaxServiceServer will
// result in compilation errors.
type UnsafeSyntaxServiceServer interface {
mustEmbedUnimplementedSyntaxServiceServer()
}
func RegisterSyntaxServiceServer(s grpc.ServiceRegistrar, srv SyntaxServiceServer) {
// If the following call panics, it indicates UnimplementedSyntaxServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&SyntaxService_ServiceDesc, srv)
}
func _SyntaxService_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyntaxServiceServer).Check(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SyntaxService_Check_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyntaxServiceServer).Check(ctx, req.(*CheckRequest))
}
return interceptor(ctx, in, info, handler)
}
// SyntaxService_ServiceDesc is the grpc.ServiceDesc for SyntaxService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SyntaxService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.opl.v1alpha1.SyntaxService",
HandlerType: (*SyntaxServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _SyntaxService_Check_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/opl/v1alpha1/syntax_service.proto",
}

View File

@@ -0,0 +1,594 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/check_service.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The request for a CheckService.Check RPC.
// Checks whether a specific subject is related to an object.
type CheckRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The namespace to evaluate the check.
//
// Note: If you use the expand-API and the check
// evaluates a RelationTuple specifying a SubjectSet as
// subject or due to a rewrite rule in a namespace config
// this check request may involve other namespaces automatically.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
// The related object in this check.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
// The relation between the Object and the Subject.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"`
// The related subject in this check.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
Subject *Subject `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
Tuple *RelationTuple `protobuf:"bytes,8,opt,name=tuple,proto3" json:"tuple,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Set this field to `true` in case your application
// needs to authorize depending on up to date ACLs,
// also called a "content-change check".
//
// If set to `true` the `snaptoken` field is ignored,
// the check is evaluated at the latest snapshot
// (globally consistent) and the response includes a
// snaptoken for clients to store along with object
// contents that can be used for subsequent checks
// of the same content version.
//
// Example use case:
// - You need to authorize a user to modify/delete some resource
// and it is unacceptable that if the permission to do that had
// just been revoked some seconds ago so that the change had not
// yet been fully replicated to all availability zones.
//
// -->
Latest bool `protobuf:"varint,5,opt,name=latest,proto3" json:"latest,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Optional. Like reads, a check is always evaluated at a
// consistent snapshot no earlier than the given snaptoken.
//
// Leave this field blank if you want to evaluate the check
// based on eventually consistent ACLs, benefiting from very
// low latency, but possibly slightly stale results.
//
// If the specified token is too old and no longer known,
// the server falls back as if no snaptoken had been specified.
//
// If not specified the server tries to evaluate the check
// on the best snapshot version where it is very likely that
// ACLs had already been replicated to all availability zones.
// -->
Snaptoken string `protobuf:"bytes,6,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
// The maximum depth to search for a relation.
//
// If the value is less than 1 or greater than the global
// max-depth then the global max-depth will be used instead.
MaxDepth int32 `protobuf:"varint,7,opt,name=max_depth,json=maxDepth,proto3" json:"max_depth,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CheckRequest) Reset() {
*x = CheckRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CheckRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckRequest) ProtoMessage() {}
func (x *CheckRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP(), []int{0}
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
func (x *CheckRequest) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
func (x *CheckRequest) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
func (x *CheckRequest) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/check_service.proto.
func (x *CheckRequest) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
func (x *CheckRequest) GetTuple() *RelationTuple {
if x != nil {
return x.Tuple
}
return nil
}
func (x *CheckRequest) GetLatest() bool {
if x != nil {
return x.Latest
}
return false
}
func (x *CheckRequest) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
func (x *CheckRequest) GetMaxDepth() int32 {
if x != nil {
return x.MaxDepth
}
return 0
}
// The response for a CheckService.Check rpc.
type CheckResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Whether the specified subject (id)
// is related to the requested object.
//
// It is false by default if no ACL matches.
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// The last known snapshot token ONLY specified if
// the request had not specified a snaptoken,
// since this performed a "content-change request"
// and consistently fetched the last known snapshot token.
//
// This field is not set if the request had specified a snaptoken!
//
// If set, clients should cache and use this token
// for subsequent requests to have minimal latency,
// but allow slightly stale responses (only some milliseconds or seconds).
// -->
Snaptoken string `protobuf:"bytes,2,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CheckResponse) Reset() {
*x = CheckResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CheckResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckResponse) ProtoMessage() {}
func (x *CheckResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP(), []int{1}
}
func (x *CheckResponse) GetAllowed() bool {
if x != nil {
return x.Allowed
}
return false
}
func (x *CheckResponse) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
// The response for an individual check in the CheckService.BatchCheck rpc.
type CheckResponseWithError struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Whether the specified subject (id)
// is related to the requested object.
//
// It is false by default if no ACL matches.
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
// If there was an error checking the tuple,
// this will contain the error message.
//
// If the check was performed successfully, this will be empty.
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// The last known snapshot token ONLY specified if
// the request had not specified a snaptoken,
// since this performed a "content-change request"
// and consistently fetched the last known snapshot token.
//
// This field is not set if the request had specified a snaptoken!
//
// If set, clients should cache and use this token
// for subsequent requests to have minimal latency,
// but allow slightly stale responses (only some milliseconds or seconds).
// -->
Snaptoken string `protobuf:"bytes,3,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CheckResponseWithError) Reset() {
*x = CheckResponseWithError{}
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CheckResponseWithError) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckResponseWithError) ProtoMessage() {}
func (x *CheckResponseWithError) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckResponseWithError.ProtoReflect.Descriptor instead.
func (*CheckResponseWithError) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP(), []int{2}
}
func (x *CheckResponseWithError) GetAllowed() bool {
if x != nil {
return x.Allowed
}
return false
}
func (x *CheckResponseWithError) GetError() string {
if x != nil {
return x.Error
}
return ""
}
func (x *CheckResponseWithError) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
// The request for a CheckService.BatchCheck RPC.
// Checks a batch of relations.
type BatchCheckRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Tuples []*RelationTuple `protobuf:"bytes,1,rep,name=tuples,proto3" json:"tuples,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Set this field to `true` in case your application
// needs to authorize depending on up to date ACLs,
// also called a "content-change check".
//
// If set to `true` the `snaptoken` field is ignored,
// the check is evaluated at the latest snapshot
// (globally consistent) and the response includes a
// snaptoken for clients to store along with object
// contents that can be used for subsequent checks
// of the same content version.
//
// Example use case:
// - You need to authorize a user to modify/delete some resource
// and it is unacceptable that if the permission to do that had
// just been revoked some seconds ago so that the change had not
// yet been fully replicated to all availability zones.
//
// -->
Latest bool `protobuf:"varint,2,opt,name=latest,proto3" json:"latest,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Optional. Like reads, a check is always evaluated at a
// consistent snapshot no earlier than the given snaptoken.
//
// Leave this field blank if you want to evaluate the check
// based on eventually consistent ACLs, benefiting from very
// low latency, but possibly slightly stale results.
//
// If the specified token is too old and no longer known,
// the server falls back as if no snaptoken had been specified.
//
// If not specified the server tries to evaluate the check
// on the best snapshot version where it is very likely that
// ACLs had already been replicated to all availability zones.
// -->
Snaptoken string `protobuf:"bytes,3,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
// The maximum depth to search for a relation.
//
// If the value is less than 1 or greater than the global
// max-depth then the global max-depth will be used instead.
MaxDepth int32 `protobuf:"varint,4,opt,name=max_depth,json=maxDepth,proto3" json:"max_depth,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BatchCheckRequest) Reset() {
*x = BatchCheckRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BatchCheckRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BatchCheckRequest) ProtoMessage() {}
func (x *BatchCheckRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BatchCheckRequest.ProtoReflect.Descriptor instead.
func (*BatchCheckRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP(), []int{3}
}
func (x *BatchCheckRequest) GetTuples() []*RelationTuple {
if x != nil {
return x.Tuples
}
return nil
}
func (x *BatchCheckRequest) GetLatest() bool {
if x != nil {
return x.Latest
}
return false
}
func (x *BatchCheckRequest) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
func (x *BatchCheckRequest) GetMaxDepth() int32 {
if x != nil {
return x.MaxDepth
}
return 0
}
// The response for a CheckService.BatchCheck rpc.
type BatchCheckResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The results of the batch check. The order of these
// results will match the order of the input.
Results []*CheckResponseWithError `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BatchCheckResponse) Reset() {
*x = BatchCheckResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BatchCheckResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BatchCheckResponse) ProtoMessage() {}
func (x *BatchCheckResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BatchCheckResponse.ProtoReflect.Descriptor instead.
func (*BatchCheckResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP(), []int{4}
}
func (x *BatchCheckResponse) GetResults() []*CheckResponseWithError {
if x != nil {
return x.Results
}
return nil
}
var File_ory_keto_relation_tuples_v1alpha2_check_service_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDesc = "" +
"\n" +
"5ory/keto/relation_tuples/v1alpha2/check_service.proto\x12!ory.keto.relation_tuples.v1alpha2\x1a7ory/keto/relation_tuples/v1alpha2/relation_tuples.proto\"\xd1\x02\n" +
"\fCheckRequest\x12 \n" +
"\tnamespace\x18\x01 \x01(\tB\x02\x18\x01R\tnamespace\x12\x1a\n" +
"\x06object\x18\x02 \x01(\tB\x02\x18\x01R\x06object\x12\x1e\n" +
"\brelation\x18\x03 \x01(\tB\x02\x18\x01R\brelation\x12H\n" +
"\asubject\x18\x04 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectB\x02\x18\x01R\asubject\x12F\n" +
"\x05tuple\x18\b \x01(\v20.ory.keto.relation_tuples.v1alpha2.RelationTupleR\x05tuple\x12\x16\n" +
"\x06latest\x18\x05 \x01(\bR\x06latest\x12\x1c\n" +
"\tsnaptoken\x18\x06 \x01(\tR\tsnaptoken\x12\x1b\n" +
"\tmax_depth\x18\a \x01(\x05R\bmaxDepth\"G\n" +
"\rCheckResponse\x12\x18\n" +
"\aallowed\x18\x01 \x01(\bR\aallowed\x12\x1c\n" +
"\tsnaptoken\x18\x02 \x01(\tR\tsnaptoken\"f\n" +
"\x16CheckResponseWithError\x12\x18\n" +
"\aallowed\x18\x01 \x01(\bR\aallowed\x12\x14\n" +
"\x05error\x18\x02 \x01(\tR\x05error\x12\x1c\n" +
"\tsnaptoken\x18\x03 \x01(\tR\tsnaptoken\"\xb0\x01\n" +
"\x11BatchCheckRequest\x12H\n" +
"\x06tuples\x18\x01 \x03(\v20.ory.keto.relation_tuples.v1alpha2.RelationTupleR\x06tuples\x12\x16\n" +
"\x06latest\x18\x02 \x01(\bR\x06latest\x12\x1c\n" +
"\tsnaptoken\x18\x03 \x01(\tR\tsnaptoken\x12\x1b\n" +
"\tmax_depth\x18\x04 \x01(\x05R\bmaxDepth\"i\n" +
"\x12BatchCheckResponse\x12S\n" +
"\aresults\x18\x01 \x03(\v29.ory.keto.relation_tuples.v1alpha2.CheckResponseWithErrorR\aresults2\xf5\x01\n" +
"\fCheckService\x12j\n" +
"\x05Check\x12/.ory.keto.relation_tuples.v1alpha2.CheckRequest\x1a0.ory.keto.relation_tuples.v1alpha2.CheckResponse\x12y\n" +
"\n" +
"BatchCheck\x124.ory.keto.relation_tuples.v1alpha2.BatchCheckRequest\x1a5.ory.keto.relation_tuples.v1alpha2.BatchCheckResponseB\xaa\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x11CheckServiceProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_ory_keto_relation_tuples_v1alpha2_check_service_proto_goTypes = []any{
(*CheckRequest)(nil), // 0: ory.keto.relation_tuples.v1alpha2.CheckRequest
(*CheckResponse)(nil), // 1: ory.keto.relation_tuples.v1alpha2.CheckResponse
(*CheckResponseWithError)(nil), // 2: ory.keto.relation_tuples.v1alpha2.CheckResponseWithError
(*BatchCheckRequest)(nil), // 3: ory.keto.relation_tuples.v1alpha2.BatchCheckRequest
(*BatchCheckResponse)(nil), // 4: ory.keto.relation_tuples.v1alpha2.BatchCheckResponse
(*Subject)(nil), // 5: ory.keto.relation_tuples.v1alpha2.Subject
(*RelationTuple)(nil), // 6: ory.keto.relation_tuples.v1alpha2.RelationTuple
}
var file_ory_keto_relation_tuples_v1alpha2_check_service_proto_depIdxs = []int32{
5, // 0: ory.keto.relation_tuples.v1alpha2.CheckRequest.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
6, // 1: ory.keto.relation_tuples.v1alpha2.CheckRequest.tuple:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTuple
6, // 2: ory.keto.relation_tuples.v1alpha2.BatchCheckRequest.tuples:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTuple
2, // 3: ory.keto.relation_tuples.v1alpha2.BatchCheckResponse.results:type_name -> ory.keto.relation_tuples.v1alpha2.CheckResponseWithError
0, // 4: ory.keto.relation_tuples.v1alpha2.CheckService.Check:input_type -> ory.keto.relation_tuples.v1alpha2.CheckRequest
3, // 5: ory.keto.relation_tuples.v1alpha2.CheckService.BatchCheck:input_type -> ory.keto.relation_tuples.v1alpha2.BatchCheckRequest
1, // 6: ory.keto.relation_tuples.v1alpha2.CheckService.Check:output_type -> ory.keto.relation_tuples.v1alpha2.CheckResponse
4, // 7: ory.keto.relation_tuples.v1alpha2.CheckService.BatchCheck:output_type -> ory.keto.relation_tuples.v1alpha2.BatchCheckResponse
6, // [6:8] is the sub-list for method output_type
4, // [4:6] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_check_service_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_check_service_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_check_service_proto != nil {
return
}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_check_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_check_service_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_check_service_proto_depIdxs,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_check_service_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_check_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,174 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/check_service.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
CheckService_Check_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.CheckService/Check"
CheckService_BatchCheck_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.CheckService/BatchCheck"
)
// CheckServiceClient is the client API for CheckService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service that performs authorization checks
// based on the stored Access Control Lists.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type CheckServiceClient interface {
// Performs an authorization check.
Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
BatchCheck(ctx context.Context, in *BatchCheckRequest, opts ...grpc.CallOption) (*BatchCheckResponse, error)
}
type checkServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCheckServiceClient(cc grpc.ClientConnInterface) CheckServiceClient {
return &checkServiceClient{cc}
}
func (c *checkServiceClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckResponse)
err := c.cc.Invoke(ctx, CheckService_Check_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *checkServiceClient) BatchCheck(ctx context.Context, in *BatchCheckRequest, opts ...grpc.CallOption) (*BatchCheckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(BatchCheckResponse)
err := c.cc.Invoke(ctx, CheckService_BatchCheck_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// CheckServiceServer is the server API for CheckService service.
// All implementations must embed UnimplementedCheckServiceServer
// for forward compatibility.
//
// The service that performs authorization checks
// based on the stored Access Control Lists.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type CheckServiceServer interface {
// Performs an authorization check.
Check(context.Context, *CheckRequest) (*CheckResponse, error)
BatchCheck(context.Context, *BatchCheckRequest) (*BatchCheckResponse, error)
mustEmbedUnimplementedCheckServiceServer()
}
// UnimplementedCheckServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedCheckServiceServer struct{}
func (UnimplementedCheckServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Check not implemented")
}
func (UnimplementedCheckServiceServer) BatchCheck(context.Context, *BatchCheckRequest) (*BatchCheckResponse, error) {
return nil, status.Error(codes.Unimplemented, "method BatchCheck not implemented")
}
func (UnimplementedCheckServiceServer) mustEmbedUnimplementedCheckServiceServer() {}
func (UnimplementedCheckServiceServer) testEmbeddedByValue() {}
// UnsafeCheckServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CheckServiceServer will
// result in compilation errors.
type UnsafeCheckServiceServer interface {
mustEmbedUnimplementedCheckServiceServer()
}
func RegisterCheckServiceServer(s grpc.ServiceRegistrar, srv CheckServiceServer) {
// If the following call panics, it indicates UnimplementedCheckServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&CheckService_ServiceDesc, srv)
}
func _CheckService_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CheckServiceServer).Check(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CheckService_Check_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CheckServiceServer).Check(ctx, req.(*CheckRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CheckService_BatchCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchCheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CheckServiceServer).BatchCheck(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CheckService_BatchCheck_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CheckServiceServer).BatchCheck(ctx, req.(*BatchCheckRequest))
}
return interceptor(ctx, in, info, handler)
}
// CheckService_ServiceDesc is the grpc.ServiceDesc for CheckService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CheckService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.CheckService",
HandlerType: (*CheckServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _CheckService_Check_Handler,
},
{
MethodName: "BatchCheck",
Handler: _CheckService_BatchCheck_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/check_service.proto",
}

View File

@@ -0,0 +1,388 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/expand_service.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type NodeType int32
const (
NodeType_NODE_TYPE_UNSPECIFIED NodeType = 0
// This node expands to a union of all children.
NodeType_NODE_TYPE_UNION NodeType = 1
// Not implemented yet.
NodeType_NODE_TYPE_EXCLUSION NodeType = 2
// Not implemented yet.
NodeType_NODE_TYPE_INTERSECTION NodeType = 3
// This node is a leaf and contains no children.
// Its subject is a `SubjectID` unless `max_depth` was reached.
NodeType_NODE_TYPE_LEAF NodeType = 4
)
// Enum value maps for NodeType.
var (
NodeType_name = map[int32]string{
0: "NODE_TYPE_UNSPECIFIED",
1: "NODE_TYPE_UNION",
2: "NODE_TYPE_EXCLUSION",
3: "NODE_TYPE_INTERSECTION",
4: "NODE_TYPE_LEAF",
}
NodeType_value = map[string]int32{
"NODE_TYPE_UNSPECIFIED": 0,
"NODE_TYPE_UNION": 1,
"NODE_TYPE_EXCLUSION": 2,
"NODE_TYPE_INTERSECTION": 3,
"NODE_TYPE_LEAF": 4,
}
)
func (x NodeType) Enum() *NodeType {
p := new(NodeType)
*p = x
return p
}
func (x NodeType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (NodeType) Descriptor() protoreflect.EnumDescriptor {
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_enumTypes[0].Descriptor()
}
func (NodeType) Type() protoreflect.EnumType {
return &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_enumTypes[0]
}
func (x NodeType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use NodeType.Descriptor instead.
func (NodeType) EnumDescriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescGZIP(), []int{0}
}
// The request for an ExpandService.Expand RPC.
// Expands the given subject set.
type ExpandRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The subject to expand.
Subject *Subject `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
// The maximum depth of tree to build.
//
// If the value is less than 1 or greater than the global
// max-depth then the global max-depth will be used instead.
//
// It is important to set this parameter to a meaningful
// value. Ponder how deep you really want to display this.
MaxDepth int32 `protobuf:"varint,2,opt,name=max_depth,json=maxDepth,proto3" json:"max_depth,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Optional. Like reads, a expand is always evaluated at a
// consistent snapshot no earlier than the given snaptoken.
//
// Leave this field blank if you want to expand
// based on eventually consistent ACLs, benefiting from very
// low latency, but possibly slightly stale results.
//
// If the specified token is too old and no longer known,
// the server falls back as if no snaptoken had been specified.
//
// If not specified the server tries to build the tree
// on the best snapshot version where it is very likely that
// ACLs had already been replicated to all availability zones.
// -->
Snaptoken string `protobuf:"bytes,3,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExpandRequest) Reset() {
*x = ExpandRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExpandRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExpandRequest) ProtoMessage() {}
func (x *ExpandRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExpandRequest.ProtoReflect.Descriptor instead.
func (*ExpandRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescGZIP(), []int{0}
}
func (x *ExpandRequest) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
func (x *ExpandRequest) GetMaxDepth() int32 {
if x != nil {
return x.MaxDepth
}
return 0
}
func (x *ExpandRequest) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
// The response for a ExpandService.Expand RPC.
type ExpandResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The tree the requested subject set expands to.
// The requested subject set is the subject of the root.
//
// This field can be nil in some circumstances.
Tree *SubjectTree `protobuf:"bytes,1,opt,name=tree,proto3" json:"tree,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExpandResponse) Reset() {
*x = ExpandResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExpandResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExpandResponse) ProtoMessage() {}
func (x *ExpandResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExpandResponse.ProtoReflect.Descriptor instead.
func (*ExpandResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescGZIP(), []int{1}
}
func (x *ExpandResponse) GetTree() *SubjectTree {
if x != nil {
return x.Tree
}
return nil
}
type SubjectTree struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The type of the node.
NodeType NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=ory.keto.relation_tuples.v1alpha2.NodeType" json:"node_type,omitempty"`
// The subject this node represents.
// Deprecated: More information is now available in the tuple field.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/expand_service.proto.
Subject *Subject `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
// The relation tuple this node represents.
Tuple *RelationTuple `protobuf:"bytes,4,opt,name=tuple,proto3" json:"tuple,omitempty"`
// The children of this node.
//
// This is never set if `node_type` == `NODE_TYPE_LEAF`.
Children []*SubjectTree `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SubjectTree) Reset() {
*x = SubjectTree{}
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SubjectTree) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubjectTree) ProtoMessage() {}
func (x *SubjectTree) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubjectTree.ProtoReflect.Descriptor instead.
func (*SubjectTree) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescGZIP(), []int{2}
}
func (x *SubjectTree) GetNodeType() NodeType {
if x != nil {
return x.NodeType
}
return NodeType_NODE_TYPE_UNSPECIFIED
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/expand_service.proto.
func (x *SubjectTree) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
func (x *SubjectTree) GetTuple() *RelationTuple {
if x != nil {
return x.Tuple
}
return nil
}
func (x *SubjectTree) GetChildren() []*SubjectTree {
if x != nil {
return x.Children
}
return nil
}
var File_ory_keto_relation_tuples_v1alpha2_expand_service_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDesc = "" +
"\n" +
"6ory/keto/relation_tuples/v1alpha2/expand_service.proto\x12!ory.keto.relation_tuples.v1alpha2\x1a7ory/keto/relation_tuples/v1alpha2/relation_tuples.proto\"\x90\x01\n" +
"\rExpandRequest\x12D\n" +
"\asubject\x18\x01 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectR\asubject\x12\x1b\n" +
"\tmax_depth\x18\x02 \x01(\x05R\bmaxDepth\x12\x1c\n" +
"\tsnaptoken\x18\x03 \x01(\tR\tsnaptoken\"T\n" +
"\x0eExpandResponse\x12B\n" +
"\x04tree\x18\x01 \x01(\v2..ory.keto.relation_tuples.v1alpha2.SubjectTreeR\x04tree\"\xb5\x02\n" +
"\vSubjectTree\x12H\n" +
"\tnode_type\x18\x01 \x01(\x0e2+.ory.keto.relation_tuples.v1alpha2.NodeTypeR\bnodeType\x12H\n" +
"\asubject\x18\x02 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectB\x02\x18\x01R\asubject\x12F\n" +
"\x05tuple\x18\x04 \x01(\v20.ory.keto.relation_tuples.v1alpha2.RelationTupleR\x05tuple\x12J\n" +
"\bchildren\x18\x03 \x03(\v2..ory.keto.relation_tuples.v1alpha2.SubjectTreeR\bchildren*\x83\x01\n" +
"\bNodeType\x12\x19\n" +
"\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x13\n" +
"\x0fNODE_TYPE_UNION\x10\x01\x12\x17\n" +
"\x13NODE_TYPE_EXCLUSION\x10\x02\x12\x1a\n" +
"\x16NODE_TYPE_INTERSECTION\x10\x03\x12\x12\n" +
"\x0eNODE_TYPE_LEAF\x10\x042~\n" +
"\rExpandService\x12m\n" +
"\x06Expand\x120.ory.keto.relation_tuples.v1alpha2.ExpandRequest\x1a1.ory.keto.relation_tuples.v1alpha2.ExpandResponseB\xab\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x12ExpandServiceProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_goTypes = []any{
(NodeType)(0), // 0: ory.keto.relation_tuples.v1alpha2.NodeType
(*ExpandRequest)(nil), // 1: ory.keto.relation_tuples.v1alpha2.ExpandRequest
(*ExpandResponse)(nil), // 2: ory.keto.relation_tuples.v1alpha2.ExpandResponse
(*SubjectTree)(nil), // 3: ory.keto.relation_tuples.v1alpha2.SubjectTree
(*Subject)(nil), // 4: ory.keto.relation_tuples.v1alpha2.Subject
(*RelationTuple)(nil), // 5: ory.keto.relation_tuples.v1alpha2.RelationTuple
}
var file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_depIdxs = []int32{
4, // 0: ory.keto.relation_tuples.v1alpha2.ExpandRequest.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
3, // 1: ory.keto.relation_tuples.v1alpha2.ExpandResponse.tree:type_name -> ory.keto.relation_tuples.v1alpha2.SubjectTree
0, // 2: ory.keto.relation_tuples.v1alpha2.SubjectTree.node_type:type_name -> ory.keto.relation_tuples.v1alpha2.NodeType
4, // 3: ory.keto.relation_tuples.v1alpha2.SubjectTree.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
5, // 4: ory.keto.relation_tuples.v1alpha2.SubjectTree.tuple:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTuple
3, // 5: ory.keto.relation_tuples.v1alpha2.SubjectTree.children:type_name -> ory.keto.relation_tuples.v1alpha2.SubjectTree
1, // 6: ory.keto.relation_tuples.v1alpha2.ExpandService.Expand:input_type -> ory.keto.relation_tuples.v1alpha2.ExpandRequest
2, // 7: ory.keto.relation_tuples.v1alpha2.ExpandService.Expand:output_type -> ory.keto.relation_tuples.v1alpha2.ExpandResponse
7, // [7:8] is the sub-list for method output_type
6, // [6:7] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_expand_service_proto != nil {
return
}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_rawDesc)),
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_depIdxs,
EnumInfos: file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_enumTypes,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_expand_service_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,136 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/expand_service.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ExpandService_Expand_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.ExpandService/Expand"
)
// ExpandServiceClient is the client API for ExpandService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service that performs subject set expansion
// based on the stored Access Control Lists.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type ExpandServiceClient interface {
// Expands the subject set into a tree of subjects.
Expand(ctx context.Context, in *ExpandRequest, opts ...grpc.CallOption) (*ExpandResponse, error)
}
type expandServiceClient struct {
cc grpc.ClientConnInterface
}
func NewExpandServiceClient(cc grpc.ClientConnInterface) ExpandServiceClient {
return &expandServiceClient{cc}
}
func (c *expandServiceClient) Expand(ctx context.Context, in *ExpandRequest, opts ...grpc.CallOption) (*ExpandResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ExpandResponse)
err := c.cc.Invoke(ctx, ExpandService_Expand_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ExpandServiceServer is the server API for ExpandService service.
// All implementations must embed UnimplementedExpandServiceServer
// for forward compatibility.
//
// The service that performs subject set expansion
// based on the stored Access Control Lists.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type ExpandServiceServer interface {
// Expands the subject set into a tree of subjects.
Expand(context.Context, *ExpandRequest) (*ExpandResponse, error)
mustEmbedUnimplementedExpandServiceServer()
}
// UnimplementedExpandServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedExpandServiceServer struct{}
func (UnimplementedExpandServiceServer) Expand(context.Context, *ExpandRequest) (*ExpandResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Expand not implemented")
}
func (UnimplementedExpandServiceServer) mustEmbedUnimplementedExpandServiceServer() {}
func (UnimplementedExpandServiceServer) testEmbeddedByValue() {}
// UnsafeExpandServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ExpandServiceServer will
// result in compilation errors.
type UnsafeExpandServiceServer interface {
mustEmbedUnimplementedExpandServiceServer()
}
func RegisterExpandServiceServer(s grpc.ServiceRegistrar, srv ExpandServiceServer) {
// If the following call panics, it indicates UnimplementedExpandServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ExpandService_ServiceDesc, srv)
}
func _ExpandService_Expand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExpandRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExpandServiceServer).Expand(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ExpandService_Expand_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExpandServiceServer).Expand(ctx, req.(*ExpandRequest))
}
return interceptor(ctx, in, info, handler)
}
// ExpandService_ServiceDesc is the grpc.ServiceDesc for ExpandService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ExpandService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.ExpandService",
HandlerType: (*ExpandServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Expand",
Handler: _ExpandService_Expand_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/expand_service.proto",
}

View File

@@ -0,0 +1,219 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/namespaces_service.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Request for ReadService.ListNamespaces RPC.
type ListNamespacesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListNamespacesRequest) Reset() {
*x = ListNamespacesRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListNamespacesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListNamespacesRequest) ProtoMessage() {}
func (x *ListNamespacesRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListNamespacesRequest.ProtoReflect.Descriptor instead.
func (*ListNamespacesRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescGZIP(), []int{0}
}
type ListNamespacesResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Namespaces []*Namespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListNamespacesResponse) Reset() {
*x = ListNamespacesResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListNamespacesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListNamespacesResponse) ProtoMessage() {}
func (x *ListNamespacesResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListNamespacesResponse.ProtoReflect.Descriptor instead.
func (*ListNamespacesResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescGZIP(), []int{1}
}
func (x *ListNamespacesResponse) GetNamespaces() []*Namespace {
if x != nil {
return x.Namespaces
}
return nil
}
type Namespace struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Namespace) Reset() {
*x = Namespace{}
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Namespace) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Namespace) ProtoMessage() {}
func (x *Namespace) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Namespace.ProtoReflect.Descriptor instead.
func (*Namespace) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescGZIP(), []int{2}
}
func (x *Namespace) GetName() string {
if x != nil {
return x.Name
}
return ""
}
var File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDesc = "" +
"\n" +
":ory/keto/relation_tuples/v1alpha2/namespaces_service.proto\x12!ory.keto.relation_tuples.v1alpha2\"\x17\n" +
"\x15ListNamespacesRequest\"f\n" +
"\x16ListNamespacesResponse\x12L\n" +
"\n" +
"namespaces\x18\x01 \x03(\v2,.ory.keto.relation_tuples.v1alpha2.NamespaceR\n" +
"namespaces\"\x1f\n" +
"\tNamespace\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name2\x9b\x01\n" +
"\x11NamespacesService\x12\x85\x01\n" +
"\x0eListNamespaces\x128.ory.keto.relation_tuples.v1alpha2.ListNamespacesRequest\x1a9.ory.keto.relation_tuples.v1alpha2.ListNamespacesResponseB\xaf\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x16NamespacesServiceProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_goTypes = []any{
(*ListNamespacesRequest)(nil), // 0: ory.keto.relation_tuples.v1alpha2.ListNamespacesRequest
(*ListNamespacesResponse)(nil), // 1: ory.keto.relation_tuples.v1alpha2.ListNamespacesResponse
(*Namespace)(nil), // 2: ory.keto.relation_tuples.v1alpha2.Namespace
}
var file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_depIdxs = []int32{
2, // 0: ory.keto.relation_tuples.v1alpha2.ListNamespacesResponse.namespaces:type_name -> ory.keto.relation_tuples.v1alpha2.Namespace
0, // 1: ory.keto.relation_tuples.v1alpha2.NamespacesService.ListNamespaces:input_type -> ory.keto.relation_tuples.v1alpha2.ListNamespacesRequest
1, // 2: ory.keto.relation_tuples.v1alpha2.NamespacesService.ListNamespaces:output_type -> ory.keto.relation_tuples.v1alpha2.ListNamespacesResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_depIdxs,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,134 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/namespaces_service.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
NamespacesService_ListNamespaces_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.NamespacesService/ListNamespaces"
)
// NamespacesServiceClient is the client API for NamespacesService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service to query namespaces.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type NamespacesServiceClient interface {
// Lists Namespaces
ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
}
type namespacesServiceClient struct {
cc grpc.ClientConnInterface
}
func NewNamespacesServiceClient(cc grpc.ClientConnInterface) NamespacesServiceClient {
return &namespacesServiceClient{cc}
}
func (c *namespacesServiceClient) ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListNamespacesResponse)
err := c.cc.Invoke(ctx, NamespacesService_ListNamespaces_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// NamespacesServiceServer is the server API for NamespacesService service.
// All implementations must embed UnimplementedNamespacesServiceServer
// for forward compatibility.
//
// The service to query namespaces.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type NamespacesServiceServer interface {
// Lists Namespaces
ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error)
mustEmbedUnimplementedNamespacesServiceServer()
}
// UnimplementedNamespacesServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedNamespacesServiceServer struct{}
func (UnimplementedNamespacesServiceServer) ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListNamespaces not implemented")
}
func (UnimplementedNamespacesServiceServer) mustEmbedUnimplementedNamespacesServiceServer() {}
func (UnimplementedNamespacesServiceServer) testEmbeddedByValue() {}
// UnsafeNamespacesServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NamespacesServiceServer will
// result in compilation errors.
type UnsafeNamespacesServiceServer interface {
mustEmbedUnimplementedNamespacesServiceServer()
}
func RegisterNamespacesServiceServer(s grpc.ServiceRegistrar, srv NamespacesServiceServer) {
// If the following call panics, it indicates UnimplementedNamespacesServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&NamespacesService_ServiceDesc, srv)
}
func _NamespacesService_ListNamespaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListNamespacesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespacesServiceServer).ListNamespaces(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: NamespacesService_ListNamespaces_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespacesServiceServer).ListNamespaces(ctx, req.(*ListNamespacesRequest))
}
return interceptor(ctx, in, info, handler)
}
// NamespacesService_ServiceDesc is the grpc.ServiceDesc for NamespacesService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NamespacesService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.NamespacesService",
HandlerType: (*NamespacesServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListNamespaces",
Handler: _NamespacesService_ListNamespaces_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/namespaces_service.proto",
}

View File

@@ -0,0 +1,371 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/read_service.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Request for ReadService.ListRelationTuples RPC.
// See `ListRelationTuplesRequest_Query` for how to filter the query.
type ListRelationTuplesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// All query constraints are concatenated
// with a logical AND operator.
//
// The RelationTuple list from ListRelationTuplesResponse
// is ordered from the newest RelationTuple to the oldest.
//
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/read_service.proto.
Query *ListRelationTuplesRequest_Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
RelationQuery *RelationQuery `protobuf:"bytes,6,opt,name=relation_query,json=relationQuery,proto3" json:"relation_query,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Optional. The list of fields to be expanded
// in the RelationTuple list returned in `ListRelationTuplesResponse`.
// Leaving this field unspecified means all fields are expanded.
//
// Available fields:
// "object", "relation", "subject",
// "namespace", "subject.id", "subject.namespace",
// "subject.object", "subject.relation"
// -->
ExpandMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=expand_mask,json=expandMask,proto3" json:"expand_mask,omitempty"`
// This field is not implemented yet and has no effect.
// <!--
// Optional. The snapshot token for this read.
// -->
Snaptoken string `protobuf:"bytes,3,opt,name=snaptoken,proto3" json:"snaptoken,omitempty"`
// Optional. The maximum number of
// RelationTuples to return in the response.
//
// Default: 100
PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. An opaque pagination token returned from
// a previous call to `ListRelationTuples` that
// indicates where the page should start at.
//
// An empty token denotes the first page. All successive
// pages require the token from the previous page.
PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListRelationTuplesRequest) Reset() {
*x = ListRelationTuplesRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListRelationTuplesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListRelationTuplesRequest) ProtoMessage() {}
func (x *ListRelationTuplesRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListRelationTuplesRequest.ProtoReflect.Descriptor instead.
func (*ListRelationTuplesRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescGZIP(), []int{0}
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/read_service.proto.
func (x *ListRelationTuplesRequest) GetQuery() *ListRelationTuplesRequest_Query {
if x != nil {
return x.Query
}
return nil
}
func (x *ListRelationTuplesRequest) GetRelationQuery() *RelationQuery {
if x != nil {
return x.RelationQuery
}
return nil
}
func (x *ListRelationTuplesRequest) GetExpandMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.ExpandMask
}
return nil
}
func (x *ListRelationTuplesRequest) GetSnaptoken() string {
if x != nil {
return x.Snaptoken
}
return ""
}
func (x *ListRelationTuplesRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListRelationTuplesRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
// The response of a ReadService.ListRelationTuples RPC.
type ListRelationTuplesResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The relationships matching the list request.
RelationTuples []*RelationTuple `protobuf:"bytes,1,rep,name=relation_tuples,json=relationTuples,proto3" json:"relation_tuples,omitempty"`
// The token required to get the next page.
// If this is the last page, the token will be the empty string.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListRelationTuplesResponse) Reset() {
*x = ListRelationTuplesResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListRelationTuplesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListRelationTuplesResponse) ProtoMessage() {}
func (x *ListRelationTuplesResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListRelationTuplesResponse.ProtoReflect.Descriptor instead.
func (*ListRelationTuplesResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescGZIP(), []int{1}
}
func (x *ListRelationTuplesResponse) GetRelationTuples() []*RelationTuple {
if x != nil {
return x.RelationTuples
}
return nil
}
func (x *ListRelationTuplesResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The query for listing relationships.
// Clients can specify any optional field to
// partially filter for specific relationships.
//
// Example use cases (namespace is always required):
// - object only: display a list of all permissions referring to a specific object
// - relation only: get all groups that have members; get all directories that have content
// - object & relation: display all subjects that have a specific permission relation
// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to
// - object & relation & subject: check whether the relation tuple already exists
type ListRelationTuplesRequest_Query struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Required. The namespace to query.
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
// Optional. The object to query for.
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
// Optional. The relation to query for.
Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"`
// Optional. The subject to query for.
Subject *Subject `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListRelationTuplesRequest_Query) Reset() {
*x = ListRelationTuplesRequest_Query{}
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListRelationTuplesRequest_Query) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListRelationTuplesRequest_Query) ProtoMessage() {}
func (x *ListRelationTuplesRequest_Query) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListRelationTuplesRequest_Query.ProtoReflect.Descriptor instead.
func (*ListRelationTuplesRequest_Query) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescGZIP(), []int{0, 0}
}
func (x *ListRelationTuplesRequest_Query) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *ListRelationTuplesRequest_Query) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *ListRelationTuplesRequest_Query) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
func (x *ListRelationTuplesRequest_Query) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
var File_ory_keto_relation_tuples_v1alpha2_read_service_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDesc = "" +
"\n" +
"4ory/keto/relation_tuples/v1alpha2/read_service.proto\x12!ory.keto.relation_tuples.v1alpha2\x1a7ory/keto/relation_tuples/v1alpha2/relation_tuples.proto\x1a google/protobuf/field_mask.proto\"\x8b\x04\n" +
"\x19ListRelationTuplesRequest\x12\\\n" +
"\x05query\x18\x01 \x01(\v2B.ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.QueryB\x02\x18\x01R\x05query\x12W\n" +
"\x0erelation_query\x18\x06 \x01(\v20.ory.keto.relation_tuples.v1alpha2.RelationQueryR\rrelationQuery\x12;\n" +
"\vexpand_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" +
"expandMask\x12\x1c\n" +
"\tsnaptoken\x18\x03 \x01(\tR\tsnaptoken\x12\x1b\n" +
"\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x1d\n" +
"\n" +
"page_token\x18\x05 \x01(\tR\tpageToken\x1a\x9f\x01\n" +
"\x05Query\x12\x1c\n" +
"\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x16\n" +
"\x06object\x18\x02 \x01(\tR\x06object\x12\x1a\n" +
"\brelation\x18\x03 \x01(\tR\brelation\x12D\n" +
"\asubject\x18\x04 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectR\asubject\"\x9f\x01\n" +
"\x1aListRelationTuplesResponse\x12Y\n" +
"\x0frelation_tuples\x18\x01 \x03(\v20.ory.keto.relation_tuples.v1alpha2.RelationTupleR\x0erelationTuples\x12&\n" +
"\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken2\xa1\x01\n" +
"\vReadService\x12\x91\x01\n" +
"\x12ListRelationTuples\x12<.ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest\x1a=.ory.keto.relation_tuples.v1alpha2.ListRelationTuplesResponseB\xa9\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x10ReadServiceProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_ory_keto_relation_tuples_v1alpha2_read_service_proto_goTypes = []any{
(*ListRelationTuplesRequest)(nil), // 0: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest
(*ListRelationTuplesResponse)(nil), // 1: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesResponse
(*ListRelationTuplesRequest_Query)(nil), // 2: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.Query
(*RelationQuery)(nil), // 3: ory.keto.relation_tuples.v1alpha2.RelationQuery
(*fieldmaskpb.FieldMask)(nil), // 4: google.protobuf.FieldMask
(*RelationTuple)(nil), // 5: ory.keto.relation_tuples.v1alpha2.RelationTuple
(*Subject)(nil), // 6: ory.keto.relation_tuples.v1alpha2.Subject
}
var file_ory_keto_relation_tuples_v1alpha2_read_service_proto_depIdxs = []int32{
2, // 0: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.query:type_name -> ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.Query
3, // 1: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.relation_query:type_name -> ory.keto.relation_tuples.v1alpha2.RelationQuery
4, // 2: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.expand_mask:type_name -> google.protobuf.FieldMask
5, // 3: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesResponse.relation_tuples:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTuple
6, // 4: ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest.Query.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
0, // 5: ory.keto.relation_tuples.v1alpha2.ReadService.ListRelationTuples:input_type -> ory.keto.relation_tuples.v1alpha2.ListRelationTuplesRequest
1, // 6: ory.keto.relation_tuples.v1alpha2.ReadService.ListRelationTuples:output_type -> ory.keto.relation_tuples.v1alpha2.ListRelationTuplesResponse
6, // [6:7] is the sub-list for method output_type
5, // [5:6] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_read_service_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_read_service_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_read_service_proto != nil {
return
}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_read_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_read_service_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_read_service_proto_depIdxs,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_read_service_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_read_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,134 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/read_service.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ReadService_ListRelationTuples_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.ReadService/ListRelationTuples"
)
// ReadServiceClient is the client API for ReadService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service to query relationships.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type ReadServiceClient interface {
// Lists ACL relationships.
ListRelationTuples(ctx context.Context, in *ListRelationTuplesRequest, opts ...grpc.CallOption) (*ListRelationTuplesResponse, error)
}
type readServiceClient struct {
cc grpc.ClientConnInterface
}
func NewReadServiceClient(cc grpc.ClientConnInterface) ReadServiceClient {
return &readServiceClient{cc}
}
func (c *readServiceClient) ListRelationTuples(ctx context.Context, in *ListRelationTuplesRequest, opts ...grpc.CallOption) (*ListRelationTuplesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRelationTuplesResponse)
err := c.cc.Invoke(ctx, ReadService_ListRelationTuples_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ReadServiceServer is the server API for ReadService service.
// All implementations must embed UnimplementedReadServiceServer
// for forward compatibility.
//
// The service to query relationships.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis).
type ReadServiceServer interface {
// Lists ACL relationships.
ListRelationTuples(context.Context, *ListRelationTuplesRequest) (*ListRelationTuplesResponse, error)
mustEmbedUnimplementedReadServiceServer()
}
// UnimplementedReadServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedReadServiceServer struct{}
func (UnimplementedReadServiceServer) ListRelationTuples(context.Context, *ListRelationTuplesRequest) (*ListRelationTuplesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListRelationTuples not implemented")
}
func (UnimplementedReadServiceServer) mustEmbedUnimplementedReadServiceServer() {}
func (UnimplementedReadServiceServer) testEmbeddedByValue() {}
// UnsafeReadServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ReadServiceServer will
// result in compilation errors.
type UnsafeReadServiceServer interface {
mustEmbedUnimplementedReadServiceServer()
}
func RegisterReadServiceServer(s grpc.ServiceRegistrar, srv ReadServiceServer) {
// If the following call panics, it indicates UnimplementedReadServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ReadService_ServiceDesc, srv)
}
func _ReadService_ListRelationTuples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRelationTuplesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ReadServiceServer).ListRelationTuples(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ReadService_ListRelationTuples_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReadServiceServer).ListRelationTuples(ctx, req.(*ListRelationTuplesRequest))
}
return interceptor(ctx, in, info, handler)
}
// ReadService_ServiceDesc is the grpc.ServiceDesc for ReadService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ReadService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.ReadService",
HandlerType: (*ReadServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListRelationTuples",
Handler: _ReadService_ListRelationTuples_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/read_service.proto",
}

View File

@@ -0,0 +1,432 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/relation_tuples.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// RelationTuple defines a relation between an Object and a Subject.
type RelationTuple struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The namespace this relation tuple lives in.
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
// The object related by this tuple.
// It is an object in the namespace of the tuple.
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
// The relation between an Object and a Subject.
Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"`
// The subject related by this tuple.
// A Subject either represents a concrete subject id or
// a `SubjectSet` that expands to more Subjects.
Subject *Subject `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RelationTuple) Reset() {
*x = RelationTuple{}
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RelationTuple) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RelationTuple) ProtoMessage() {}
func (x *RelationTuple) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RelationTuple.ProtoReflect.Descriptor instead.
func (*RelationTuple) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescGZIP(), []int{0}
}
func (x *RelationTuple) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *RelationTuple) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *RelationTuple) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
func (x *RelationTuple) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
// The query for listing relationships.
// Clients can specify any optional field to
// partially filter for specific relationships.
//
// Example use cases (namespace is always required):
// - object only: display a list of all permissions referring to a specific object
// - relation only: get all groups that have members; get all directories that have content
// - object & relation: display all subjects that have a specific permission relation
// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to
// - object & relation & subject: check whether the relation tuple already exists
type RelationQuery struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The namespace this relation tuple lives in.
Namespace *string `protobuf:"bytes,1,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
// The object related by this tuple.
// It is an object in the namespace of the tuple.
Object *string `protobuf:"bytes,2,opt,name=object,proto3,oneof" json:"object,omitempty"`
// The relation between an Object and a Subject.
Relation *string `protobuf:"bytes,3,opt,name=relation,proto3,oneof" json:"relation,omitempty"`
// The subject related by this tuple.
// A Subject either represents a concrete subject id or
// a `SubjectSet` that expands to more Subjects.
Subject *Subject `protobuf:"bytes,4,opt,name=subject,proto3,oneof" json:"subject,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RelationQuery) Reset() {
*x = RelationQuery{}
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RelationQuery) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RelationQuery) ProtoMessage() {}
func (x *RelationQuery) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RelationQuery.ProtoReflect.Descriptor instead.
func (*RelationQuery) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescGZIP(), []int{1}
}
func (x *RelationQuery) GetNamespace() string {
if x != nil && x.Namespace != nil {
return *x.Namespace
}
return ""
}
func (x *RelationQuery) GetObject() string {
if x != nil && x.Object != nil {
return *x.Object
}
return ""
}
func (x *RelationQuery) GetRelation() string {
if x != nil && x.Relation != nil {
return *x.Relation
}
return ""
}
func (x *RelationQuery) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
// Subject is either a concrete subject id or
// a `SubjectSet` expanding to more Subjects.
type Subject struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The reference of this abstract subject.
//
// Types that are valid to be assigned to Ref:
//
// *Subject_Id
// *Subject_Set
Ref isSubject_Ref `protobuf_oneof:"ref"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Subject) Reset() {
*x = Subject{}
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Subject) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Subject) ProtoMessage() {}
func (x *Subject) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Subject.ProtoReflect.Descriptor instead.
func (*Subject) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescGZIP(), []int{2}
}
func (x *Subject) GetRef() isSubject_Ref {
if x != nil {
return x.Ref
}
return nil
}
func (x *Subject) GetId() string {
if x != nil {
if x, ok := x.Ref.(*Subject_Id); ok {
return x.Id
}
}
return ""
}
func (x *Subject) GetSet() *SubjectSet {
if x != nil {
if x, ok := x.Ref.(*Subject_Set); ok {
return x.Set
}
}
return nil
}
type isSubject_Ref interface {
isSubject_Ref()
}
type Subject_Id struct {
// A concrete id of the subject.
Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
}
type Subject_Set struct {
// A subject set that expands to more Subjects.
// More information are available under [concepts](../concepts/15_subjects.mdx).
Set *SubjectSet `protobuf:"bytes,2,opt,name=set,proto3,oneof"`
}
func (*Subject_Id) isSubject_Ref() {}
func (*Subject_Set) isSubject_Ref() {}
// SubjectSet refers to all subjects who have
// the same `relation` on an `object`.
type SubjectSet struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The namespace of the object and relation
// referenced in this subject set.
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
// The object related by this subject set.
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
// The relation between the object and the subjects.
Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SubjectSet) Reset() {
*x = SubjectSet{}
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SubjectSet) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubjectSet) ProtoMessage() {}
func (x *SubjectSet) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubjectSet.ProtoReflect.Descriptor instead.
func (*SubjectSet) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescGZIP(), []int{3}
}
func (x *SubjectSet) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *SubjectSet) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *SubjectSet) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
var File_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDesc = "" +
"\n" +
"7ory/keto/relation_tuples/v1alpha2/relation_tuples.proto\x12!ory.keto.relation_tuples.v1alpha2\"\xa7\x01\n" +
"\rRelationTuple\x12\x1c\n" +
"\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x16\n" +
"\x06object\x18\x02 \x01(\tR\x06object\x12\x1a\n" +
"\brelation\x18\x03 \x01(\tR\brelation\x12D\n" +
"\asubject\x18\x04 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectR\asubject\"\xed\x01\n" +
"\rRelationQuery\x12!\n" +
"\tnamespace\x18\x01 \x01(\tH\x00R\tnamespace\x88\x01\x01\x12\x1b\n" +
"\x06object\x18\x02 \x01(\tH\x01R\x06object\x88\x01\x01\x12\x1f\n" +
"\brelation\x18\x03 \x01(\tH\x02R\brelation\x88\x01\x01\x12I\n" +
"\asubject\x18\x04 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectH\x03R\asubject\x88\x01\x01B\f\n" +
"\n" +
"_namespaceB\t\n" +
"\a_objectB\v\n" +
"\t_relationB\n" +
"\n" +
"\b_subject\"e\n" +
"\aSubject\x12\x10\n" +
"\x02id\x18\x01 \x01(\tH\x00R\x02id\x12A\n" +
"\x03set\x18\x02 \x01(\v2-.ory.keto.relation_tuples.v1alpha2.SubjectSetH\x00R\x03setB\x05\n" +
"\x03ref\"^\n" +
"\n" +
"SubjectSet\x12\x1c\n" +
"\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x16\n" +
"\x06object\x18\x02 \x01(\tR\x06object\x12\x1a\n" +
"\brelation\x18\x03 \x01(\tR\brelationB\xac\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x13RelationTuplesProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_goTypes = []any{
(*RelationTuple)(nil), // 0: ory.keto.relation_tuples.v1alpha2.RelationTuple
(*RelationQuery)(nil), // 1: ory.keto.relation_tuples.v1alpha2.RelationQuery
(*Subject)(nil), // 2: ory.keto.relation_tuples.v1alpha2.Subject
(*SubjectSet)(nil), // 3: ory.keto.relation_tuples.v1alpha2.SubjectSet
}
var file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_depIdxs = []int32{
2, // 0: ory.keto.relation_tuples.v1alpha2.RelationTuple.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
2, // 1: ory.keto.relation_tuples.v1alpha2.RelationQuery.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
3, // 2: ory.keto.relation_tuples.v1alpha2.Subject.set:type_name -> ory.keto.relation_tuples.v1alpha2.SubjectSet
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto != nil {
return
}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1].OneofWrappers = []any{}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2].OneofWrappers = []any{
(*Subject_Id)(nil),
(*Subject_Set)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_depIdxs,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_depIdxs = nil
}

View File

@@ -0,0 +1,142 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/check_service.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// CheckServiceName is the fully-qualified name of the CheckService service.
CheckServiceName = "ory.keto.relation_tuples.v1alpha2.CheckService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// CheckServiceCheckProcedure is the fully-qualified name of the CheckService's Check RPC.
CheckServiceCheckProcedure = "/ory.keto.relation_tuples.v1alpha2.CheckService/Check"
// CheckServiceBatchCheckProcedure is the fully-qualified name of the CheckService's BatchCheck RPC.
CheckServiceBatchCheckProcedure = "/ory.keto.relation_tuples.v1alpha2.CheckService/BatchCheck"
)
// CheckServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.CheckService service.
type CheckServiceClient interface {
// Performs an authorization check.
Check(context.Context, *connect.Request[v1alpha2.CheckRequest]) (*connect.Response[v1alpha2.CheckResponse], error)
BatchCheck(context.Context, *connect.Request[v1alpha2.BatchCheckRequest]) (*connect.Response[v1alpha2.BatchCheckResponse], error)
}
// NewCheckServiceClient constructs a client for the ory.keto.relation_tuples.v1alpha2.CheckService
// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for
// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply
// the connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewCheckServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CheckServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
checkServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_check_service_proto.Services().ByName("CheckService").Methods()
return &checkServiceClient{
check: connect.NewClient[v1alpha2.CheckRequest, v1alpha2.CheckResponse](
httpClient,
baseURL+CheckServiceCheckProcedure,
connect.WithSchema(checkServiceMethods.ByName("Check")),
connect.WithClientOptions(opts...),
),
batchCheck: connect.NewClient[v1alpha2.BatchCheckRequest, v1alpha2.BatchCheckResponse](
httpClient,
baseURL+CheckServiceBatchCheckProcedure,
connect.WithSchema(checkServiceMethods.ByName("BatchCheck")),
connect.WithClientOptions(opts...),
),
}
}
// checkServiceClient implements CheckServiceClient.
type checkServiceClient struct {
check *connect.Client[v1alpha2.CheckRequest, v1alpha2.CheckResponse]
batchCheck *connect.Client[v1alpha2.BatchCheckRequest, v1alpha2.BatchCheckResponse]
}
// Check calls ory.keto.relation_tuples.v1alpha2.CheckService.Check.
func (c *checkServiceClient) Check(ctx context.Context, req *connect.Request[v1alpha2.CheckRequest]) (*connect.Response[v1alpha2.CheckResponse], error) {
return c.check.CallUnary(ctx, req)
}
// BatchCheck calls ory.keto.relation_tuples.v1alpha2.CheckService.BatchCheck.
func (c *checkServiceClient) BatchCheck(ctx context.Context, req *connect.Request[v1alpha2.BatchCheckRequest]) (*connect.Response[v1alpha2.BatchCheckResponse], error) {
return c.batchCheck.CallUnary(ctx, req)
}
// CheckServiceHandler is an implementation of the ory.keto.relation_tuples.v1alpha2.CheckService
// service.
type CheckServiceHandler interface {
// Performs an authorization check.
Check(context.Context, *connect.Request[v1alpha2.CheckRequest]) (*connect.Response[v1alpha2.CheckResponse], error)
BatchCheck(context.Context, *connect.Request[v1alpha2.BatchCheckRequest]) (*connect.Response[v1alpha2.BatchCheckResponse], error)
}
// NewCheckServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewCheckServiceHandler(svc CheckServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
checkServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_check_service_proto.Services().ByName("CheckService").Methods()
checkServiceCheckHandler := connect.NewUnaryHandler(
CheckServiceCheckProcedure,
svc.Check,
connect.WithSchema(checkServiceMethods.ByName("Check")),
connect.WithHandlerOptions(opts...),
)
checkServiceBatchCheckHandler := connect.NewUnaryHandler(
CheckServiceBatchCheckProcedure,
svc.BatchCheck,
connect.WithSchema(checkServiceMethods.ByName("BatchCheck")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.CheckService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case CheckServiceCheckProcedure:
checkServiceCheckHandler.ServeHTTP(w, r)
case CheckServiceBatchCheckProcedure:
checkServiceBatchCheckHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedCheckServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedCheckServiceHandler struct{}
func (UnimplementedCheckServiceHandler) Check(context.Context, *connect.Request[v1alpha2.CheckRequest]) (*connect.Response[v1alpha2.CheckResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.CheckService.Check is not implemented"))
}
func (UnimplementedCheckServiceHandler) BatchCheck(context.Context, *connect.Request[v1alpha2.BatchCheckRequest]) (*connect.Response[v1alpha2.BatchCheckResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.CheckService.BatchCheck is not implemented"))
}

View File

@@ -0,0 +1,115 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/expand_service.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// ExpandServiceName is the fully-qualified name of the ExpandService service.
ExpandServiceName = "ory.keto.relation_tuples.v1alpha2.ExpandService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// ExpandServiceExpandProcedure is the fully-qualified name of the ExpandService's Expand RPC.
ExpandServiceExpandProcedure = "/ory.keto.relation_tuples.v1alpha2.ExpandService/Expand"
)
// ExpandServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.ExpandService service.
type ExpandServiceClient interface {
// Expands the subject set into a tree of subjects.
Expand(context.Context, *connect.Request[v1alpha2.ExpandRequest]) (*connect.Response[v1alpha2.ExpandResponse], error)
}
// NewExpandServiceClient constructs a client for the
// ory.keto.relation_tuples.v1alpha2.ExpandService service. By default, it uses the Connect protocol
// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To
// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()
// options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewExpandServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ExpandServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
expandServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_expand_service_proto.Services().ByName("ExpandService").Methods()
return &expandServiceClient{
expand: connect.NewClient[v1alpha2.ExpandRequest, v1alpha2.ExpandResponse](
httpClient,
baseURL+ExpandServiceExpandProcedure,
connect.WithSchema(expandServiceMethods.ByName("Expand")),
connect.WithClientOptions(opts...),
),
}
}
// expandServiceClient implements ExpandServiceClient.
type expandServiceClient struct {
expand *connect.Client[v1alpha2.ExpandRequest, v1alpha2.ExpandResponse]
}
// Expand calls ory.keto.relation_tuples.v1alpha2.ExpandService.Expand.
func (c *expandServiceClient) Expand(ctx context.Context, req *connect.Request[v1alpha2.ExpandRequest]) (*connect.Response[v1alpha2.ExpandResponse], error) {
return c.expand.CallUnary(ctx, req)
}
// ExpandServiceHandler is an implementation of the ory.keto.relation_tuples.v1alpha2.ExpandService
// service.
type ExpandServiceHandler interface {
// Expands the subject set into a tree of subjects.
Expand(context.Context, *connect.Request[v1alpha2.ExpandRequest]) (*connect.Response[v1alpha2.ExpandResponse], error)
}
// NewExpandServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewExpandServiceHandler(svc ExpandServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
expandServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_expand_service_proto.Services().ByName("ExpandService").Methods()
expandServiceExpandHandler := connect.NewUnaryHandler(
ExpandServiceExpandProcedure,
svc.Expand,
connect.WithSchema(expandServiceMethods.ByName("Expand")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.ExpandService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case ExpandServiceExpandProcedure:
expandServiceExpandHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedExpandServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedExpandServiceHandler struct{}
func (UnimplementedExpandServiceHandler) Expand(context.Context, *connect.Request[v1alpha2.ExpandRequest]) (*connect.Response[v1alpha2.ExpandResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.ExpandService.Expand is not implemented"))
}

View File

@@ -0,0 +1,117 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/namespaces_service.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// NamespacesServiceName is the fully-qualified name of the NamespacesService service.
NamespacesServiceName = "ory.keto.relation_tuples.v1alpha2.NamespacesService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// NamespacesServiceListNamespacesProcedure is the fully-qualified name of the NamespacesService's
// ListNamespaces RPC.
NamespacesServiceListNamespacesProcedure = "/ory.keto.relation_tuples.v1alpha2.NamespacesService/ListNamespaces"
)
// NamespacesServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.NamespacesService
// service.
type NamespacesServiceClient interface {
// Lists Namespaces
ListNamespaces(context.Context, *connect.Request[v1alpha2.ListNamespacesRequest]) (*connect.Response[v1alpha2.ListNamespacesResponse], error)
}
// NewNamespacesServiceClient constructs a client for the
// ory.keto.relation_tuples.v1alpha2.NamespacesService service. By default, it uses the Connect
// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed
// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewNamespacesServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) NamespacesServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
namespacesServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto.Services().ByName("NamespacesService").Methods()
return &namespacesServiceClient{
listNamespaces: connect.NewClient[v1alpha2.ListNamespacesRequest, v1alpha2.ListNamespacesResponse](
httpClient,
baseURL+NamespacesServiceListNamespacesProcedure,
connect.WithSchema(namespacesServiceMethods.ByName("ListNamespaces")),
connect.WithClientOptions(opts...),
),
}
}
// namespacesServiceClient implements NamespacesServiceClient.
type namespacesServiceClient struct {
listNamespaces *connect.Client[v1alpha2.ListNamespacesRequest, v1alpha2.ListNamespacesResponse]
}
// ListNamespaces calls ory.keto.relation_tuples.v1alpha2.NamespacesService.ListNamespaces.
func (c *namespacesServiceClient) ListNamespaces(ctx context.Context, req *connect.Request[v1alpha2.ListNamespacesRequest]) (*connect.Response[v1alpha2.ListNamespacesResponse], error) {
return c.listNamespaces.CallUnary(ctx, req)
}
// NamespacesServiceHandler is an implementation of the
// ory.keto.relation_tuples.v1alpha2.NamespacesService service.
type NamespacesServiceHandler interface {
// Lists Namespaces
ListNamespaces(context.Context, *connect.Request[v1alpha2.ListNamespacesRequest]) (*connect.Response[v1alpha2.ListNamespacesResponse], error)
}
// NewNamespacesServiceHandler builds an HTTP handler from the service implementation. It returns
// the path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewNamespacesServiceHandler(svc NamespacesServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
namespacesServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto.Services().ByName("NamespacesService").Methods()
namespacesServiceListNamespacesHandler := connect.NewUnaryHandler(
NamespacesServiceListNamespacesProcedure,
svc.ListNamespaces,
connect.WithSchema(namespacesServiceMethods.ByName("ListNamespaces")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.NamespacesService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case NamespacesServiceListNamespacesProcedure:
namespacesServiceListNamespacesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedNamespacesServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedNamespacesServiceHandler struct{}
func (UnimplementedNamespacesServiceHandler) ListNamespaces(context.Context, *connect.Request[v1alpha2.ListNamespacesRequest]) (*connect.Response[v1alpha2.ListNamespacesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.NamespacesService.ListNamespaces is not implemented"))
}

View File

@@ -0,0 +1,115 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/read_service.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// ReadServiceName is the fully-qualified name of the ReadService service.
ReadServiceName = "ory.keto.relation_tuples.v1alpha2.ReadService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// ReadServiceListRelationTuplesProcedure is the fully-qualified name of the ReadService's
// ListRelationTuples RPC.
ReadServiceListRelationTuplesProcedure = "/ory.keto.relation_tuples.v1alpha2.ReadService/ListRelationTuples"
)
// ReadServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.ReadService service.
type ReadServiceClient interface {
// Lists ACL relationships.
ListRelationTuples(context.Context, *connect.Request[v1alpha2.ListRelationTuplesRequest]) (*connect.Response[v1alpha2.ListRelationTuplesResponse], error)
}
// NewReadServiceClient constructs a client for the ory.keto.relation_tuples.v1alpha2.ReadService
// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for
// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply
// the connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewReadServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ReadServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
readServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_read_service_proto.Services().ByName("ReadService").Methods()
return &readServiceClient{
listRelationTuples: connect.NewClient[v1alpha2.ListRelationTuplesRequest, v1alpha2.ListRelationTuplesResponse](
httpClient,
baseURL+ReadServiceListRelationTuplesProcedure,
connect.WithSchema(readServiceMethods.ByName("ListRelationTuples")),
connect.WithClientOptions(opts...),
),
}
}
// readServiceClient implements ReadServiceClient.
type readServiceClient struct {
listRelationTuples *connect.Client[v1alpha2.ListRelationTuplesRequest, v1alpha2.ListRelationTuplesResponse]
}
// ListRelationTuples calls ory.keto.relation_tuples.v1alpha2.ReadService.ListRelationTuples.
func (c *readServiceClient) ListRelationTuples(ctx context.Context, req *connect.Request[v1alpha2.ListRelationTuplesRequest]) (*connect.Response[v1alpha2.ListRelationTuplesResponse], error) {
return c.listRelationTuples.CallUnary(ctx, req)
}
// ReadServiceHandler is an implementation of the ory.keto.relation_tuples.v1alpha2.ReadService
// service.
type ReadServiceHandler interface {
// Lists ACL relationships.
ListRelationTuples(context.Context, *connect.Request[v1alpha2.ListRelationTuplesRequest]) (*connect.Response[v1alpha2.ListRelationTuplesResponse], error)
}
// NewReadServiceHandler builds an HTTP handler from the service implementation. It returns the path
// on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewReadServiceHandler(svc ReadServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
readServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_read_service_proto.Services().ByName("ReadService").Methods()
readServiceListRelationTuplesHandler := connect.NewUnaryHandler(
ReadServiceListRelationTuplesProcedure,
svc.ListRelationTuples,
connect.WithSchema(readServiceMethods.ByName("ListRelationTuples")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.ReadService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case ReadServiceListRelationTuplesProcedure:
readServiceListRelationTuplesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedReadServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedReadServiceHandler struct{}
func (UnimplementedReadServiceHandler) ListRelationTuples(context.Context, *connect.Request[v1alpha2.ListRelationTuplesRequest]) (*connect.Response[v1alpha2.ListRelationTuplesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.ReadService.ListRelationTuples is not implemented"))
}

View File

@@ -0,0 +1,117 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/version.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// VersionServiceName is the fully-qualified name of the VersionService service.
VersionServiceName = "ory.keto.relation_tuples.v1alpha2.VersionService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// VersionServiceGetVersionProcedure is the fully-qualified name of the VersionService's GetVersion
// RPC.
VersionServiceGetVersionProcedure = "/ory.keto.relation_tuples.v1alpha2.VersionService/GetVersion"
)
// VersionServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.VersionService
// service.
type VersionServiceClient interface {
// Returns the version of the Ory Keto instance.
GetVersion(context.Context, *connect.Request[v1alpha2.GetVersionRequest]) (*connect.Response[v1alpha2.GetVersionResponse], error)
}
// NewVersionServiceClient constructs a client for the
// ory.keto.relation_tuples.v1alpha2.VersionService service. By default, it uses the Connect
// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed
// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewVersionServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VersionServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
versionServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_version_proto.Services().ByName("VersionService").Methods()
return &versionServiceClient{
getVersion: connect.NewClient[v1alpha2.GetVersionRequest, v1alpha2.GetVersionResponse](
httpClient,
baseURL+VersionServiceGetVersionProcedure,
connect.WithSchema(versionServiceMethods.ByName("GetVersion")),
connect.WithClientOptions(opts...),
),
}
}
// versionServiceClient implements VersionServiceClient.
type versionServiceClient struct {
getVersion *connect.Client[v1alpha2.GetVersionRequest, v1alpha2.GetVersionResponse]
}
// GetVersion calls ory.keto.relation_tuples.v1alpha2.VersionService.GetVersion.
func (c *versionServiceClient) GetVersion(ctx context.Context, req *connect.Request[v1alpha2.GetVersionRequest]) (*connect.Response[v1alpha2.GetVersionResponse], error) {
return c.getVersion.CallUnary(ctx, req)
}
// VersionServiceHandler is an implementation of the
// ory.keto.relation_tuples.v1alpha2.VersionService service.
type VersionServiceHandler interface {
// Returns the version of the Ory Keto instance.
GetVersion(context.Context, *connect.Request[v1alpha2.GetVersionRequest]) (*connect.Response[v1alpha2.GetVersionResponse], error)
}
// NewVersionServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewVersionServiceHandler(svc VersionServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
versionServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_version_proto.Services().ByName("VersionService").Methods()
versionServiceGetVersionHandler := connect.NewUnaryHandler(
VersionServiceGetVersionProcedure,
svc.GetVersion,
connect.WithSchema(versionServiceMethods.ByName("GetVersion")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.VersionService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case VersionServiceGetVersionProcedure:
versionServiceGetVersionHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedVersionServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedVersionServiceHandler struct{}
func (UnimplementedVersionServiceHandler) GetVersion(context.Context, *connect.Request[v1alpha2.GetVersionRequest]) (*connect.Response[v1alpha2.GetVersionResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.VersionService.GetVersion is not implemented"))
}

View File

@@ -0,0 +1,147 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: ory/keto/relation_tuples/v1alpha2/write_service.proto
package relationtuplesconnect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1alpha2 "github.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// WriteServiceName is the fully-qualified name of the WriteService service.
WriteServiceName = "ory.keto.relation_tuples.v1alpha2.WriteService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// WriteServiceTransactRelationTuplesProcedure is the fully-qualified name of the WriteService's
// TransactRelationTuples RPC.
WriteServiceTransactRelationTuplesProcedure = "/ory.keto.relation_tuples.v1alpha2.WriteService/TransactRelationTuples"
// WriteServiceDeleteRelationTuplesProcedure is the fully-qualified name of the WriteService's
// DeleteRelationTuples RPC.
WriteServiceDeleteRelationTuplesProcedure = "/ory.keto.relation_tuples.v1alpha2.WriteService/DeleteRelationTuples"
)
// WriteServiceClient is a client for the ory.keto.relation_tuples.v1alpha2.WriteService service.
type WriteServiceClient interface {
// Writes one or more relationships in a single transaction.
TransactRelationTuples(context.Context, *connect.Request[v1alpha2.TransactRelationTuplesRequest]) (*connect.Response[v1alpha2.TransactRelationTuplesResponse], error)
// Deletes relationships based on relation query
DeleteRelationTuples(context.Context, *connect.Request[v1alpha2.DeleteRelationTuplesRequest]) (*connect.Response[v1alpha2.DeleteRelationTuplesResponse], error)
}
// NewWriteServiceClient constructs a client for the ory.keto.relation_tuples.v1alpha2.WriteService
// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for
// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply
// the connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewWriteServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WriteServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
writeServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_write_service_proto.Services().ByName("WriteService").Methods()
return &writeServiceClient{
transactRelationTuples: connect.NewClient[v1alpha2.TransactRelationTuplesRequest, v1alpha2.TransactRelationTuplesResponse](
httpClient,
baseURL+WriteServiceTransactRelationTuplesProcedure,
connect.WithSchema(writeServiceMethods.ByName("TransactRelationTuples")),
connect.WithClientOptions(opts...),
),
deleteRelationTuples: connect.NewClient[v1alpha2.DeleteRelationTuplesRequest, v1alpha2.DeleteRelationTuplesResponse](
httpClient,
baseURL+WriteServiceDeleteRelationTuplesProcedure,
connect.WithSchema(writeServiceMethods.ByName("DeleteRelationTuples")),
connect.WithClientOptions(opts...),
),
}
}
// writeServiceClient implements WriteServiceClient.
type writeServiceClient struct {
transactRelationTuples *connect.Client[v1alpha2.TransactRelationTuplesRequest, v1alpha2.TransactRelationTuplesResponse]
deleteRelationTuples *connect.Client[v1alpha2.DeleteRelationTuplesRequest, v1alpha2.DeleteRelationTuplesResponse]
}
// TransactRelationTuples calls
// ory.keto.relation_tuples.v1alpha2.WriteService.TransactRelationTuples.
func (c *writeServiceClient) TransactRelationTuples(ctx context.Context, req *connect.Request[v1alpha2.TransactRelationTuplesRequest]) (*connect.Response[v1alpha2.TransactRelationTuplesResponse], error) {
return c.transactRelationTuples.CallUnary(ctx, req)
}
// DeleteRelationTuples calls ory.keto.relation_tuples.v1alpha2.WriteService.DeleteRelationTuples.
func (c *writeServiceClient) DeleteRelationTuples(ctx context.Context, req *connect.Request[v1alpha2.DeleteRelationTuplesRequest]) (*connect.Response[v1alpha2.DeleteRelationTuplesResponse], error) {
return c.deleteRelationTuples.CallUnary(ctx, req)
}
// WriteServiceHandler is an implementation of the ory.keto.relation_tuples.v1alpha2.WriteService
// service.
type WriteServiceHandler interface {
// Writes one or more relationships in a single transaction.
TransactRelationTuples(context.Context, *connect.Request[v1alpha2.TransactRelationTuplesRequest]) (*connect.Response[v1alpha2.TransactRelationTuplesResponse], error)
// Deletes relationships based on relation query
DeleteRelationTuples(context.Context, *connect.Request[v1alpha2.DeleteRelationTuplesRequest]) (*connect.Response[v1alpha2.DeleteRelationTuplesResponse], error)
}
// NewWriteServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewWriteServiceHandler(svc WriteServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
writeServiceMethods := v1alpha2.File_ory_keto_relation_tuples_v1alpha2_write_service_proto.Services().ByName("WriteService").Methods()
writeServiceTransactRelationTuplesHandler := connect.NewUnaryHandler(
WriteServiceTransactRelationTuplesProcedure,
svc.TransactRelationTuples,
connect.WithSchema(writeServiceMethods.ByName("TransactRelationTuples")),
connect.WithHandlerOptions(opts...),
)
writeServiceDeleteRelationTuplesHandler := connect.NewUnaryHandler(
WriteServiceDeleteRelationTuplesProcedure,
svc.DeleteRelationTuples,
connect.WithSchema(writeServiceMethods.ByName("DeleteRelationTuples")),
connect.WithHandlerOptions(opts...),
)
return "/ory.keto.relation_tuples.v1alpha2.WriteService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case WriteServiceTransactRelationTuplesProcedure:
writeServiceTransactRelationTuplesHandler.ServeHTTP(w, r)
case WriteServiceDeleteRelationTuplesProcedure:
writeServiceDeleteRelationTuplesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedWriteServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedWriteServiceHandler struct{}
func (UnimplementedWriteServiceHandler) TransactRelationTuples(context.Context, *connect.Request[v1alpha2.TransactRelationTuplesRequest]) (*connect.Response[v1alpha2.TransactRelationTuplesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.WriteService.TransactRelationTuples is not implemented"))
}
func (UnimplementedWriteServiceHandler) DeleteRelationTuples(context.Context, *connect.Request[v1alpha2.DeleteRelationTuplesRequest]) (*connect.Response[v1alpha2.DeleteRelationTuplesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ory.keto.relation_tuples.v1alpha2.WriteService.DeleteRelationTuples is not implemented"))
}

View File

@@ -0,0 +1,36 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package relationtuples
// RelationTupleToDeltas is a helper that converts a slice of RelationTuple to a slice of RelationTupleDelta
// with the specified RelationTupleDelta_Action. This allows you to conveniently assemble a request for the
// WriteServiceClient.TransactRelationTuples operation.
//
// Example:
//
// c.TransactRelationTuples(context.Background(), &rts.TransactRelationTuplesRequest{
// RelationTupleDeltas: append(rts.RelationTupleToDeltas(insertTuples, rts.RelationTupleDelta_ACTION_INSERT), rts.RelationTupleToDeltas(deleteTuples, rts.RelationTupleDelta_ACTION_DELETE)...),
// })
func RelationTupleToDeltas(rs []*RelationTuple, action RelationTupleDelta_Action) []*RelationTupleDelta {
deltas := make([]*RelationTupleDelta, len(rs))
for i := range rs {
deltas[i] = &RelationTupleDelta{
RelationTuple: rs[i],
Action: action,
}
}
return deltas
}
// NewSubjectSet returns a Subject with a SubjectSet ref.
func NewSubjectSet(namespace, object, relation string) *Subject {
return &Subject{Ref: &Subject_Set{Set: &SubjectSet{
Namespace: namespace,
Object: object,
Relation: relation,
}}}
}
// NewSubjectID returns a Subject with a subject ID ref.
func NewSubjectID(id string) *Subject { return &Subject{Ref: &Subject_Id{Id: id}} }

View File

@@ -0,0 +1,67 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package relationtuples
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRelationTupleToDeltas(t *testing.T) {
for _, tc := range []struct {
desc string
rts []*RelationTuple
action RelationTupleDelta_Action
expected []*RelationTupleDelta
}{
{
desc: "empty list",
rts: nil,
action: RelationTupleDelta_ACTION_INSERT,
expected: []*RelationTupleDelta{},
},
{
desc: "some tuples",
rts: []*RelationTuple{
{
Namespace: "n",
Object: "o1",
Relation: "r",
Subject: NewSubjectID("s"),
}, {
Namespace: "n",
Object: "o2",
Relation: "r",
Subject: NewSubjectSet("sn", "so", "sr"),
},
},
action: RelationTupleDelta_ACTION_DELETE,
expected: []*RelationTupleDelta{
{
RelationTuple: &RelationTuple{
Namespace: "n",
Object: "o1",
Relation: "r",
Subject: NewSubjectID("s"),
},
Action: RelationTupleDelta_ACTION_DELETE,
},
{
RelationTuple: &RelationTuple{
Namespace: "n",
Object: "o2",
Relation: "r",
Subject: NewSubjectSet("sn", "so", "sr"),
},
Action: RelationTupleDelta_ACTION_DELETE,
},
},
},
} {
t.Run("case="+tc.desc, func(t *testing.T) {
assert.Equal(t, tc.expected, RelationTupleToDeltas(tc.rts, tc.action))
})
}
}

View File

@@ -0,0 +1,172 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/version.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Request for the VersionService.GetVersion RPC.
type GetVersionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetVersionRequest) Reset() {
*x = GetVersionRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetVersionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetVersionRequest) ProtoMessage() {}
func (x *GetVersionRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetVersionRequest.ProtoReflect.Descriptor instead.
func (*GetVersionRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescGZIP(), []int{0}
}
// Response of the VersionService.GetVersion RPC.
type GetVersionResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The version string of the Ory Keto instance.
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetVersionResponse) Reset() {
*x = GetVersionResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetVersionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetVersionResponse) ProtoMessage() {}
func (x *GetVersionResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetVersionResponse.ProtoReflect.Descriptor instead.
func (*GetVersionResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescGZIP(), []int{1}
}
func (x *GetVersionResponse) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
var File_ory_keto_relation_tuples_v1alpha2_version_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDesc = "" +
"\n" +
"/ory/keto/relation_tuples/v1alpha2/version.proto\x12!ory.keto.relation_tuples.v1alpha2\"\x13\n" +
"\x11GetVersionRequest\".\n" +
"\x12GetVersionResponse\x12\x18\n" +
"\aversion\x18\x01 \x01(\tR\aversion2\x8b\x01\n" +
"\x0eVersionService\x12y\n" +
"\n" +
"GetVersion\x124.ory.keto.relation_tuples.v1alpha2.GetVersionRequest\x1a5.ory.keto.relation_tuples.v1alpha2.GetVersionResponseB\xa5\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\fVersionProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_ory_keto_relation_tuples_v1alpha2_version_proto_goTypes = []any{
(*GetVersionRequest)(nil), // 0: ory.keto.relation_tuples.v1alpha2.GetVersionRequest
(*GetVersionResponse)(nil), // 1: ory.keto.relation_tuples.v1alpha2.GetVersionResponse
}
var file_ory_keto_relation_tuples_v1alpha2_version_proto_depIdxs = []int32{
0, // 0: ory.keto.relation_tuples.v1alpha2.VersionService.GetVersion:input_type -> ory.keto.relation_tuples.v1alpha2.GetVersionRequest
1, // 1: ory.keto.relation_tuples.v1alpha2.VersionService.GetVersion:output_type -> ory.keto.relation_tuples.v1alpha2.GetVersionResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_version_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_version_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_version_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_version_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_version_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_version_proto_depIdxs,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_version_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_version_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_version_proto_depIdxs = nil
}

View File

@@ -0,0 +1,134 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/version.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
VersionService_GetVersion_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.VersionService/GetVersion"
)
// VersionServiceClient is the client API for VersionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The service returning the specific Ory Keto instance version.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis) and [write-APIs](../concepts/25_api-overview.mdx#write-apis).
type VersionServiceClient interface {
// Returns the version of the Ory Keto instance.
GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error)
}
type versionServiceClient struct {
cc grpc.ClientConnInterface
}
func NewVersionServiceClient(cc grpc.ClientConnInterface) VersionServiceClient {
return &versionServiceClient{cc}
}
func (c *versionServiceClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetVersionResponse)
err := c.cc.Invoke(ctx, VersionService_GetVersion_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// VersionServiceServer is the server API for VersionService service.
// All implementations must embed UnimplementedVersionServiceServer
// for forward compatibility.
//
// The service returning the specific Ory Keto instance version.
//
// This service is part of the [read-APIs](../concepts/25_api-overview.mdx#read-apis) and [write-APIs](../concepts/25_api-overview.mdx#write-apis).
type VersionServiceServer interface {
// Returns the version of the Ory Keto instance.
GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error)
mustEmbedUnimplementedVersionServiceServer()
}
// UnimplementedVersionServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedVersionServiceServer struct{}
func (UnimplementedVersionServiceServer) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetVersion not implemented")
}
func (UnimplementedVersionServiceServer) mustEmbedUnimplementedVersionServiceServer() {}
func (UnimplementedVersionServiceServer) testEmbeddedByValue() {}
// UnsafeVersionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to VersionServiceServer will
// result in compilation errors.
type UnsafeVersionServiceServer interface {
mustEmbedUnimplementedVersionServiceServer()
}
func RegisterVersionServiceServer(s grpc.ServiceRegistrar, srv VersionServiceServer) {
// If the following call panics, it indicates UnimplementedVersionServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&VersionService_ServiceDesc, srv)
}
func _VersionService_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VersionServiceServer).GetVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VersionService_GetVersion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VersionServiceServer).GetVersion(ctx, req.(*GetVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
// VersionService_ServiceDesc is the grpc.ServiceDesc for VersionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var VersionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.VersionService",
HandlerType: (*VersionServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetVersion",
Handler: _VersionService_GetVersion_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/version.proto",
}

View File

@@ -0,0 +1,501 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/write_service.proto
package relationtuples
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type RelationTupleDelta_Action int32
const (
// Unspecified.
// The `TransactRelationTuples` RPC ignores this
// RelationTupleDelta if an action was unspecified.
RelationTupleDelta_ACTION_UNSPECIFIED RelationTupleDelta_Action = 0
// Insertion of a new RelationTuple.
RelationTupleDelta_ACTION_INSERT RelationTupleDelta_Action = 1
// Deletion of the RelationTuple.
// It is ignored if it does not exist.
RelationTupleDelta_ACTION_DELETE RelationTupleDelta_Action = 2
)
// Enum value maps for RelationTupleDelta_Action.
var (
RelationTupleDelta_Action_name = map[int32]string{
0: "ACTION_UNSPECIFIED",
1: "ACTION_INSERT",
2: "ACTION_DELETE",
}
RelationTupleDelta_Action_value = map[string]int32{
"ACTION_UNSPECIFIED": 0,
"ACTION_INSERT": 1,
"ACTION_DELETE": 2,
}
)
func (x RelationTupleDelta_Action) Enum() *RelationTupleDelta_Action {
p := new(RelationTupleDelta_Action)
*p = x
return p
}
func (x RelationTupleDelta_Action) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (RelationTupleDelta_Action) Descriptor() protoreflect.EnumDescriptor {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_enumTypes[0].Descriptor()
}
func (RelationTupleDelta_Action) Type() protoreflect.EnumType {
return &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_enumTypes[0]
}
func (x RelationTupleDelta_Action) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use RelationTupleDelta_Action.Descriptor instead.
func (RelationTupleDelta_Action) EnumDescriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{1, 0}
}
// The request of a WriteService.TransactRelationTuples RPC.
type TransactRelationTuplesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The write delta for the relationships operated in one single transaction.
// Either all actions succeed or no change takes effect on error.
RelationTupleDeltas []*RelationTupleDelta `protobuf:"bytes,1,rep,name=relation_tuple_deltas,json=relationTupleDeltas,proto3" json:"relation_tuple_deltas,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TransactRelationTuplesRequest) Reset() {
*x = TransactRelationTuplesRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TransactRelationTuplesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransactRelationTuplesRequest) ProtoMessage() {}
func (x *TransactRelationTuplesRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TransactRelationTuplesRequest.ProtoReflect.Descriptor instead.
func (*TransactRelationTuplesRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{0}
}
func (x *TransactRelationTuplesRequest) GetRelationTupleDeltas() []*RelationTupleDelta {
if x != nil {
return x.RelationTupleDeltas
}
return nil
}
// Write-delta for a TransactRelationTuplesRequest.
type RelationTupleDelta struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The action to do on the RelationTuple.
Action RelationTupleDelta_Action `protobuf:"varint,1,opt,name=action,proto3,enum=ory.keto.relation_tuples.v1alpha2.RelationTupleDelta_Action" json:"action,omitempty"`
// The target RelationTuple.
RelationTuple *RelationTuple `protobuf:"bytes,2,opt,name=relation_tuple,json=relationTuple,proto3" json:"relation_tuple,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RelationTupleDelta) Reset() {
*x = RelationTupleDelta{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RelationTupleDelta) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RelationTupleDelta) ProtoMessage() {}
func (x *RelationTupleDelta) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RelationTupleDelta.ProtoReflect.Descriptor instead.
func (*RelationTupleDelta) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{1}
}
func (x *RelationTupleDelta) GetAction() RelationTupleDelta_Action {
if x != nil {
return x.Action
}
return RelationTupleDelta_ACTION_UNSPECIFIED
}
func (x *RelationTupleDelta) GetRelationTuple() *RelationTuple {
if x != nil {
return x.RelationTuple
}
return nil
}
// The response of a WriteService.TransactRelationTuples rpc.
type TransactRelationTuplesResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// This field is not implemented yet and has no effect.
// <!--
// The list of the new latest snapshot tokens of the affected RelationTuple,
// with the same index as specified in the `relation_tuple_deltas` field of
// the TransactRelationTuplesRequest request.
//
// If the RelationTupleDelta_Action was DELETE
// the snaptoken is empty at the same index.
// -->
Snaptokens []string `protobuf:"bytes,1,rep,name=snaptokens,proto3" json:"snaptokens,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TransactRelationTuplesResponse) Reset() {
*x = TransactRelationTuplesResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TransactRelationTuplesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransactRelationTuplesResponse) ProtoMessage() {}
func (x *TransactRelationTuplesResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TransactRelationTuplesResponse.ProtoReflect.Descriptor instead.
func (*TransactRelationTuplesResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{2}
}
func (x *TransactRelationTuplesResponse) GetSnaptokens() []string {
if x != nil {
return x.Snaptokens
}
return nil
}
type DeleteRelationTuplesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/write_service.proto.
Query *DeleteRelationTuplesRequest_Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
RelationQuery *RelationQuery `protobuf:"bytes,2,opt,name=relation_query,json=relationQuery,proto3" json:"relation_query,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteRelationTuplesRequest) Reset() {
*x = DeleteRelationTuplesRequest{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteRelationTuplesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRelationTuplesRequest) ProtoMessage() {}
func (x *DeleteRelationTuplesRequest) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteRelationTuplesRequest.ProtoReflect.Descriptor instead.
func (*DeleteRelationTuplesRequest) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{3}
}
// Deprecated: Marked as deprecated in ory/keto/relation_tuples/v1alpha2/write_service.proto.
func (x *DeleteRelationTuplesRequest) GetQuery() *DeleteRelationTuplesRequest_Query {
if x != nil {
return x.Query
}
return nil
}
func (x *DeleteRelationTuplesRequest) GetRelationQuery() *RelationQuery {
if x != nil {
return x.RelationQuery
}
return nil
}
type DeleteRelationTuplesResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteRelationTuplesResponse) Reset() {
*x = DeleteRelationTuplesResponse{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteRelationTuplesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRelationTuplesResponse) ProtoMessage() {}
func (x *DeleteRelationTuplesResponse) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteRelationTuplesResponse.ProtoReflect.Descriptor instead.
func (*DeleteRelationTuplesResponse) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{4}
}
// The query for deleting relationships
type DeleteRelationTuplesRequest_Query struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Optional. The namespace to query.
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
// Optional. The object to query for.
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
// Optional. The relation to query for.
Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"`
// Optional. The subject to query for.
Subject *Subject `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteRelationTuplesRequest_Query) Reset() {
*x = DeleteRelationTuplesRequest_Query{}
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteRelationTuplesRequest_Query) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRelationTuplesRequest_Query) ProtoMessage() {}
func (x *DeleteRelationTuplesRequest_Query) ProtoReflect() protoreflect.Message {
mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteRelationTuplesRequest_Query.ProtoReflect.Descriptor instead.
func (*DeleteRelationTuplesRequest_Query) Descriptor() ([]byte, []int) {
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP(), []int{3, 0}
}
func (x *DeleteRelationTuplesRequest_Query) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *DeleteRelationTuplesRequest_Query) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *DeleteRelationTuplesRequest_Query) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
func (x *DeleteRelationTuplesRequest_Query) GetSubject() *Subject {
if x != nil {
return x.Subject
}
return nil
}
var File_ory_keto_relation_tuples_v1alpha2_write_service_proto protoreflect.FileDescriptor
const file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDesc = "" +
"\n" +
"5ory/keto/relation_tuples/v1alpha2/write_service.proto\x12!ory.keto.relation_tuples.v1alpha2\x1a7ory/keto/relation_tuples/v1alpha2/relation_tuples.proto\"\x8a\x01\n" +
"\x1dTransactRelationTuplesRequest\x12i\n" +
"\x15relation_tuple_deltas\x18\x01 \x03(\v25.ory.keto.relation_tuples.v1alpha2.RelationTupleDeltaR\x13relationTupleDeltas\"\x8b\x02\n" +
"\x12RelationTupleDelta\x12T\n" +
"\x06action\x18\x01 \x01(\x0e2<.ory.keto.relation_tuples.v1alpha2.RelationTupleDelta.ActionR\x06action\x12W\n" +
"\x0erelation_tuple\x18\x02 \x01(\v20.ory.keto.relation_tuples.v1alpha2.RelationTupleR\rrelationTuple\"F\n" +
"\x06Action\x12\x16\n" +
"\x12ACTION_UNSPECIFIED\x10\x00\x12\x11\n" +
"\rACTION_INSERT\x10\x01\x12\x11\n" +
"\rACTION_DELETE\x10\x02\"@\n" +
"\x1eTransactRelationTuplesResponse\x12\x1e\n" +
"\n" +
"snaptokens\x18\x01 \x03(\tR\n" +
"snaptokens\"\xf8\x02\n" +
"\x1bDeleteRelationTuplesRequest\x12^\n" +
"\x05query\x18\x01 \x01(\v2D.ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.QueryB\x02\x18\x01R\x05query\x12W\n" +
"\x0erelation_query\x18\x02 \x01(\v20.ory.keto.relation_tuples.v1alpha2.RelationQueryR\rrelationQuery\x1a\x9f\x01\n" +
"\x05Query\x12\x1c\n" +
"\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x16\n" +
"\x06object\x18\x02 \x01(\tR\x06object\x12\x1a\n" +
"\brelation\x18\x03 \x01(\tR\brelation\x12D\n" +
"\asubject\x18\x04 \x01(\v2*.ory.keto.relation_tuples.v1alpha2.SubjectR\asubject\"\x1e\n" +
"\x1cDeleteRelationTuplesResponse2\xc8\x02\n" +
"\fWriteService\x12\x9d\x01\n" +
"\x16TransactRelationTuples\x12@.ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesRequest\x1aA.ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesResponse\x12\x97\x01\n" +
"\x14DeleteRelationTuples\x12>.ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest\x1a?.ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesResponseB\xaa\x02\n" +
"%com.ory.keto.relation_tuples.v1alpha2B\x11WriteServiceProtoP\x01ZKgithub.com/ory/keto/gen/go/ory/keto/relation_tuples/v1alpha2;relationtuples\xa2\x02\x03OKR\xaa\x02 Ory.Keto.RelationTuples.V1alpha2\xca\x02 Ory\\Keto\\RelationTuples\\V1alpha2\xe2\x02,Ory\\Keto\\RelationTuples\\V1alpha2\\GPBMetadata\xea\x02#Ory::Keto::RelationTuples::V1alpha2b\x06proto3"
var (
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescOnce sync.Once
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescData []byte
)
func file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescGZIP() []byte {
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescOnce.Do(func() {
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDesc)))
})
return file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDescData
}
var file_ory_keto_relation_tuples_v1alpha2_write_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_ory_keto_relation_tuples_v1alpha2_write_service_proto_goTypes = []any{
(RelationTupleDelta_Action)(0), // 0: ory.keto.relation_tuples.v1alpha2.RelationTupleDelta.Action
(*TransactRelationTuplesRequest)(nil), // 1: ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesRequest
(*RelationTupleDelta)(nil), // 2: ory.keto.relation_tuples.v1alpha2.RelationTupleDelta
(*TransactRelationTuplesResponse)(nil), // 3: ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesResponse
(*DeleteRelationTuplesRequest)(nil), // 4: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest
(*DeleteRelationTuplesResponse)(nil), // 5: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesResponse
(*DeleteRelationTuplesRequest_Query)(nil), // 6: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.Query
(*RelationTuple)(nil), // 7: ory.keto.relation_tuples.v1alpha2.RelationTuple
(*RelationQuery)(nil), // 8: ory.keto.relation_tuples.v1alpha2.RelationQuery
(*Subject)(nil), // 9: ory.keto.relation_tuples.v1alpha2.Subject
}
var file_ory_keto_relation_tuples_v1alpha2_write_service_proto_depIdxs = []int32{
2, // 0: ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesRequest.relation_tuple_deltas:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTupleDelta
0, // 1: ory.keto.relation_tuples.v1alpha2.RelationTupleDelta.action:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTupleDelta.Action
7, // 2: ory.keto.relation_tuples.v1alpha2.RelationTupleDelta.relation_tuple:type_name -> ory.keto.relation_tuples.v1alpha2.RelationTuple
6, // 3: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.query:type_name -> ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.Query
8, // 4: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.relation_query:type_name -> ory.keto.relation_tuples.v1alpha2.RelationQuery
9, // 5: ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest.Query.subject:type_name -> ory.keto.relation_tuples.v1alpha2.Subject
1, // 6: ory.keto.relation_tuples.v1alpha2.WriteService.TransactRelationTuples:input_type -> ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesRequest
4, // 7: ory.keto.relation_tuples.v1alpha2.WriteService.DeleteRelationTuples:input_type -> ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesRequest
3, // 8: ory.keto.relation_tuples.v1alpha2.WriteService.TransactRelationTuples:output_type -> ory.keto.relation_tuples.v1alpha2.TransactRelationTuplesResponse
5, // 9: ory.keto.relation_tuples.v1alpha2.WriteService.DeleteRelationTuples:output_type -> ory.keto.relation_tuples.v1alpha2.DeleteRelationTuplesResponse
8, // [8:10] is the sub-list for method output_type
6, // [6:8] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_ory_keto_relation_tuples_v1alpha2_write_service_proto_init() }
func file_ory_keto_relation_tuples_v1alpha2_write_service_proto_init() {
if File_ory_keto_relation_tuples_v1alpha2_write_service_proto != nil {
return
}
file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDesc), len(file_ory_keto_relation_tuples_v1alpha2_write_service_proto_rawDesc)),
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ory_keto_relation_tuples_v1alpha2_write_service_proto_goTypes,
DependencyIndexes: file_ory_keto_relation_tuples_v1alpha2_write_service_proto_depIdxs,
EnumInfos: file_ory_keto_relation_tuples_v1alpha2_write_service_proto_enumTypes,
MessageInfos: file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes,
}.Build()
File_ory_keto_relation_tuples_v1alpha2_write_service_proto = out.File
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_goTypes = nil
file_ory_keto_relation_tuples_v1alpha2_write_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,174 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: ory/keto/relation_tuples/v1alpha2/write_service.proto
package relationtuples
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
WriteService_TransactRelationTuples_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.WriteService/TransactRelationTuples"
WriteService_DeleteRelationTuples_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.WriteService/DeleteRelationTuples"
)
// WriteServiceClient is the client API for WriteService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// The write service to create and delete Access Control Lists.
//
// This service is part of the [write-APIs](../concepts/25_api-overview.mdx#write-apis).
type WriteServiceClient interface {
// Writes one or more relationships in a single transaction.
TransactRelationTuples(ctx context.Context, in *TransactRelationTuplesRequest, opts ...grpc.CallOption) (*TransactRelationTuplesResponse, error)
// Deletes relationships based on relation query
DeleteRelationTuples(ctx context.Context, in *DeleteRelationTuplesRequest, opts ...grpc.CallOption) (*DeleteRelationTuplesResponse, error)
}
type writeServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWriteServiceClient(cc grpc.ClientConnInterface) WriteServiceClient {
return &writeServiceClient{cc}
}
func (c *writeServiceClient) TransactRelationTuples(ctx context.Context, in *TransactRelationTuplesRequest, opts ...grpc.CallOption) (*TransactRelationTuplesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(TransactRelationTuplesResponse)
err := c.cc.Invoke(ctx, WriteService_TransactRelationTuples_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *writeServiceClient) DeleteRelationTuples(ctx context.Context, in *DeleteRelationTuplesRequest, opts ...grpc.CallOption) (*DeleteRelationTuplesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteRelationTuplesResponse)
err := c.cc.Invoke(ctx, WriteService_DeleteRelationTuples_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WriteServiceServer is the server API for WriteService service.
// All implementations must embed UnimplementedWriteServiceServer
// for forward compatibility.
//
// The write service to create and delete Access Control Lists.
//
// This service is part of the [write-APIs](../concepts/25_api-overview.mdx#write-apis).
type WriteServiceServer interface {
// Writes one or more relationships in a single transaction.
TransactRelationTuples(context.Context, *TransactRelationTuplesRequest) (*TransactRelationTuplesResponse, error)
// Deletes relationships based on relation query
DeleteRelationTuples(context.Context, *DeleteRelationTuplesRequest) (*DeleteRelationTuplesResponse, error)
mustEmbedUnimplementedWriteServiceServer()
}
// UnimplementedWriteServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedWriteServiceServer struct{}
func (UnimplementedWriteServiceServer) TransactRelationTuples(context.Context, *TransactRelationTuplesRequest) (*TransactRelationTuplesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method TransactRelationTuples not implemented")
}
func (UnimplementedWriteServiceServer) DeleteRelationTuples(context.Context, *DeleteRelationTuplesRequest) (*DeleteRelationTuplesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteRelationTuples not implemented")
}
func (UnimplementedWriteServiceServer) mustEmbedUnimplementedWriteServiceServer() {}
func (UnimplementedWriteServiceServer) testEmbeddedByValue() {}
// UnsafeWriteServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WriteServiceServer will
// result in compilation errors.
type UnsafeWriteServiceServer interface {
mustEmbedUnimplementedWriteServiceServer()
}
func RegisterWriteServiceServer(s grpc.ServiceRegistrar, srv WriteServiceServer) {
// If the following call panics, it indicates UnimplementedWriteServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&WriteService_ServiceDesc, srv)
}
func _WriteService_TransactRelationTuples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TransactRelationTuplesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WriteServiceServer).TransactRelationTuples(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WriteService_TransactRelationTuples_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WriteServiceServer).TransactRelationTuples(ctx, req.(*TransactRelationTuplesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WriteService_DeleteRelationTuples_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteRelationTuplesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WriteServiceServer).DeleteRelationTuples(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WriteService_DeleteRelationTuples_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WriteServiceServer).DeleteRelationTuples(ctx, req.(*DeleteRelationTuplesRequest))
}
return interceptor(ctx, in, info, handler)
}
// WriteService_ServiceDesc is the grpc.ServiceDesc for WriteService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WriteService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ory.keto.relation_tuples.v1alpha2.WriteService",
HandlerType: (*WriteServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "TransactRelationTuples",
Handler: _WriteService_TransactRelationTuples_Handler,
},
{
MethodName: "DeleteRelationTuples",
Handler: _WriteService_DeleteRelationTuples_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ory/keto/relation_tuples/v1alpha2/write_service.proto",
}