@@ -72,7 +72,10 @@ message CheckResourceSetResponse {
72
72
73
73
message ActionEffectMap {
74
74
map <string , cerbos.effect.v1.Effect > actions = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "Mapping of each action to an effect." }];
75
- repeated cerbos.schema.v1.ValidationError validation_errors = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "List of validation errors (if schema validation is enabled)" }];
75
+ repeated cerbos.schema.v1.ValidationError validation_errors = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description :
76
+ "List of validation errors (if schema validation is "
77
+ "enabled)"
78
+ }];
76
79
}
77
80
78
81
message Meta {
@@ -99,18 +102,32 @@ message CheckResourceSetResponse {
99
102
json_schema : {description : "Unique resource instance ID supplied in the request." }
100
103
};
101
104
map <string , EffectMeta > actions = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
102
- description : "Metadata about the effect calculated for each action on this resource instance."
103
- example : "{\"view:*\":{\"matched_policy\": \"album:object:default\"},\"comment\":{\"matched_policy\": \"album:object:default\"}}"
105
+ description :
106
+ "Metadata about the effect calculated for each "
107
+ "action on this resource instance."
108
+ example :
109
+ "{\"view:*\":{\"matched_policy\": "
110
+ "\"album:object:default\"},\"comment\":{\"matched_"
111
+ "policy\": \"album:object:default\"}}"
104
112
}];
105
113
repeated string effective_derived_roles = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
106
- description : "Derived roles that were effective during policy evaluation."
114
+ description :
115
+ "Derived roles that were effective during policy "
116
+ "evaluation."
107
117
example : "[\"owner\"]"
108
118
}];
109
119
}
110
120
111
121
map <string , ActionMeta > resource_instances = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
112
122
description : "Metadata about resource instances."
113
- example : "{\"XX125\": {\"actions\": {\"view:*\":{\"matched_policy\": \"album:object:default\"},\"comment\":{\"matched_policy\": \"album:object:default\"}}, \"effective_derived_roles\": [\"owner\"]}, \"XX225\": {\"actions\": {\"view:*\":{\"matched_policy\": \"album:object:default\"},\"comment\":{\"matched_policy\": \"album:object:default\"}}}}"
123
+ example :
124
+ "{\"XX125\": {\"actions\": {\"view:*\":{\"matched_policy\": "
125
+ "\"album:object:default\"},\"comment\":{\"matched_policy\": "
126
+ "\"album:object:default\"}}, \"effective_derived_roles\": "
127
+ "[\"owner\"]}, \"XX225\": {\"actions\": "
128
+ "{\"view:*\":{\"matched_policy\": "
129
+ "\"album:object:default\"},\"comment\":{\"matched_policy\": "
130
+ "\"album:object:default\"}}}}"
114
131
}];
115
132
}
116
133
@@ -119,8 +136,14 @@ message CheckResourceSetResponse {
119
136
example : "\"c2db17b8-4f9f-4fb1-acfd-9162a02be42b\""
120
137
}];
121
138
map <string , ActionEffectMap > resource_instances = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
122
- description : "Results for each resource instance, keyed by the ID supplied in the request"
123
- example : "{\"XX125\":{\"actions\":{\"view:*\":\"EFFECT_ALLOW\", \"comment\": \"EFFECT_ALLOW\"}}, \"XX225\":{\"actions\":{\"view:*\":\"EFFECT_DENY\", \"comment\": \"EFFECT_DENY\"}}}"
139
+ description :
140
+ "Results for each resource instance, keyed by the ID "
141
+ "supplied in the request"
142
+ example :
143
+ "{\"XX125\":{\"actions\":{\"view:*\":\"EFFECT_ALLOW\", "
144
+ "\"comment\": \"EFFECT_ALLOW\"}}, "
145
+ "\"XX225\":{\"actions\":{\"view:*\":\"EFFECT_DENY\", "
146
+ "\"comment\": \"EFFECT_DENY\"}}}"
124
147
}];
125
148
Meta meta = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "Optional metadata about the request evaluation process" }];
126
149
}
@@ -140,7 +163,10 @@ message CheckResourceBatchResponse {
140
163
description : "Mapping of each action to an effect."
141
164
example : "{\"view\":\"EFFECT_ALLOW\"}"
142
165
}];
143
- repeated cerbos.schema.v1.ValidationError validation_errors = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "List of validation errors (if schema validation is enabled)" }];
166
+ repeated cerbos.schema.v1.ValidationError validation_errors = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description :
167
+ "List of validation errors (if schema validation is "
168
+ "enabled)"
169
+ }];
144
170
}
145
171
146
172
string request_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
@@ -149,7 +175,9 @@ message CheckResourceBatchResponse {
149
175
}];
150
176
repeated ActionEffectMap results = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
151
177
description : "Result for each resource"
152
- example : "[{\"resourceId\":\"XX125\",\"actions\":{\"view\":\"EFFECT_ALLOW\"}}]"
178
+ example :
179
+ "[{\"resourceId\":\"XX125\",\"actions\":{\"view\":\"EFFECT_"
180
+ "ALLOW\"}}]"
153
181
}];
154
182
}
155
183
@@ -169,12 +197,18 @@ message CheckResourcesResponse {
169
197
example : "\"album:photo\"" ,
170
198
}];
171
199
string policy_version = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
172
- description : "The policy version to use to evaluate this request. If not specified, will default to the server-configured default version."
200
+ description :
201
+ "The policy version to use to evaluate this request. "
202
+ "If not specified, will default to the "
203
+ "server-configured default version."
173
204
pattern : "^[[:word:]]*$"
174
205
example : "\"default\""
175
206
}];
176
207
string scope = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
177
- description : "A dot-separated scope that describes the hierarchy this resource belongs to. This is used for determining policy inheritance."
208
+ description :
209
+ "A dot-separated scope that describes the hierarchy "
210
+ "this resource belongs to. This is used for "
211
+ "determining policy inheritance."
178
212
pattern : "^([[:alnum:]][[:word:]\\-]*(\\.[[:word:]\\-]*)*)*$"
179
213
example : "\"acme.corp\""
180
214
}];
@@ -200,11 +234,18 @@ message CheckResourcesResponse {
200
234
}
201
235
202
236
map <string , EffectMeta > actions = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
203
- description : "Metadata about the effect calculated for each action on this resource instance."
204
- example : "{\"view:*\":{\"matched_policy\": \"album:object:default\"},\"comment\":{\"matched_policy\": \"album:object:default\"}}"
237
+ description :
238
+ "Metadata about the effect calculated for each "
239
+ "action on this resource instance."
240
+ example :
241
+ "{\"view:*\":{\"matched_policy\": "
242
+ "\"album:object:default\"},\"comment\":{\"matched_"
243
+ "policy\": \"album:object:default\"}}"
205
244
}];
206
245
repeated string effective_derived_roles = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
207
- description : "Derived roles that were effective during policy evaluation."
246
+ description :
247
+ "Derived roles that were effective during policy "
248
+ "evaluation."
208
249
example : "[\"owner\"]"
209
250
}];
210
251
}
@@ -214,14 +255,24 @@ message CheckResourcesResponse {
214
255
description : "Mapping of each action to an effect."
215
256
example : "{\"view\":\"EFFECT_ALLOW\"}"
216
257
}];
217
- repeated cerbos.schema.v1.ValidationError validation_errors = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "List of validation errors (if schema validation is enabled)" }];
258
+ repeated cerbos.schema.v1.ValidationError validation_errors = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description :
259
+ "List of validation errors (if schema validation is "
260
+ "enabled)"
261
+ }];
218
262
Meta meta = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
219
263
description : "Metadata about policy evaluation"
220
- example : "{\"actions\": {\"view:*\":{\"matched_policy\": \"album:object:default\"},\"comment\":{\"matched_policy\": \"album:object:default\"}}, \"effective_derived_roles\": [\"owner\"]}"
264
+ example :
265
+ "{\"actions\": {\"view:*\":{\"matched_policy\": "
266
+ "\"album:object:default\"},\"comment\":{\"matched_policy\":"
267
+ " \"album:object:default\"}}, \"effective_derived_roles\": "
268
+ "[\"owner\"]}"
221
269
}];
222
270
repeated cerbos.engine.v1.OutputEntry outputs = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
223
271
description : "Output for each rule with outputs configured"
224
- example : "[{\"src\": \"resource.expense.v1/acme#rule-001\", \"val\": \"view_allowed:alice\"}, {\"src\": \"resource.expense.v1/acme#rule-002\", \"val\": \"foo\"}]"
272
+ example :
273
+ "[{\"src\": \"resource.expense.v1/acme#rule-001\", "
274
+ "\"val\": \"view_allowed:alice\"}, {\"src\": "
275
+ "\"resource.expense.v1/acme#rule-002\", \"val\": \"foo\"}]"
225
276
}];
226
277
}
227
278
@@ -231,7 +282,10 @@ message CheckResourcesResponse {
231
282
}];
232
283
repeated ResultEntry results = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {
233
284
description : "Result for each resource"
234
- example : "[{\"resource\": {\"Id\":\"XX125\", \"kind\":\"album:object\"}, \"actions\":{\"view\":\"EFFECT_ALLOW\",\"comment\":\"EFFECT_DENY\"}}]"
285
+ example :
286
+ "[{\"resource\": {\"Id\":\"XX125\", \"kind\":\"album:object\"}, "
287
+ "\"actions\":{\"view\":\"EFFECT_ALLOW\",\"comment\":\"EFFECT_"
288
+ "DENY\"}}]"
235
289
}];
236
290
string cerbos_call_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field ) = {description : "Audit log call ID associated with this request" }];
237
291
}
@@ -241,9 +295,16 @@ message PlaygroundFailure {
241
295
json_schema : {description : "Playground response" }
242
296
};
243
297
298
+ message ErrorDetails {
299
+ uint32 line = 1 ;
300
+ uint32 column = 2 ;
301
+ string context = 3 ;
302
+ }
303
+
244
304
message Error {
245
305
string file = 1 ;
246
306
string error = 2 ;
307
+ ErrorDetails details = 3 ;
247
308
}
248
309
249
310
repeated Error errors = 1 ;
@@ -379,6 +440,17 @@ message EnablePolicyResponse {
379
440
uint32 enabled_policies = 1 ;
380
441
}
381
442
443
+ message InspectPoliciesResponse {
444
+ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema ) = {
445
+ json_schema : {description : "Inspect policies response" }
446
+ };
447
+ message Result {
448
+ repeated string actions = 1 ;
449
+ }
450
+
451
+ map <string , Result > results = 1 ;
452
+ }
453
+
382
454
message AddOrUpdateSchemaResponse {
383
455
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema ) = {
384
456
json_schema : {description : "Add/update schema response" }
0 commit comments