api
api copied to clipboard
fix: update user/relation/object regex validation.
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
- [x] I have clicked on "allow edits by maintainers".
- [x] 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]
- [x] 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.