Skip to content

Commit

Permalink
feat(abac): update Write API to include a condition per tuple (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Sep 15, 2023
1 parent aa7d2ff commit 2b2e5ac
Show file tree
Hide file tree
Showing 4 changed files with 2,159 additions and 1,820 deletions.
48 changes: 31 additions & 17 deletions docs/openapiv2/apidocs.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 36 additions & 2 deletions openfga/v1/openfga_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,40 @@ message ReadResponse {
];
}

message WriteRequestTupleKey {
string user = 1 [
(validate.rules).string = {max_bytes: 512},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 512,
example: "\"user:anne\""
}
];

string relation = 2 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 50,
example: "\"reader\""
}
];

string object = 3 [
(validate.rules).string = {
pattern: "^[^\\s]{2,256}$",
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 256,
example: "\"document:2021-budget\""
}
];

RelationshipCondition condition = 4;
}

message WriteRequest {
string store_id = 1 [
json_name = "store_id",
Expand All @@ -865,9 +899,9 @@ message WriteRequest {
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01YCP46JKYM8FJCQ37NMBYHE5X\""}
];

openfga.v1.TupleKeys writes = 2;
repeated WriteRequestTupleKey writes = 2;

openfga.v1.TupleKeys deletes = 3;
repeated WriteRequestTupleKey deletes = 3;

string authorization_model_id = 4 [
json_name = "authorization_model_id",
Expand Down
Loading

0 comments on commit 2b2e5ac

Please sign in to comment.