Skip to content

Commit 64db840

Browse files
authored
Merge pull request #404 from Permify/proto-update/permify-latest
chore(proto): update generated SDK with latest Permify definitions
2 parents b532fa9 + 88cc779 commit 64db840

File tree

3 files changed

+643
-2
lines changed

3 files changed

+643
-2
lines changed

proto/base/v1/openapi.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
99
info: {
1010
title: "Permify API";
1111
description: "Permify is an open source authorization service for creating fine-grained and scalable authorization systems.";
12-
version: "v1.5.0";
12+
version: "v1.6.7";
1313
contact: {
1414
name: "API Support";
1515
url: "https://github.com/Permify/permify/issues";
@@ -33,4 +33,4 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
3333
}
3434
}
3535
}
36-
};
36+
};

proto/base/v1/service.proto

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ service Permission {
150150
};
151151
}
152152

153+
// BulkCheck method receives a PermissionBulkCheckRequest containing multiple check requests
154+
// and returns a PermissionBulkCheckResponse with results for each request.
155+
// Maximum 100 requests can be processed in a single bulk operation.
156+
rpc BulkCheck(PermissionBulkCheckRequest) returns (PermissionBulkCheckResponse) {
157+
// HTTP mapping for this method
158+
option (google.api.http) = {
159+
post: "/v1/tenants/{tenant_id}/permissions/bulk-check"
160+
body: "*"
161+
};
162+
// OpenAPI annotations for this method
163+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
164+
summary: "bulk check api"
165+
tags: ["Permission"]
166+
operation_id: "permissions.bulk-check"
167+
description: "Check multiple permissions in a single request. Maximum 100 requests allowed."
168+
};
169+
}
170+
153171
// Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse.
154172
// It expands relationships according to the schema provided.
155173
rpc Expand(PermissionExpandRequest) returns (PermissionExpandResponse) {
@@ -852,6 +870,76 @@ message PermissionCheckResponseMetadata {
852870
int32 check_count = 1 [json_name = "check_count"];
853871
}
854872

873+
// BULK CHECK
874+
message PermissionBulkCheckRequestItem {
875+
// Entity on which the permission needs to be checked, required.
876+
Entity entity = 1 [
877+
json_name = "entity",
878+
(validate.rules).message.required = true,
879+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"repository:1\""}
880+
];
881+
882+
// Name of the permission or relation, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.
883+
string permission = 2 [
884+
json_name = "permission",
885+
(validate.rules).string = {
886+
pattern: "^[a-zA-Z_]{1,64}$"
887+
max_bytes: 64
888+
ignore_empty: false
889+
},
890+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The action the user wants to perform on the resource"}
891+
];
892+
893+
// Subject for which the permission needs to be checked, required.
894+
Subject subject = 3 [
895+
json_name = "subject",
896+
(validate.rules).message.required = true
897+
];
898+
}
899+
// PermissionBulkCheckRequest is the request message for the BulkCheck method in the Permission service.
900+
message PermissionBulkCheckRequest {
901+
// Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes.
902+
string tenant_id = 1 [
903+
json_name = "tenant_id",
904+
(validate.rules).string = {
905+
pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$"
906+
max_bytes: 128
907+
ignore_empty: false
908+
},
909+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes."}
910+
];
911+
912+
// Metadata associated with this request, required.
913+
PermissionCheckRequestMetadata metadata = 2 [
914+
json_name = "metadata",
915+
(validate.rules).message.required = true
916+
];
917+
918+
// List of permission check requests, maximum 100 items.
919+
repeated PermissionBulkCheckRequestItem items = 3 [
920+
json_name = "items",
921+
(validate.rules).repeated = {
922+
min_items: 1
923+
max_items: 100
924+
}
925+
];
926+
927+
// Context associated with this request.
928+
Context context = 4 [
929+
json_name = "context",
930+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Contextual data that can be dynamically added to permission check requests. See details on [Contextual Data](../../operations/contextual-tuples)"}
931+
];
932+
933+
// Additional arguments associated with this request.
934+
repeated Argument arguments = 5 [json_name = "arguments"];
935+
}
936+
937+
// PermissionBulkCheckResponse is the response message for the BulkCheck method in the Permission service.
938+
message PermissionBulkCheckResponse {
939+
// List of permission check responses corresponding to each request.
940+
repeated PermissionCheckResponse results = 1 [json_name = "results"];
941+
}
942+
855943
// EXPAND
856944

857945
// PermissionExpandRequest is the request message for the Expand method in the Permission service.

0 commit comments

Comments
 (0)