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] White space is included in policy effect in preview branch #263

Closed
AsakusaRinne opened this issue Jun 18, 2022 · 7 comments · Fixed by #262
Closed

[BUG] White space is included in policy effect in preview branch #263

AsakusaRinne opened this issue Jun 18, 2022 · 7 comments · Fixed by #262
Assignees
Labels
bug Something isn't working

Comments

@AsakusaRinne
Copy link
Contributor

AsakusaRinne commented Jun 18, 2022

The environment

In branch preview, windows 11, .NET 6

The description

In the preview branch, the loaded policy effect includes white space, while the PermConstants.PolicyEffect does not.

For instance, we add some white spaces to the basic_model.conf in the examples of unit tests, as shown below.

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act 

[policy_effect]
e = some(where (p.eft == allow))    # Before this comment there are some white spaces.

[matchers]
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act

Then the expression of policy effect cannot be matched, which throws an exception.

If it's an unexpected behavior, 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 18, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Jun 19, 2022

@sagilio

@hsluoyz
Copy link
Member

hsluoyz commented Jun 19, 2022

@AsakusaRinne plz see the supported comment format in Golang, I'm not sure if this inline comment is supported or not.

@hsluoyz
Copy link
Member

hsluoyz commented Jun 19, 2022

@AsakusaRinne is this issue the same one as: #258 ? Why open two duplicated issues?

@AsakusaRinne
Copy link
Contributor Author

@AsakusaRinne is this issue the same one as: #258 ? Why open two duplicated issues?

Not really, #258 is the lack of process of comment symbol, while this issue is raised because the expression includes white symbol. I agree that they are similar, I would like to solve it with #258 in the same PR if it's indeed an unexpected behavior.

@hsluoyz
Copy link
Member

hsluoyz commented Jun 19, 2022

@AsakusaRinne I agree with you, and both are commenting style problems. For this issue my comment is already offered at: #262 (comment) . They can be tackled in one PR.

@sagilio
Copy link
Member

sagilio commented Mar 7, 2023

Fixed by #262

@sagilio sagilio closed this as completed Mar 7, 2023
@sagilio sagilio linked a pull request Mar 7, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants