-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73720/
-----------------------------------------------------------
Review request for ranger, Dineshkumar Yadav, Abhay Kulkarni, Madhan Neethiraj,
Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
Bugs: RANGER-3439
https://issues.apache.org/jira/browse/RANGER-3439
Repository: ranger
Description
-------
**Problem statement:** This RR is modification of the work done in RANGER-3439
(https://reviews.apache.org/r/73601/) which is already committed, changes are
needed for the changes proposed in https://reviews.apache.org/r/73719/
**Proposed solution:** API getPolicyByGUIDAndServiceName and
deletePolicyByGUIDAndServiceName can be modified to address the requirement
which shall accept the guid service name and zone name as request parameters
input and provide the get policy or delete policy option.
API:
a) getPolicyByGUIDAndServiceNameAndZoneName(guid, service, zone): reads the
input values and returns the policy object.
b) deletePolicyByGUIDAndServiceNameAndZoneName(guid, service, zone) : reads the
input values and deletes the respective policy object.
Diffs
-----
security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
f13cef71d
security-admin/src/main/java/org/apache/ranger/db/XXPolicyDao.java 41ca8b2a6
security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
6ab3d52a0
security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
3ba29653b
security-admin/src/main/resources/META-INF/jpa_named_queries.xml 85cadbbd5
Diff: https://reviews.apache.org/r/73720/diff/1/
Testing
-------
Tested getPolicyByGUIDAndServiceNameAndZoneName() API and was able to recieve
the matching policy object.
Tested deletePolicyByGUIDAndServiceNameAndZoneName() API and was able to delete
the respective policy object.
**Sample curl requests:**
curl -u admin:Ranger1234 -H "Accept: application/json" -H "Content-Type:
application/json" -X GET
'http://localhost:6080/service/plugins/policies/guid/0be7457b-35c7-4ca9-bd08-938d98a3e724?serviceName=cm_hive'
curl -u admin:Ranger1234 -H "Accept: application/json" -H "Content-Type:
application/json" -X GET
'http://localhost:6080/service/plugins/policies/guid/ad88dd6f-1d85-4a67-8e84-813809c83da0?serviceName=cm_hive&zoneName=zone1'
curl -u admin:Ranger1234 -H "Accept: application/json" -H "Content-Type:
application/json" -X DELETE
'http://localhost:6080/service/plugins/policies/guid/0be7457b-35c7-4ca9-bd08-938d98a3e724?serviceName=cm_hive'
curl -u admin:Ranger1234 -H "Accept: application/json" -H "Content-Type:
application/json" -X DELETE
'http://localhost:6080/service/plugins/policies/guid/ad88dd6f-1d85-4a67-8e84-813809c83da0?serviceName=cm_hive&zoneName=zone1'
Thanks,
Pradeep Agrawal