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

Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay 
Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, 
and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

**Problem Statement :** Search filter is not working as expected
For example : URL -> 
http://<host_name>:<port>/service/public/api/policy?isRecursive=True
Above search policy URL returns all policies including policy which has 
isRecursive property value to False while it should return only the policies 
which has isRecursive property value to True. Same case for database, table, 
columnFamilies, column, userName, resourceName
PageSize filter is also not working and it returns all records.

**Proposed Solution :**
Enabled filterting on 'polResource' and 'isRecursive' parameters.
It seems filtering is not working for most of request parameters but it can be 
done in memory after retrieving policy list, so will send available search 
filter object to ServiceDBStore.getServicePolicies() rather sending null as 
filter.
Change pagination implementation which shall send results according to 
requested page size after filtering the result.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
739ad05 
  security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java 
b8f7c88 
  security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java 
0feb5db 
  security-admin/src/main/java/org/apache/ranger/rest/PublicAPIs.java 21fdcd1 
  
security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java
 b7598ea 

Diff: https://reviews.apache.org/r/48620/diff/


Testing
-------

**Steps performed(with patch)**
1. Installed and started Ranger admin.
2. created policy with resource /,/*,test and set recursive=false
3. Called http://<host_name>:<port>/service/public/api/policy?isRecursive=True

**Expected Result :** There should not be any policy in response result as 
there is only one policy which has recursive status as 'False' while requested 
for policies having  recursive status set to 'True'.

**Actual Result :** No policies were found in response output.

4. Called http://<host_name>:<port>/service/public/api/policy?resourceName=test1

***Expected Result :** There should not be any policy in response result as 
there is only one policy and it dont have resource 'test1'

**Actual Result :** No policies were found in response output. however for 
'resourceName=test' query param it returns one policy object.

5. Created policy1 with resource test1,policy2 with resource test2,policy3 with 
resource test3.
6. Called 
http://<host_name>:<port>/service/public/api/policy?resourceName=test3&pageSize=10

***Expected Result :** Response result should have only one policy with 
resource 'test3'.

**Actual Result :** Response object returned one policy with 
resourceName='test3'

Note : Have not added other testing results which were done by providing 
combinations of more than one parameters.


Thanks,

Pradeep Agrawal

Reply via email to