-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74067/
-----------------------------------------------------------
(Updated July 29, 2022, 9:38 p.m.)
Review request for ranger, bhavik patel, Dhaval Shah, Abhay Kulkarni, Madhan
Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
Changes
-------
Changed API endpoint to /services/policyVersion/{serviceName}
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 (updated)
-----
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/2/
Changes: https://reviews.apache.org/r/74067/diff/1-2/
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
File Attachments
----------------
0001-RANGER-3836-REST-API-to-get-policy-version-for-a-giv.patch
https://reviews.apache.org/media/uploaded/files/2022/07/28/e7777890-250b-43d4-9a6f-f6c7830d54ea__0001-RANGER-3836-REST-API-to-get-policy-version-for-a-giv.patch
Thanks,
Fateh Singh