[
https://issues.apache.org/jira/browse/RANGER-4234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Madhan Neethiraj resolved RANGER-4234.
--------------------------------------
Fix Version/s: 3.0.0
Resolution: Fixed
[~barbara] - thank you for the enhancement.
{noformat}
commit 1438644b7f1f7f5fb9e62d0d855982d7e10e7fc6 (HEAD -> master, origin/master,
origin/HEAD)
Author: Eckman, Barbara <[email protected]>
Date: Fri Sep 22 11:38:07 2023 -0400
RANGER-4234: simplify condition/row-filter expressions that deal with
delimited strings
Signed-off-by: Madhan Neethiraj <[email protected]>
{noformat}
> Eliminate need for splitting delimited strings into arrays in policy
> conditions
> -------------------------------------------------------------------------------
>
> Key: RANGER-4234
> URL: https://issues.apache.org/jira/browse/RANGER-4234
> Project: Ranger
> Issue Type: Improvement
> Components: plugins, Ranger
> Reporter: Barbara Eckman
> Assignee: Barbara Eckman
> Priority: Major
> Fix For: 3.0.0
>
> Attachments: 0001-RANGER-4234.patch
>
>
> RANGER-3940 created javascript polyfills to support set operations in policy
> conditions and row filters via includes() and intersects(). Since Ranger
> doesn't support arrays in tag or userStore attribute values, in order to do
> these set operations we need to convert a delimited string into an array via
> split(). This results in undesirably complex conditions, relatively hard to
> maintain and error-prone.
> I propose using the "[[...]]" syntax to indicate that an element is
> semantically an array. I've written a java method to replace the double
> brackets with the split() syntax before the script or row filter is executed.
> If no delimiter is explicitly given, "," is assumed.
> Examples:
> |*As written in policy/row filter condition*|*As sent for evaluation*|
> |[[USER[TAG._type],"f"]].intersects([[TAG.value]])|USER[TAG._type].split("f").intersects(TAG.value.split(","))|
> |[["${\\\{USER.partners}}"]].includes(partner)|"${{{}USER.partners{}}}".split(",").includes(partner)|
--
This message was sent by Atlassian Jira
(v8.20.10#820010)