11syntax = "proto3" ;
22package authzed.api.v1 ;
33
4- option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1" ;
5- option java_package = "com.authzed.api.v1" ;
6- option java_multiple_files = true ;
7-
4+ import "authzed/api/v1/core.proto" ;
5+ import "authzed/api/v1/permission_service.proto" ;
6+ import "buf/validate/validate.proto" ;
87import "google/api/annotations.proto" ;
98import "validate/validate.proto" ;
10- import "buf/validate/validate.proto" ;
119
12- import "authzed/api/v1/core.proto" ;
13- import "authzed/api/v1/permission_service.proto" ;
10+ option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1" ;
11+ option java_multiple_files = true ;
12+ option java_package = "com.authzed.api.v1" ;
1413
1514// SchemaService implements operations on a Permissions System's Schema.
1615service SchemaService {
@@ -36,46 +35,42 @@ service SchemaService {
3635
3736 // ReflectSchema reflects the current schema stored in SpiceDB, returning a structural
3837 // form of the schema for use by client tooling.
39- rpc ReflectSchema (ReflectSchemaRequest )
40- returns (ReflectSchemaResponse ) {
41- option (google.api.http ) = {
42- post : "/v1/schema/reflectschema"
43- body : "*"
44- };
45- }
38+ rpc ReflectSchema (ReflectSchemaRequest ) returns (ReflectSchemaResponse ) {
39+ option (google.api.http ) = {
40+ post : "/v1/schema/reflectschema"
41+ body : "*"
42+ };
43+ }
4644
4745 // ComputablePermissions returns the set of permissions that compute based off a relation
4846 // in the current schema. For example, if the schema has a relation `viewer` and a permission
4947 // `view` defined as `permission view = viewer + editor`, then the
5048 // computable permissions for the relation `viewer` will include `view`.
51- rpc ComputablePermissions (ComputablePermissionsRequest )
52- returns (ComputablePermissionsResponse ) {
53- option (google.api.http ) = {
54- post : "/v1/schema/permissions/computable"
55- body : "*"
56- };
57- }
58-
49+ rpc ComputablePermissions (ComputablePermissionsRequest ) returns (ComputablePermissionsResponse ) {
50+ option (google.api.http ) = {
51+ post : "/v1/schema/permissions/computable"
52+ body : "*"
53+ };
54+ }
55+
5956 // DependentRelations returns the set of relations and permissions that used
6057 // to compute a permission, recursively, in the current schema. It is the
6158 // inverse of the ComputablePermissions API.
62- rpc DependentRelations (DependentRelationsRequest )
63- returns (DependentRelationsResponse ) {
64- option (google.api.http ) = {
65- post : "/v1/schema/permissions/dependent"
66- body : "*"
67- };
68- }
59+ rpc DependentRelations (DependentRelationsRequest ) returns (DependentRelationsResponse ) {
60+ option (google.api.http ) = {
61+ post : "/v1/schema/permissions/dependent"
62+ body : "*"
63+ };
64+ }
6965
7066 // DiffSchema returns the difference between the specified schema and the current
7167 // schema stored in SpiceDB.
72- rpc DiffSchema (DiffSchemaRequest )
73- returns (DiffSchemaResponse ) {
74- option (google.api.http ) = {
75- post : "/v1/schema/diffschema"
76- body : "*"
77- };
78- }
68+ rpc DiffSchema (DiffSchemaRequest ) returns (DiffSchemaResponse ) {
69+ option (google.api.http ) = {
70+ post : "/v1/schema/diffschema"
71+ body : "*"
72+ };
73+ }
7974}
8075
8176// ReadSchemaRequest returns the schema from the database.
@@ -119,7 +114,7 @@ message WriteSchemaResponse {
119114
120115message ReflectSchemaRequest {
121116 Consistency consistency = 1 ;
122-
117+
123118 // optional_filters defines optional filters that are applied in
124119 // an OR fashion to the schema, before being returned
125120 repeated ReflectionSchemaFilter optional_filters = 2 ;
@@ -158,7 +153,7 @@ message ReflectionDefinition {
158153 // comment is a human-readable comments on the definition. Will include
159154 // delimiter characters.
160155 string comment = 2 ;
161-
156+
162157 repeated ReflectionRelation relations = 3 ;
163158 repeated ReflectionPermission permissions = 4 ;
164159}
@@ -204,12 +199,12 @@ message ReflectionTypeReference {
204199 oneof typeref {
205200 // is_terminal_subject is true if the subject is terminal, meaning it is referenced directly vs a sub-relation.
206201 bool is_terminal_subject = 3 ;
207-
202+
208203 // optional_relation_name is the name of the relation that is applied to the subject, if any.
209204 string optional_relation_name = 4 ;
210205
211206 // is_public_wildcard is true if the subject is a public wildcard.
212- bool is_public_wildcard = 5 ;
207+ bool is_public_wildcard = 5 ;
213208 }
214209}
215210
0 commit comments