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




security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
Lines 419 (patched)
<https://reviews.apache.org/r/74067/#comment313382>

    Change the API to : 
    
    /api/services/policyVersion/{serviceName}
    
    or
    
    /api/services/service/policyVersion/{serviceName}


- Pradeep Agrawal


On July 22, 2022, 3:58 p.m., Fateh Singh wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74067/
> -----------------------------------------------------------
> 
> (Updated July 22, 2022, 3:58 p.m.)
> 
> 
> Review request for ranger, bhavik patel, Dhaval Shah, Abhay Kulkarni, Madhan 
> Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3836
>     https://issues.apache.org/jira/browse/RANGER-3836
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> The policy version for a service can be retrieved from the 
> /service/plugins/services/<serviceID> Ranger REST endpoint. We make a GET 
> call to this endpoint and read the policyVersion json field in the response. 
> For Ozone multi-tenancy, we use this to detect whether changes have been made 
> to Ranger that require us to check for divergence. It would be helpful for 
> our use case if this operation were supported by the Ranger Client, so we did 
> not need to set up security and manually make the REST call for this 
> information.
> 
> Proposed Solution::
> 1) Introduced REST api for ServiceREST.java
> 2) Introduced corresponding REST api for PublicAPIsv2.java
> 3) Introduced python and java client in the the intg module to interact with 
> the PublicAPIsv2
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/ranger/RangerClient.java f92116d36 
>   intg/src/main/python/apache_ranger/client/ranger_client.py 85f66a43e 
>   security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java 
> 18d52fea3 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> b79188733 
>   
> security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
>  18afe8521 
> 
> 
> Diff: https://reviews.apache.org/r/74067/diff/1/
> 
> 
> Testing
> -------
> 
> Tested this functionality by calling the created REST api using both java and 
> python client.
> Scenarios tested -- get policy version using created API by authenticating 
> using 
> i) user with ROLE_USER and 
> ii) user with ROLE_SYS_ADMIN.
> Was able to successfully get correct policy version for a given service for 
> both the users
> 
> 
> Thanks,
> 
> Fateh Singh
> 
>

Reply via email to