> On July 13, 2021, 12:54 a.m., Abhay Kulkarni wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java > > Lines 97 (patched) > > <https://reviews.apache.org/r/73444/diff/1/?file=2251131#file2251131line97> > > > > Please consider measuring time spent in this method (and in > > Json.parse()) using perf logging - as for every script evaluation, both > > toJson and Json.parse() will be called.
added 2 perf traces: 1. toJson() 2. script execution. This covers Json.parse() > On July 13, 2021, 12:54 a.m., Abhay Kulkarni wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java > > Lines 176 (patched) > > <https://reviews.apache.org/r/73444/diff/1/?file=2251131#file2251131line176> > > > > Please ensure that com.google.gson.Gsoncom.google.gson.Gson > > (used by JsonUtil class as a static singleton) is thread-safe. JsonUtil class updated to use ThreadLocal gson objects. - Madhan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/73444/#review223215 ----------------------------------------------------------- On July 14, 2021, 4:14 p.m., Madhan Neethiraj wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/73444/ > ----------------------------------------------------------- > > (Updated July 14, 2021, 4:14 p.m.) > > > Review request for ranger, Ankita Sinha, Don Bosco Durai, Abhay Kulkarni, > Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and > Velmurugan Periasamy. > > > Bugs: RANGER-3332 > https://issues.apache.org/jira/browse/RANGER-3332 > > > Repository: ranger > > > Description > ------- > > Updated script condition evaluator to support JavaScript style access to > request/user/groups/tags detail. For example: > - _ctx.request.clusterType == 'azure' > - _ctx.tag.type == 'PII' && _ctx.userAttributes.dept == 'hr' > - _ctx.tag.attributes.pii_type = 'email' > > > Diffs > ----- > > > agents-common/src/main/java/org/apache/ranger/authorization/utils/JsonUtils.java > ee4cef6d6 > > agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptConditionEvaluator.java > b306f5150 > > agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java > c0a8f9f35 > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerCommonConstants.java > ed2dffd91 > > agents-common/src/test/java/org/apache/ranger/plugin/conditionevaluator/RangerCustomConditionMatcherTest.java > 0a4dd4a02 > > > Diff: https://reviews.apache.org/r/73444/diff/2/ > > > Testing > ------- > > - added unit tests > > > Thanks, > > Madhan Neethiraj > >
