diff --git a/build.gradle b/build.gradle index c3658aa403..96cd373e2c 100644 --- a/build.gradle +++ b/build.gradle @@ -614,7 +614,7 @@ dependencies { implementation 'com.password4j:password4j:1.8.2' // Action privileges: check tables and compact collections - implementation 'com.selectivem.collections:special-collections-complete:1.3.0' + implementation 'com.selectivem.collections:special-collections-complete:1.3.1' //JWT implementation "io.jsonwebtoken:jjwt-api:${jjwt_version}" diff --git a/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java b/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java index 0b76137dc4..08bf56aee3 100644 --- a/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java +++ b/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java @@ -864,11 +864,11 @@ static class StatefulIndexPrivileges { String, CompactMapGroupBuilder.MapBuilder>> actionToIndexToRoles = new HashMap<>(); - CompactMapGroupBuilder> indexMapBuilder = - new CompactMapGroupBuilder<>(indices.keySet()); DeduplicatingCompactSubSetBuilder roleSetBuilder = new DeduplicatingCompactSubSetBuilder<>( roles.getCEntries().keySet() ); + CompactMapGroupBuilder> indexMapBuilder = + new CompactMapGroupBuilder<>(indices.keySet(), (k2) -> roleSetBuilder.createSubSetBuilder()); top: for (Map.Entry entry : roles.getCEntries().entrySet()) { try { @@ -907,7 +907,7 @@ static class StatefulIndexPrivileges { DeduplicatingCompactSubSetBuilder.SubSetBuilder> indexToRoles = actionToIndexToRoles .computeIfAbsent( action, - k -> indexMapBuilder.createMapBuilder((k2) -> roleSetBuilder.createSubSetBuilder()) + k -> indexMapBuilder.createMapBuilder() ); indexToRoles.get(indicesEntry.getKey()).add(roleName);