fix: matcher function lost#818
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.
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.
@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.
@closetool Please update the test.
There was a problem hiding this comment.
@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.
@closetool I found this problem, so I asked to use this master for test.
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