Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] Token misread when there is comment in model config file in preview version #258

Closed
AsakusaRinne opened this issue Jun 11, 2022 · 5 comments · Fixed by #262
Closed
Assignees
Labels

Comments

@AsakusaRinne
Copy link
Contributor

The environment

In branch preview, windows 11, .NET 6

The description

In the preview branch, when adding comments to config files with "#", the tokens will be misread if the comment contains a comma.

For instance, we add a comment to the rbac_model.conf in the examples of unit tests, as shown below.

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act   #This is a comment, splited by a comma

[role_definition]
g = _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act

Then the token count of policy definitions will be 4, which is one more than what is expected. The tokens are read as sub, obj, act #This is a comment, splited by a comma.

I think it's an unexpected behavior. If it is, I would like to solve it soon.

@casbin-bot
Copy link
Member

@sagilio @xcaptain @huazhikui

@casbin-bot casbin-bot added the bug Something isn't working label Jun 11, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Jun 11, 2022

@sagilio

@github-actions
Copy link

github-actions bot commented Jan 6, 2023

🎉 This issue has been resolved in version 2.0.0-preview.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@sagilio sagilio linked a pull request Mar 7, 2023 that will close this issue
@sagilio sagilio closed this as completed Mar 7, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants