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
[Question] Is it expected that keyMatch3 handles *
pattern?
#1367
Comments
It's also not quite clear about the According to the doc, the latter handles double
while the former handles only single
But in the following example both
|
keyMatch3() and keyMatch4() both support * as well keyMatch4() tests if the same "id" occurrences have the same value casbin/util/builtin_operators_test.go Lines 208 to 222 in 277c1a2
|
Hello!
I'm looking at doc https://casbin.org/docs/function/
It explicitly says that
keyMatch
handles a URL path or a*
pattern like/alice_data/*
keyMatch3
handles a URL path or a{}
pattern like/alice_data/{resource}
At the same time the
casbin/util/builtin_operators_test.go
Lines 171 to 196 in 277c1a2
According to the tests, the
keyMatch3
function handles both{}
pattern AND*
pattern, while it's not documented.If that's an expected behaviour, could you please document that explicitly.
Otherwise the tests should be fixed.
Moving forward, there's
keyMatch5
function as well which handles a URL path, a {} or * pattern like /alice_data/{id}/*, according to the documentation.And the tests
casbin/util/builtin_operators_test.go
Lines 485 to 526 in 1cde264
It looks like
keyMatch3
andkeyMatch5
behave equally, while the documentation says they shouldn't.The text was updated successfully, but these errors were encountered: