Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(abac): update Write API to include a condition per tuple #95

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -794,7 +794,7 @@
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01YCP46JKYM8FJCQ37NMBYHE5X\""}
];

ReadRequestTupleKey tuple_key = 2 [json_name = "tuple_key"];

Check failure on line 797 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "ReadRequest" changed type from "openfga.v1.TupleKey" to "openfga.v1.ReadRequestTupleKey".

google.protobuf.Int32Value page_size = 3 [
json_name = "page_size",
Expand Down Expand Up @@ -857,6 +857,40 @@
];
}

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 @@
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01YCP46JKYM8FJCQ37NMBYHE5X\""}
];

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

Check failure on line 902 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "WriteRequest" changed label from "optional" to "repeated".

Check failure on line 902 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "WriteRequest" changed type from "openfga.v1.TupleKeys" to "openfga.v1.WriteRequestTupleKey".

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

Check failure on line 904 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "3" on message "WriteRequest" changed label from "optional" to "repeated".

Check failure on line 904 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "3" on message "WriteRequest" changed type from "openfga.v1.TupleKeys" to "openfga.v1.WriteRequestTupleKey".

string authorization_model_id = 4 [
json_name = "authorization_model_id",
Expand All @@ -889,7 +923,7 @@
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01YCP46JKYM8FJCQ37NMBYHE5X\""}
];

CheckRequestTupleKey tuple_key = 2 [

Check failure on line 926 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "CheckRequest" changed type from "openfga.v1.TupleKey" to "openfga.v1.CheckRequestTupleKey".
json_name = "tuple_key",
(validate.rules).message.required = true,
(google.api.field_behavior) = REQUIRED
Expand Down Expand Up @@ -964,7 +998,7 @@
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01YCP46JKYM8FJCQ37NMBYHE5X\""}
];

ExpandRequestTupleKey tuple_key = 2 [

Check failure on line 1001 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "ExpandRequest" changed type from "openfga.v1.TupleKey" to "openfga.v1.ExpandRequestTupleKey".
json_name = "tuple_key",
(validate.rules).message.required = true,
(google.api.field_behavior) = REQUIRED
Expand Down Expand Up @@ -1290,7 +1324,7 @@
}

message Assertion {
CheckRequestTupleKey tuple_key = 1 [

Check failure on line 1327 in openfga/v1/openfga_service.proto

View workflow job for this annotation

GitHub Actions / build

Field "1" on message "Assertion" changed type from "openfga.v1.TupleKey" to "openfga.v1.CheckRequestTupleKey".
(validate.rules).message.required = true,
json_name = "tuple_key",
(google.api.field_behavior) = REQUIRED
Expand Down
Loading
Loading