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: resolve failing issues with checkDSL validation on the new grammar #57

Merged
merged 6 commits into from
Sep 29, 2022

Conversation

adriantam
Copy link
Member

Description

Correct DSL checker and update test snapshot to correct expected result. In addition, add test to ensure dsl checker able to detect the right error line with empty line in DSL.

References

Close #55

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

@adriantam adriantam requested a review from a team as a code owner September 28, 2022 15:36
@miparnisari
Copy link
Member

With this auth model, which has a bug:

type group
  relations
    define member as self
    define admin as self

    define can_add as can_manage_group  
    define can_edit as can_manage_group
    define can_delete as can_manage_group
    define can_read as can_manage
    
    define can_manage_group as admin
    define can_manage_users as admin
    define can_view_group as admin or member
    define can_view_users as admin or member

If I start typing another define at the end, I see this:

image

@adriantam
Copy link
Member Author

With this auth model, which has a bug:

type group
  relations
    define member as self
    define admin as self

    define can_add as can_manage_group  
    define can_edit as can_manage_group
    define can_delete as can_manage_group
    define can_read as can_manage
    
    define can_manage_group as admin
    define can_manage_users as admin
    define can_view_group as admin or member
    define can_view_users as admin or member

If I start typing another define at the end, I see this:

image

Issue is fixed. Thanks!

@adriantam adriantam merged commit 85cf501 into main Sep 29, 2022
@adriantam adriantam deleted the chore/allow-multiple-spaces-after-define branch September 29, 2022 00:18
@rhamzeh rhamzeh added this to the v0.0.5 milestone Sep 29, 2022
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.

bug: invalid syntax is associated with incorrect line when model has empty line
3 participants