You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Abhay Kulkarni <ak...@hortonworks.com> on 2020/02/05 21:56:08 UTC

Review Request 72086: RANGER-2722: policies/hive/for-resource api call is returning deleted policies

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

Review request for ranger, Madhan Neethiraj and Velmurugan Periasamy.


Bugs: RANGER-2722
    https://issues.apache.org/jira/browse/RANGER-2722


Repository: ranger


Description
-------

Scenario:
1. Create a policy in a hive service for database='testdb1'.
2. Ensure that no tag service is associated with this  hive service.

3. Delete all policies from the hive service.

Although, a get call to fetch all policies in ranger does not return any policy for hive service, an api call <ranger_url>/service/public/v2/api/policies/hive/for-resource?resource:database='testdb1' returns deleted policies.

If there are no policies for a service, currently, the code preserves the old engine (with assumption that there must have been some error fetching the policies). The fix is to support creation of policy engine with no policies in such case.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminCache.java 266bfbb23 


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


Testing
-------

Tested with cluster by deleting policies from a hive service. Ensured that when the last policy is deleted, 'for-resource' API call returns zero policies.


Thanks,

Abhay Kulkarni


Re: Review Request 72086: RANGER-2722: policies/hive/for-resource api call is returning deleted policies

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


Ship it!




Ship It!

- Madhan Neethiraj


On Feb. 5, 2020, 9:56 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72086/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2020, 9:56 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2722
>     https://issues.apache.org/jira/browse/RANGER-2722
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Scenario:
> 1. Create a policy in a hive service for database='testdb1'.
> 2. Ensure that no tag service is associated with this  hive service.
> 
> 3. Delete all policies from the hive service.
> 
> Although, a get call to fetch all policies in ranger does not return any policy for hive service, an api call <ranger_url>/service/public/v2/api/policies/hive/for-resource?resource:database='testdb1' returns deleted policies.
> 
> If there are no policies for a service, currently, the code preserves the old engine (with assumption that there must have been some error fetching the policies). The fix is to support creation of policy engine with no policies in such case.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminCache.java 266bfbb23 
> 
> 
> Diff: https://reviews.apache.org/r/72086/diff/1/
> 
> 
> Testing
> -------
> 
> Tested with cluster by deleting policies from a hive service. Ensured that when the last policy is deleted, 'for-resource' API call returns zero policies.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 72086: RANGER-2722: policies/hive/for-resource api call is returning deleted policies

Posted by Velmurugan Periasamy <vp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72086/#review219511
-----------------------------------------------------------


Ship it!




Ship It!

- Velmurugan Periasamy


On Feb. 5, 2020, 9:56 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72086/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2020, 9:56 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2722
>     https://issues.apache.org/jira/browse/RANGER-2722
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Scenario:
> 1. Create a policy in a hive service for database='testdb1'.
> 2. Ensure that no tag service is associated with this  hive service.
> 
> 3. Delete all policies from the hive service.
> 
> Although, a get call to fetch all policies in ranger does not return any policy for hive service, an api call <ranger_url>/service/public/v2/api/policies/hive/for-resource?resource:database='testdb1' returns deleted policies.
> 
> If there are no policies for a service, currently, the code preserves the old engine (with assumption that there must have been some error fetching the policies). The fix is to support creation of policy engine with no policies in such case.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminCache.java 266bfbb23 
> 
> 
> Diff: https://reviews.apache.org/r/72086/diff/1/
> 
> 
> Testing
> -------
> 
> Tested with cluster by deleting policies from a hive service. Ensured that when the last policy is deleted, 'for-resource' API call returns zero policies.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 72086: RANGER-2722: policies/hive/for-resource api call is returning deleted policies

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


Ship it!




Ship It!

- Ramesh Mani


On Feb. 5, 2020, 9:56 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72086/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2020, 9:56 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2722
>     https://issues.apache.org/jira/browse/RANGER-2722
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Scenario:
> 1. Create a policy in a hive service for database='testdb1'.
> 2. Ensure that no tag service is associated with this  hive service.
> 
> 3. Delete all policies from the hive service.
> 
> Although, a get call to fetch all policies in ranger does not return any policy for hive service, an api call <ranger_url>/service/public/v2/api/policies/hive/for-resource?resource:database='testdb1' returns deleted policies.
> 
> If there are no policies for a service, currently, the code preserves the old engine (with assumption that there must have been some error fetching the policies). The fix is to support creation of policy engine with no policies in such case.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminCache.java 266bfbb23 
> 
> 
> Diff: https://reviews.apache.org/r/72086/diff/1/
> 
> 
> Testing
> -------
> 
> Tested with cluster by deleting policies from a hive service. Ensured that when the last policy is deleted, 'for-resource' API call returns zero policies.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>