Skip to content

Commit 2011899

Browse files
Implementation of bulkcheck in Inventory service in conjunction with … (project-kessel#1041)
* Implementation of bulkcheck in Inventory service in conjunction with Relations * fix comments, add defer for the cleanup in inventory tests, add limit to max items for checkbulk request * status.Errorf does not support error-wrapping directive %w --------- Co-authored-by: Abhishek koserwal <akoserwa@redhat.com>
1 parent eb2659d commit 2011899

19 files changed

Lines changed: 1541 additions & 34 deletions

api/buf.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ deps:
55
commit: 6c6e0d3c608e4549802254a2eee81bc8
66
digest: b5:a7ca081f38656fc0f5aaa685cc111d3342876723851b47ca6b80cbb810cbb2380f8c444115c495ada58fa1f85eff44e68dc54a445761c195acdb5e8d9af675b6
77
- name: buf.build/googleapis/googleapis
8-
commit: 61b203b9a9164be9a834f58c37be6f62
9-
digest: b5:7811a98b35bd2e4ae5c3ac73c8b3d9ae429f3a790da15de188dc98fc2b77d6bb10e45711f14903af9553fa9821dff256054f2e4b7795789265bc476bec2f088c
8+
commit: 72c8614f3bd0466ea67931ef2c43d608
9+
digest: b5:13efeea24e633fd45327390bdee941207a8727e96cf01affb84c1e4100fd8f48a42bbd508df11930cd2884629bafad685df1ac3111bc78cdaefcd38c9371c6b1

api/kessel/inventory/v1beta2/check_bulk_request.pb.go

Lines changed: 212 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
syntax = "proto3";
2+
3+
package kessel.inventory.v1beta2;
4+
5+
import "buf/validate/validate.proto";
6+
import "kessel/inventory/v1beta2/resource_reference.proto";
7+
import "kessel/inventory/v1beta2/subject_reference.proto";
8+
import "kessel/inventory/v1beta2/consistency.proto";
9+
10+
11+
option go_package = "github.com/project-kessel/inventory-api/api/kessel/inventory/v1beta2";
12+
option java_multiple_files = true;
13+
option java_package = "org.project_kessel.api.inventory.v1beta2";
14+
15+
// CheckBulkRequestItem represents a single permission check in a bulk request.
16+
message CheckBulkRequestItem {
17+
ResourceReference object = 1 [(buf.validate.field).required = true];
18+
string relation = 2 [(buf.validate.field).string.min_len = 1];
19+
SubjectReference subject = 3 [(buf.validate.field).required = true];
20+
}
21+
22+
// CheckBulkRequest allows checking multiple permissions in a single request.
23+
// This is more efficient than making individual Check calls when verifying permissions
24+
// for multiple resource-subject-relation combinations.
25+
message CheckBulkRequest {
26+
repeated CheckBulkRequestItem items = 1 [(buf.validate.field).repeated.min_items = 1,
27+
(buf.validate.field).repeated.max_items = 1000];
28+
Consistency consistency = 2;
29+
}

0 commit comments

Comments
 (0)