You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "rameeshm (via GitHub)" <gi...@apache.org> on 2025/10/24 05:34:42 UTC

[PR] RANGER-5376:Add DataSetIds in the Ranger audit events for enabling searching with DataSet Ids -Fixed filter issue [ranger]

rameeshm opened a new pull request, #716:
URL: https://github.com/apache/ranger/pull/716

   
   ## What changes were proposed in this pull request?
   
   Filter was not working correctly with previous patch related to RANGER-5376
   
   
   ## How was this patch tested?
   
   Did curl call to check that filter dataSetIds=<Value> works fine.
   curl -k -u : --negotiate "https://<hostname>:6182/service/assets/accessAudit?pageSize=25&startIndex=0&sortBy=eventTime&sortType=desc&datasetIds=1&agentId=restCatalog&repoType=3" | python -m json.tool
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RANGER-5376:Add DataSetIds in the Ranger audit events for enabling searching with DataSet Ids -Fixed filter issue [ranger]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #716:
URL: https://github.com/apache/ranger/pull/716#discussion_r2458951658


##########
security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java:
##########
@@ -570,7 +570,7 @@ public VXAccessAuditList getAccessLogs(@Context HttpServletRequest request, @Que
         searchUtil.extractString(request, searchCriteria, "agentHost", "Agent Host Name", StringUtil.VALIDATION_TEXT);
         searchUtil.extractString(request, searchCriteria, "eventId", "Event Id", null);
         searchUtil.extractString(request, searchCriteria, "datasets", "DataSets", null);
-        searchUtil.extractLong(request, searchCriteria, "datasetId", "Dataset Id");
+        searchUtil.extractLong(request, searchCriteria, "datasetIds", "Dataset Ids");

Review Comment:
   The parameter name 'datasetIds' (plural) suggests it should accept multiple IDs, but `extractLong` only extracts a single Long value. Consider using `extractLongList` or a similar method to support multiple dataset IDs, or rename the parameter to 'datasetId' (singular) to match the implementation.
   ```suggestion
           searchUtil.extractLongList(request, searchCriteria, "datasetIds", "Dataset Ids");
   ```



##########
security-admin/src/main/java/org/apache/ranger/AccessAuditsService.java:
##########
@@ -83,6 +83,7 @@ public AccessAuditsService() {
         searchFields.add(new SearchField("cluster", "cluster", SearchField.DATA_TYPE.STRING, SearchField.SEARCH_TYPE.FULL));
         searchFields.add(new SearchField("zoneName", "zoneName", SearchField.DATA_TYPE.STR_LIST, SearchField.SEARCH_TYPE.FULL));
         searchFields.add(new SearchField("datasets", "datasets", SearchField.DATA_TYPE.STR_LIST, SearchField.SEARCH_TYPE.PARTIAL));
+        searchFields.add(new SearchField("datasetIds", "datasetIds", SearchField.DATA_TYPE.INTEGER, SearchField.SEARCH_TYPE.FULL));

Review Comment:
   The search field uses DATA_TYPE.INTEGER for 'datasetIds', but the corresponding extraction in AssetREST.java uses `extractLong`. This type mismatch could cause issues. Either change the data type to LONG in the search field or use `extractInt` in AssetREST.java to maintain consistency.
   ```suggestion
           searchFields.add(new SearchField("datasetIds", "datasetIds", SearchField.DATA_TYPE.LONG, SearchField.SEARCH_TYPE.FULL));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RANGER-5376:Add DataSetIds in the Ranger audit events for enabling searching with DataSet Ids -Fixed filter issue [ranger]

Posted by "rameeshm (via GitHub)" <gi...@apache.org>.
rameeshm merged PR #716:
URL: https://github.com/apache/ranger/pull/716


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RANGER-5376:Add DataSetIds in the Ranger audit events for enabling searching with DataSet Ids -Fixed filter issue [ranger]

Posted by "rameeshm (via GitHub)" <gi...@apache.org>.
rameeshm commented on code in PR #716:
URL: https://github.com/apache/ranger/pull/716#discussion_r2458991663


##########
security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java:
##########
@@ -570,7 +570,7 @@ public VXAccessAuditList getAccessLogs(@Context HttpServletRequest request, @Que
         searchUtil.extractString(request, searchCriteria, "agentHost", "Agent Host Name", StringUtil.VALIDATION_TEXT);
         searchUtil.extractString(request, searchCriteria, "eventId", "Event Id", null);
         searchUtil.extractString(request, searchCriteria, "datasets", "DataSets", null);
-        searchUtil.extractLong(request, searchCriteria, "datasetId", "Dataset Id");
+        searchUtil.extractLong(request, searchCriteria, "datasetIds", "Dataset Ids");

Review Comment:
   extractLong internally uses extractLongList, this shouldn't be issue



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org