Skip to content

Commit f7e1690

Browse files
committed
Fix customer authz engine
1 parent 6a938f1 commit f7e1690

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.action.support.SubscribableListener;
1414
import org.elasticsearch.cluster.metadata.IndexAbstraction;
1515
import org.elasticsearch.cluster.metadata.ProjectMetadata;
16+
import org.elasticsearch.core.Nullable;
1617
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse;
1718
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse.Indices;
1819
import org.elasticsearch.xpack.core.security.authc.Authentication;
@@ -35,7 +36,6 @@
3536
import java.util.Arrays;
3637
import java.util.Collection;
3738
import java.util.Collections;
38-
import java.util.function.Supplier;
3939
import java.util.HashMap;
4040
import java.util.LinkedHashMap;
4141
import java.util.List;
@@ -119,19 +119,19 @@ public void loadAuthorizedIndices(
119119
) {
120120
if (isSuperuser(requestInfo.getAuthentication().getEffectiveSubject().getUser())) {
121121
listener.onResponse(new AuthorizedIndices() {
122-
public Supplier<Set<String>> all() {
122+
public Set<String> all(@Nullable String selector) {
123123
return () -> indicesLookup.keySet();
124124
}
125-
public boolean check(String name) {
125+
public boolean check(String name, @Nullable String selector) {
126126
return indicesLookup.containsKey(name);
127127
}
128128
});
129129
} else {
130130
listener.onResponse(new AuthorizedIndices() {
131-
public Supplier<Set<String>> all() {
131+
public Set<String> all(@Nullable String selector) {
132132
return () -> Set.of();
133133
}
134-
public boolean check(String name) {
134+
public boolean check(String name, @Nullable String selector) {
135135
return false;
136136
}
137137
});

0 commit comments

Comments
 (0)