You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculate changed roles on roles.yml reload (#33525)
In order to optimize the use of the role cache, when the roles.yml file
is reloaded we now calculate the names of removed, changed, and added
roles so that they may be passed to any listeners. This allows a
listener to selectively clear cache for only the roles that have been
modified. The CompositeRolesStore has been adapted to do exactly that
so that we limit the need to reload roles from sources such as the
native roles stores or external role providers.
See #33205
Copy file name to clipboardExpand all lines: x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -98,9 +98,7 @@ public CompositeRolesStore(Settings settings, FileRolesStore fileRolesStore, Nat
Copy file name to clipboardExpand all lines: x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@
53
53
importjava.util.concurrent.ExecutionException;
54
54
importjava.util.concurrent.atomic.AtomicInteger;
55
55
importjava.util.function.BiConsumer;
56
+
importjava.util.function.Consumer;
56
57
importjava.util.function.Function;
57
58
importjava.util.function.Predicate;
58
59
@@ -213,7 +214,7 @@ public void testNegativeLookupsAreCached() {
Copy file name to clipboardExpand all lines: x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/FileRolesStoreTests.java
+51-2Lines changed: 51 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@
37
37
importjava.nio.file.Path;
38
38
importjava.nio.file.StandardOpenOption;
39
39
importjava.util.Collections;
40
+
importjava.util.HashSet;
40
41
importjava.util.List;
41
42
importjava.util.Map;
42
43
importjava.util.Set;
@@ -317,8 +318,11 @@ public void testAutoReload() throws Exception {
0 commit comments