Skip to content

Commit 0a2287d

Browse files
committed
fixes to swagger file
1 parent d0d2a2a commit 0a2287d

File tree

6 files changed

+124
-106
lines changed

6 files changed

+124
-106
lines changed

authzed/api/v1/experimental_service.proto

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import "buf/validate/validate.proto";
77
import "google/api/annotations.proto";
88
import "google/protobuf/struct.proto";
99
import "google/rpc/status.proto";
10+
import "protoc-gen-openapiv2/options/annotations.proto";
1011
import "validate/validate.proto";
1112

1213
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
@@ -16,39 +17,39 @@ option java_package = "com.authzed.api.v1";
1617
// ExperimentalService exposes a number of APIs that are currently being
1718
// prototyped and tested for future inclusion in the stable API.
1819
service ExperimentalService {
19-
// BulkImportRelationships is a faster path to writing a large number of
20-
// relationships at once. It is both batched and streaming. For maximum
21-
// performance, the caller should attempt to write relationships in as close
22-
// to relationship sort order as possible: (resource.object_type,
23-
// resource.object_id, relation, subject.object.object_type,
24-
// subject.object.object_id, subject.optional_relation)
25-
//
26-
// EXPERIMENTAL
27-
// https://github.com/authzed/spicedb/issues/1303
20+
// DEPRECATED: Promoted to ImportBulkRelationships in the stable API.
2821
rpc BulkImportRelationships(stream BulkImportRelationshipsRequest) returns (BulkImportRelationshipsResponse) {
2922
option (google.api.http) = {
3023
post: "/v1/experimental/relationships/bulkimport"
3124
body: "*"
3225
};
26+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
27+
tags: ["Deprecated"]
28+
};
29+
option deprecated = true;
3330
}
3431

35-
// BulkExportRelationships is the fastest path available to exporting
36-
// relationships from the server. It is resumable, and will return results
37-
// in an order determined by the server.
32+
// DEPRECATED: Promoted to ExportBulkRelationships in the stable API.
3833
rpc BulkExportRelationships(BulkExportRelationshipsRequest) returns (stream BulkExportRelationshipsResponse) {
3934
option (google.api.http) = {
4035
post: "/v1/experimental/relationships/bulkexport"
4136
body: "*"
4237
};
38+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
39+
tags: ["Deprecated"]
40+
};
41+
option deprecated = true;
4342
}
4443

45-
// NOTE: BulkCheckPermission has been promoted to the stable API as "CheckBulkPermission" and the
46-
// API will be removed from experimental in a future release.
44+
// DEPRECATED: Promoted to CheckBulkPermission in the stable API.
4745
rpc BulkCheckPermission(BulkCheckPermissionRequest) returns (BulkCheckPermissionResponse) {
4846
option (google.api.http) = {
4947
post: "/v1/experimental/permissions/bulkcheckpermission"
5048
body: "*"
5149
};
50+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
51+
tags: ["Deprecated"]
52+
};
5253
option deprecated = true;
5354
}
5455

@@ -58,6 +59,9 @@ service ExperimentalService {
5859
post: "/v1/experimental/reflectschema"
5960
body: "*"
6061
};
62+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
63+
tags: ["Deprecated"]
64+
};
6165
option deprecated = true;
6266
}
6367

@@ -67,6 +71,9 @@ service ExperimentalService {
6771
post: "/v1/experimental/permissions/computable"
6872
body: "*"
6973
};
74+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
75+
tags: ["Deprecated"]
76+
};
7077
option deprecated = true;
7178
}
7279

@@ -76,6 +83,9 @@ service ExperimentalService {
7683
post: "/v1/experimental/permissions/dependent"
7784
body: "*"
7885
};
86+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
87+
tags: ["Deprecated"]
88+
};
7989
option deprecated = true;
8090
}
8191

@@ -85,6 +95,9 @@ service ExperimentalService {
8595
post: "/v1/experimental/diffschema"
8696
body: "*"
8797
};
98+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
99+
tags: ["Deprecated"]
100+
};
88101
option deprecated = true;
89102
}
90103

@@ -95,6 +108,9 @@ service ExperimentalService {
95108
post: "/v1/experimental/registerrelationshipcounter"
96109
body: "*"
97110
};
111+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
112+
tags: ["Experimental"]
113+
};
98114
}
99115

100116
// EXPERIMENTAL: CountRelationships returns the count of relationships for *pre-registered* filter.
@@ -103,6 +119,9 @@ service ExperimentalService {
103119
post: "/v1/experimental/countrelationships"
104120
body: "*"
105121
};
122+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
123+
tags: ["Experimental"]
124+
};
106125
}
107126

108127
// EXPERIMENTAL: UnregisterRelationshipCounter unregisters an existing filter for counting relationships.
@@ -111,6 +130,9 @@ service ExperimentalService {
111130
post: "/v1/experimental/unregisterrelationshipcounter"
112131
body: "*"
113132
};
133+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
134+
tags: ["Experimental"]
135+
};
114136
}
115137
}
116138

authzed/api/v1/permission_service.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import "google/api/annotations.proto";
88
import "google/protobuf/struct.proto";
99
import "google/protobuf/timestamp.proto";
1010
import "google/rpc/status.proto";
11+
import "protoc-gen-openapiv2/options/annotations.proto";
1112
import "validate/validate.proto";
1213

1314
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
@@ -24,6 +25,9 @@ service PermissionsService {
2425
post: "/v1/relationships/read"
2526
body: "*"
2627
};
28+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
29+
tags: ["Permissions"]
30+
};
2731
}
2832

2933
// WriteRelationships atomically writes and/or deletes a set of specified
@@ -34,6 +38,9 @@ service PermissionsService {
3438
post: "/v1/relationships/write"
3539
body: "*"
3640
};
41+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
42+
tags: ["Permissions"]
43+
};
3744
}
3845

3946
// DeleteRelationships atomically bulk deletes all relationships matching the
@@ -45,6 +52,9 @@ service PermissionsService {
4552
post: "/v1/relationships/delete"
4653
body: "*"
4754
};
55+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
56+
tags: ["Permissions"]
57+
};
4858
}
4959

5060
// CheckPermission determines for a given resource whether a subject computes
@@ -54,6 +64,9 @@ service PermissionsService {
5464
post: "/v1/permissions/check"
5565
body: "*"
5666
};
67+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
68+
tags: ["Permissions"]
69+
};
5770
}
5871

5972
// CheckBulkPermissions evaluates the given list of permission checks
@@ -63,6 +76,9 @@ service PermissionsService {
6376
post: "/v1/permissions/checkbulk"
6477
body: "*"
6578
};
79+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
80+
tags: ["Permissions"]
81+
};
6682
}
6783

6884
// ExpandPermissionTree reveals the graph structure for a resource's
@@ -73,6 +89,9 @@ service PermissionsService {
7389
post: "/v1/permissions/expand"
7490
body: "*"
7591
};
92+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
93+
tags: ["Permissions"]
94+
};
7695
}
7796

7897
// LookupResources returns all the resources of a given type that a subject
@@ -82,6 +101,9 @@ service PermissionsService {
82101
post: "/v1/permissions/resources"
83102
body: "*"
84103
};
104+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
105+
tags: ["Permissions"]
106+
};
85107
}
86108

87109
// LookupSubjects returns all the subjects of a given type that
@@ -91,6 +113,9 @@ service PermissionsService {
91113
post: "/v1/permissions/subjects"
92114
body: "*"
93115
};
116+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
117+
tags: ["Permissions"]
118+
};
94119
}
95120

96121
// ImportBulkRelationships is a faster path to writing a large number of
@@ -105,6 +130,9 @@ service PermissionsService {
105130
post: "/v1/relationships/importbulk"
106131
body: "*"
107132
};
133+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
134+
tags: ["Permissions"]
135+
};
108136
}
109137

110138
// ExportBulkRelationships is the fastest path available to exporting
@@ -115,6 +143,9 @@ service PermissionsService {
115143
post: "/v1/relationships/exportbulk"
116144
body: "*"
117145
};
146+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
147+
tags: ["Permissions"]
148+
};
118149
}
119150
}
120151

authzed/api/v1/schema_service.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "authzed/api/v1/core.proto";
55
import "authzed/api/v1/permission_service.proto";
66
import "buf/validate/validate.proto";
77
import "google/api/annotations.proto";
8+
import "protoc-gen-openapiv2/options/annotations.proto";
89
import "validate/validate.proto";
910

1011
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
@@ -23,6 +24,9 @@ service SchemaService {
2324
post: "/v1/schema/read"
2425
body: "*"
2526
};
27+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
28+
tags: ["Schema"]
29+
};
2630
}
2731

2832
// Write overwrites the current Object Definitions for a Permissions System.
@@ -31,6 +35,9 @@ service SchemaService {
3135
post: "/v1/schema/write"
3236
body: "*"
3337
};
38+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
39+
tags: ["Schema"]
40+
};
3441
}
3542

3643
// ReflectSchema reflects the current schema stored in SpiceDB, returning a structural
@@ -40,6 +47,9 @@ service SchemaService {
4047
post: "/v1/schema/reflectschema"
4148
body: "*"
4249
};
50+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
51+
tags: ["Schema"]
52+
};
4353
}
4454

4555
// ComputablePermissions returns the set of permissions that compute based off a relation
@@ -51,6 +61,9 @@ service SchemaService {
5161
post: "/v1/schema/permissions/computable"
5262
body: "*"
5363
};
64+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
65+
tags: ["Schema"]
66+
};
5467
}
5568

5669
// DependentRelations returns the set of relations and permissions that used
@@ -61,6 +74,9 @@ service SchemaService {
6174
post: "/v1/schema/permissions/dependent"
6275
body: "*"
6376
};
77+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
78+
tags: ["Schema"]
79+
};
6480
}
6581

6682
// DiffSchema returns the difference between the specified schema and the current
@@ -70,6 +86,9 @@ service SchemaService {
7086
post: "/v1/schema/diffschema"
7187
body: "*"
7288
};
89+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
90+
tags: ["Schema"]
91+
};
7392
}
7493
}
7594

authzed/api/v1/watch_service.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ import "authzed/api/v1/permission_service.proto";
66
import "buf/validate/validate.proto";
77
import "google/api/annotations.proto";
88
import "google/protobuf/struct.proto";
9+
import "protoc-gen-openapiv2/options/annotations.proto";
910
import "validate/validate.proto";
1011

1112
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
1213
option java_multiple_files = true;
1314
option java_package = "com.authzed.api.v1";
1415

1516
service WatchService {
17+
// Watch returns a stream of events that occurred in the datastore in ascending timestamp order.
18+
// The events can be relationship updates, schema updates, or checkpoints.
1619
rpc Watch(WatchRequest) returns (stream WatchResponse) {
1720
option (google.api.http) = {
1821
post: "/v1/watch"
1922
body: "*"
2023
};
24+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
25+
tags: ["Watch"]
26+
};
2127
}
2228
}
2329

buf.gen.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ plugins:
77
opt:
88
- "openapi_naming_strategy=simple"
99
- "allow_merge=true"
10+
- "disable_service_tags=true"

0 commit comments

Comments
 (0)