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: update user/relation/object regex validation. #205

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Toprun123
Copy link

@Toprun123 Toprun123 commented Oct 15, 2024

Update the regex validation for user, relation, and object under CheckRequestTupleKey.

Updated regular expressions used for user, relation and object under CheckRequestTupleKey in the following manner:

  • user: ^(?=.{2,512}$)(?:[a-z_-]+:(?:[a-zA-Z0-9_/#-]+|\*))$
  • relation: ^[a-z]{1,50}$
  • object: ^(?=.{2,256}$)(?:[a-z_-]+:(?:[a-zA-Z0-9_/-]+|\*))$

Description

I tried to follow the docs for this project to ensure the regex matches, if there is a mistake or edge case please correct me. This is also my first code-based PR so please correct me if i did not understand the issue properly.

References

This PR is to fix the problem mentioned in this issue #188

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
    • I'm sorry but I do not understand how and where I am meant to add tests for this.

Update the regex validation for user, relation, and object under CheckRequestTupleKey.
@Toprun123 Toprun123 requested a review from a team as a code owner October 15, 2024 16:04
Copy link

linux-foundation-easycla bot commented Oct 15, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

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.

1 participant