Skip to content

Commit b6a16d6

Browse files
authored
Fix compilation for custom authz engine example (elastic#125547)
Relates: elastic#125469
1 parent 00f67f9 commit b6a16d6

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import org.elasticsearch.xpack.core.security.authc.Authentication;
1919
import org.elasticsearch.xpack.core.security.authc.Subject;
2020
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine;
21-
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.PrivilegesToCheck;
22-
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.PrivilegesCheckResult;
2321
import org.elasticsearch.xpack.core.security.authz.ResolvedIndices;
2422
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor;
2523
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor.IndicesPrivileges;
@@ -118,7 +116,7 @@ public void loadAuthorizedIndices(
118116
if (isSuperuser(requestInfo.getAuthentication().getEffectiveSubject().getUser())) {
119117
listener.onResponse(new AuthorizedIndices() {
120118
public Set<String> all(IndexComponentSelector selector) {
121-
return () -> indicesLookup.keySet();
119+
return indicesLookup.keySet();
122120
}
123121
public boolean check(String name, IndexComponentSelector selector) {
124122
return indicesLookup.containsKey(name);
@@ -127,7 +125,7 @@ public boolean check(String name, IndexComponentSelector selector) {
127125
} else {
128126
listener.onResponse(new AuthorizedIndices() {
129127
public Set<String> all(IndexComponentSelector selector) {
130-
return () -> Set.of();
128+
return Set.of();
131129
}
132130
public boolean check(String name, IndexComponentSelector selector) {
133131
return false;

plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
import org.elasticsearch.action.search.SearchRequest;
1313
import org.elasticsearch.action.support.PlainActionFuture;
14-
import org.elasticsearch.cluster.metadata.IndexAbstraction;
15-
import org.elasticsearch.cluster.metadata.IndexAbstraction.ConcreteIndex;
1614
import org.elasticsearch.cluster.metadata.IndexMetadata;
1715
import org.elasticsearch.cluster.metadata.Metadata;
1816
import org.elasticsearch.common.settings.Settings;
@@ -30,9 +28,6 @@
3028
import org.elasticsearch.xpack.core.security.user.User;
3129

3230
import java.util.Collections;
33-
import java.util.HashMap;
34-
import java.util.Map;
35-
import java.util.stream.Stream;
3631

3732
import static org.hamcrest.Matchers.is;
3833

0 commit comments

Comments
 (0)