[ 
https://issues.apache.org/jira/browse/RANGER-4234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Barbara Eckman updated RANGER-4234:
-----------------------------------
    Attachment:     (was: 0001-doubleBracketsReplace-stuff.patch)

> 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
>
> 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)

Reply via email to