blob: 168a50f4aacb0aee067686f2b549f55dc5dfe074 [file] [log] [blame]
{
"testCases":[
{
"name":"value=/; isRecursive=false; wildCard=true; ignoreCase=true",
"resourceDef":{
"matcher":"org.apache.ranger.plugin.resourcematcher.RangerPathResourceMatcher",
"matcherOptions":{"wildCard":true, "ignoreCase":true, "replaceTokens":true, "tokenDelimiterStart":"%", "tokenDelimiterEnd":"%", "tokenDelimiterEscape":"@" }
},
"policyResource":{
"values": ["/abc%xyz%w", "/xyz%somestuff%z", "/abc@%xyz@w", "/mad@@%xyy%"],
"isRecursive":false
},
"tests":[
{ "name":"exact-path","input":"/mad@new", "evalContext": {"token:xyy": "new"}, "result":true}
,
{ "name":"exact-path","input":"/abcw", "evalContext": {"token:somestuff": "somethingelse"}, "result":true}
,
{ "name":"exact-path","input":"/abc%xyz%w", "evalContext": {"token:somestuff": "somethingelse", "token:xyz":"abcd"}, "result":false}
,
{ "name":"exact-path","input":"/abcabcdw", "evalContext": {"token:somestuff": "somethingelse", "token:xyz":"abcd"}, "result":true}
,
{ "name":"exact-path","input":"/xyzsomethingelsez", "evalContext": {"token:somestuff": "somethingelse"}, "result":true}
,
{ "name":"exact-path","input":"/abc@%xyz@w", "evalContext": {"token:somestuff": "somethingelse"}, "result":false}
,
{ "name":"exact-path","input":"/abc%xyzw", "evalContext": {"token:somestuff": "somethingelse"}, "result":true}
,
{ "name":"exact-path","input":"/abcabcdw", "evalContext": {"token:somestuff": "somethingelse", "xyz":"abcd"}, "result":false}
]
}
]
}