-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: matcher function lost #818
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
Conversation
@closetool can you add a test for this change? I also make a PR: #819 to fix the matcher function lost, and dirty data problems cause by LoadPolicy. Your PR can be used to fix the |
@nodece Sure |
@nodece Added, plz review |
@hsluoyz Yeap, Model.ToText() still have a bug to fix. |
model/model_test.go
Outdated
"r": "sub, obj, act", | ||
"p": "sub, obj, act", | ||
"e": "some(where (p_eft == allow))", | ||
"m": "r_sub == p_sub && r_obj == p_obj && is_rw(r_act, p_act)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add test m = r_sub == p_sub && r_obj == p_obj && r_func(r_act, p_act) && testr_func(r_act, p_act)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@closetool don't remove the r_func()
and testr_func()
, which used to test rPattern := regexp.MustCompile(
r_)
, and you should also test the regexp.MustCompile(
p_)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@closetool Please update the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodece There's still some problems, we cann't figure out if it's a policy token or a user defined function for pattern has p_
and r_
, so testr_func
will lead to error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@closetool I found this problem, so I asked to use this master for test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodece fixed
Signed-off-by: closetool <c299999999@qq.com>
🎉 This PR is included in version 2.31.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Signed-off-by: closetool c299999999@qq.com
Fix: #817