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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]