You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Ramesh Mani <rm...@hortonworks.com> on 2019/06/07 23:42:52 UTC

Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/
-----------------------------------------------------------

Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Repository: ranger


Description
-------

RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70817/diff/1/


Testing
-------

Tested in Local VM.


Thanks,

Ramesh Mani


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Don Bosco Durai <bo...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215803
-----------------------------------------------------------


Ship it!




Ship It!

- Don Bosco Durai


On June 11, 2019, 4:28 a.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 11, 2019, 4:28 a.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/2/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215888
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 13, 2019, 8:33 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 13, 2019, 8:33 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java 6f0c12d 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerTagsAllPresentConditionEvaluator.java PRE-CREATION 
>   agents-common/src/test/resources/policycondition/test_multitag_policycondition-hive.json PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/5/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/
-----------------------------------------------------------

(Updated June 13, 2019, 8:33 p.m.)


Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Created a sample service-def with tags for ease of understanding the usage.


Repository: ranger


Description
-------

RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java 6f0c12d 
  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerTagsAllPresentConditionEvaluator.java PRE-CREATION 
  agents-common/src/test/resources/policycondition/test_multitag_policycondition-hive.json PRE-CREATION 


Diff: https://reviews.apache.org/r/70817/diff/5/

Changes: https://reviews.apache.org/r/70817/diff/4-5/


Testing
-------

Tested in Local VM.


Thanks,

Ramesh Mani


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215806
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 11, 2019, 5:19 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 11, 2019, 5:19 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/4/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/
-----------------------------------------------------------

(Updated June 11, 2019, 5:19 p.m.)


Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Repository: ranger


Description
-------

RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70817/diff/4/

Changes: https://reviews.apache.org/r/70817/diff/3-4/


Testing
-------

Tested in Local VM.


Thanks,

Ramesh Mani


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/
-----------------------------------------------------------

(Updated June 11, 2019, 4:34 p.m.)


Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Slight modification to have better coding standards.


Repository: ranger


Description
-------

RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70817/diff/3/

Changes: https://reviews.apache.org/r/70817/diff/2-3/


Testing
-------

Tested in Local VM.


Thanks,

Ramesh Mani


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215799
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 11, 2019, 4:28 a.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 11, 2019, 4:28 a.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/2/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/
-----------------------------------------------------------

(Updated June 11, 2019, 4:28 a.m.)


Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Fixed the review comments


Repository: ranger


Description
-------

RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70817/diff/2/

Changes: https://reviews.apache.org/r/70817/diff/1-2/


Testing
-------

Tested in Local VM.


Thanks,

Ramesh Mani


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215766
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 36 (patched)
<https://reviews.apache.org/r/70817/#comment302587>

    Please consider marking policyConditionTags this as 'final'



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 48 (patched)
<https://reviews.apache.org/r/70817/#comment302588>

    Please review if 'allowAny' can be avoided - by treating policyConditionTags.isEmpty() as a special case in isMatched() below.



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 82 (patched)
<https://reviews.apache.org/r/70817/#comment302585>

    policyConditionTags shouldn't be modified while evaluating in a policy. Also, there is no need to include context.getCurrentTagType().



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 84 (patched)
<https://reviews.apache.org/r/70817/#comment302586>

    equals() expect the resource to have exactly the same tags as the policy. However, what is required is for the resource to have "at least" all the tags in the policy. So, #84 - #86 should be rewriten as:
    
      matched = resourceTags != null && resourceTags.containsAll(policyConditionTags);


- Madhan Neethiraj


On June 7, 2019, 11:42 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 7, 2019, 11:42 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/1/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70817: RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70817/#review215769
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 35 (patched)
<https://reviews.apache.org/r/70817/#comment302601>

    Indentation



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 49 (patched)
<https://reviews.apache.org/r/70817/#comment302600>

    As init() is called during policy-engine construction, is it likely that either conditionDef or condition will be null? And if they are, is it more appropriate either to throw exception or at the least give warning or error?



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java
Lines 57 (patched)
<https://reviews.apache.org/r/70817/#comment302599>

    Please consider stripping possible spaces around value before adding them to policyConditionTags.


- Abhay Kulkarni


On June 7, 2019, 11:42 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70817/
> -----------------------------------------------------------
> 
> (Updated June 7, 2019, 11:42 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2465:Create a PolicyCondition to apply if all given tags are present for the accessed resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerMultipleTagsConditionEvaluator.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70817/diff/1/
> 
> 
> Testing
> -------
> 
> Tested in Local VM.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>