NihalJain commented on code in PR #17295:
URL: https://github.com/apache/pinot/pull/17295#discussion_r2578088629
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/config/AccessControlUserConfigUtils.java:
##########
@@ -48,13 +56,32 @@ public static UserConfig fromZNRecord(ZNRecord znRecord) {
List<String> tableList = znRecord.getListField(UserConfig.TABLES_KEY);
List<String> excludeTableList =
znRecord.getListField(UserConfig.EXCLUDE_TABLES_KEY);
- List<String> permissionListFromZNRecord =
znRecord.getListField(UserConfig.PERMISSIONS_KEY);
+ List<String> permissionListFromZNRecord = znRecord.getListField(
+ UserConfig.PERMISSIONS_KEY);
List<AccessType> permissionList = null;
if (permissionListFromZNRecord != null) {
permissionList = permissionListFromZNRecord.stream()
- .map(x -> AccessType.valueOf(x)).collect(Collectors.toList());
+ .map(x -> AccessType.valueOf(x))
+ .collect(Collectors.toList());
+ }
+
+ // Extract RLS filters from simple fields (stored as JSON)
+ Map<String, List<String>> rlsFilters = null;
+ String rlsFiltersJson = simpleFields.get(UserConfig.RLS_FILTERS_KEY);
+ if (rlsFiltersJson != null && !rlsFiltersJson.isEmpty()) {
+ try {
+ rlsFilters = JsonUtils.stringToObject(
+ rlsFiltersJson, new TypeReference<Map<String,
List<String>>>() {
+ }
+ );
+ } catch (IOException e) {
+ // Log error but continue - RLS filters are optional
+ LOGGER.error("Failed to deserialize RLS filters for user: {}",
username, e);
Review Comment:
should we fail here? although this is unlikely to happen
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]