Skip to content

Commit

Permalink
fix: update continuation_token pattern restriction (#216)
Browse files Browse the repository at this point in the history
* chore: remove lingering comment in proto defn

* fix regex pattern to allow empty continuation token
  • Loading branch information
justincoh authored Dec 30, 2024
1 parent 157144d commit b61b4ea
Show file tree
Hide file tree
Showing 3 changed files with 2,427 additions and 2,425 deletions.
18 changes: 9 additions & 9 deletions openfga/v1/openfga_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ message ReadRequest {
string continuation_token = 4 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""}
];

Expand Down Expand Up @@ -1227,7 +1227,7 @@ message ReadResponse {
json_name = "continuation_token",
(google.api.field_behavior) = REQUIRED,
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The continuation token will be empty if there are no more tuples."
example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""
Expand Down Expand Up @@ -1528,7 +1528,7 @@ message WriteAuthorizationModelRequest {
map<string, openfga.v1.Condition> conditions = 4 [
json_name = "conditions",
(validate.rules).map.max_pairs = 25,
(validate.rules).map.keys.string = {pattern: "^[^:#@\\s]{1,50}$"} /* map key pattern restriction */
(validate.rules).map.keys.string = {pattern: "^[^:#@\\s]{1,50}$"}
];
}

Expand Down Expand Up @@ -1561,7 +1561,7 @@ message ReadAuthorizationModelsRequest {
string continuation_token = 3 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""}
];
}
Expand All @@ -1575,7 +1575,7 @@ message ReadAuthorizationModelsResponse {
string continuation_token = 2 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The continuation token will be empty if there are no more models."
example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""
Expand Down Expand Up @@ -1666,7 +1666,7 @@ message ReadChangesRequest {
string continuation_token = 4 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""}
];

Expand All @@ -1689,7 +1689,7 @@ message ReadChangesResponse {
string continuation_token = 2 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The continuation token will be identical if there are no new changes."
example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""
Expand Down Expand Up @@ -1800,7 +1800,7 @@ message ListStoresRequest {
string continuation_token = 2 [
json_name = "continuation_token",
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""}
];

Expand All @@ -1825,7 +1825,7 @@ message ListStoresResponse {
json_name = "continuation_token",
(google.api.field_behavior) = REQUIRED,
(validate.rules).string.max_bytes = 5120,
(validate.rules).string.pattern = "^[A-Za-z0-9-_]+={0,2}$",
(validate.rules).string.pattern = "^$|^[A-Za-z0-9-_]+={0,2}$",
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The continuation token will be empty if there are no more stores."
example: "\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\""
Expand Down
Loading

0 comments on commit b61b4ea

Please sign in to comment.