diff --git a/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java b/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java index 82997fbe29367..bf211462ee77f 100644 --- a/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java +++ b/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java @@ -18,8 +18,6 @@ import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authc.Subject; import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine; -import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.PrivilegesToCheck; -import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.PrivilegesCheckResult; import org.elasticsearch.xpack.core.security.authz.ResolvedIndices; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor.IndicesPrivileges; @@ -118,7 +116,7 @@ public void loadAuthorizedIndices( if (isSuperuser(requestInfo.getAuthentication().getEffectiveSubject().getUser())) { listener.onResponse(new AuthorizedIndices() { public Set all(IndexComponentSelector selector) { - return () -> indicesLookup.keySet(); + return indicesLookup.keySet(); } public boolean check(String name, IndexComponentSelector selector) { return indicesLookup.containsKey(name); @@ -127,7 +125,7 @@ public boolean check(String name, IndexComponentSelector selector) { } else { listener.onResponse(new AuthorizedIndices() { public Set all(IndexComponentSelector selector) { - return () -> Set.of(); + return Set.of(); } public boolean check(String name, IndexComponentSelector selector) { return false; diff --git a/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java b/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java index d57af86531865..040b32942ded4 100644 --- a/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java +++ b/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java @@ -11,8 +11,6 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.PlainActionFuture; -import org.elasticsearch.cluster.metadata.IndexAbstraction; -import org.elasticsearch.cluster.metadata.IndexAbstraction.ConcreteIndex; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.settings.Settings; @@ -30,9 +28,6 @@ import org.elasticsearch.xpack.core.security.user.User; import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; import static org.hamcrest.Matchers.is;