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

fix: restrict condition name to 50 characters #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/openapiv2/apidocs.swagger.json

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

4 changes: 2 additions & 2 deletions openfga/v1/openfga.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ message RelationshipCondition {
// A reference (by name) of the relationship condition defined in the authorization model.
string name = 1 [
(validate.rules).string = {
pattern: "^[^\\s]{2,256}$"
pattern: "^[^\\s]{1,50}$"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a specific byte length that we are targeting, or are we only concerned about character count? Considering byte length, a maximum of 200 bytes (UTF-8 4-byte characters) would be valid for 50 characters.

if the assumption is that we are limiting to 50 8-bit characters for a maximum of 50 bytes, then more validations will need to be put into place.

ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 256
max_length: 50
example: "\"condition1\""
}
];
Expand Down
Loading
Loading