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

Conversation

d-jeffery
Copy link
Collaborator

Description

Restrict character limit of condition down to 50 characters. Left the patterns as they were.

References

openfga/language#319

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@d-jeffery d-jeffery requested a review from a team as a code owner August 15, 2024 20:15
@d-jeffery d-jeffery requested a review from rhamzeh August 15, 2024 20:15
@d-jeffery d-jeffery requested review from a team as code owners August 15, 2024 20:19
@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants