-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74681/
-----------------------------------------------------------
(Updated Oct. 23, 2023, 11:41 a.m.)
Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika
Kachhadiya, and Subhrat Chaudhary.
Bugs: RANGER-4480
https://issues.apache.org/jira/browse/RANGER-4480
Repository: ranger
Description (updated)
-------
In case of GDS we cannot apply pagination from DB side Directly as some filters
are after the DB results with pagination enabled (i.e without
pageSize,startIndex as query params)we get result in batch size of 200 (default
pageSize) then this result is incomplete to apply filters which are after the
DB result (i.e filters which are in code only)
Example
1)GET shared resource API we have a query param 'resourceContains' using this
we can get shared-resource which has resource value matching with the query
param
Problem is if we have more than 200 shared resources (i.e beyond default
pageSize) in DB and we pass this param and the actual object resides in DB
beyond the pageSize limit and we dont have pageSize,startIndex in the request
then we will only retrive from DB only 200 shared-resources and further filters
will only get applied on those 200 objects but we did not retrive the actual
object we expect at response as it was beyond the default pageSize
So in case of GDS APIs we need to disable pagination
Diffs
-----
agents-common/src/main/java/org/apache/ranger/plugin/util/SearchFilter.java
93bd7f73d
security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java 10986823d
security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java
719d8a900
security-admin/src/main/java/org/apache/ranger/service/RangerGdsDataShareService.java
6a93e44dc
security-admin/src/main/java/org/apache/ranger/service/RangerGdsDatasetService.java
072889f1d
security-admin/src/main/java/org/apache/ranger/service/RangerGdsProjectService.java
4ccb063fe
security-admin/src/main/java/org/apache/ranger/service/RangerGdsSharedResourceService.java
4bdb09f4d
Diff: https://reviews.apache.org/r/74681/diff/1/
Testing
-------
1)Create shared resources more than default pageSize i.e 200
2)use GET-API --------> (/service/gds/resource) to fetch resource which has
resourceContains = resource_1 this shared resource should be beyond the
pageSize 200
3)In response you will receive the shared resource having resource as
resource_1 which was beyond 200th position in DB
Request -----------------> (/service/gds/resource?resourceContains=resource_1)
Response----------------->
{
"startIndex": 0,
"pageSize": 200,
"totalCount": 1,
"resultSize": 1,
"sortType": "sharedResourceId",
"sortBy": "asc",
"queryTimeMS": 1697626402403,
"list": [
{
"id": 388,
"guid": "1d9e2fcf-8cc8-45b0-ab87-3f596c04350a",
"isEnabled": true,
"createdBy": "Admin",
"updatedBy": "Admin",
"createTime": 1697192628000,
"updateTime": 1697192628000,
"version": 1,
"description": "This is RangerResource",
"options": {
"property1": "This is Options 1",
"property2": "This is Options 2"
},
"additionalInfo": {
"property1": "This is AdditionalInfo 1",
"property2": "This is AdditionalInfo 2"
},
"name": "RangerResource_399",
"dataShareId": 1,
"resource": {
"RAngerResourceName": {
"values": [
"res_399",
"res_399"
],
"isExcludes": true,
"isRecursive": true
}
},
"conditionExpr": "conditionExpr_1",
"accessTypes": [
"Resource_Access_type_1",
"Resource_Access_type_2"
],
"profiles": [
"resource_profile_1",
"resource_profile_2"
]
}
],
"listSize": 1
}
Thanks,
Prashant Satam