From aeed4cb3e435de58bdd8912a808f4af37b9d3388 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 19 Jul 2017 10:48:05 +0200 Subject: [PATCH] Followup refactoring for elastic/elasticsearch#25787 Original commit: elastic/x-pack-elasticsearch@ab0e5c45efb508854c0ac48861fc625363756872 --- .../authz/accesscontrol/SecurityIndexSearcherWrapper.java | 4 ++-- .../accesscontrol/SecurityIndexSearcherWrapperUnitTests.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapper.java b/plugin/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapper.java index 3ca9f6093ef..5cc2c1bc80a 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapper.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapper.java @@ -358,8 +358,8 @@ public class SecurityIndexSearcherWrapper extends IndexSearcherWrapper { throw new IllegalStateException("role queries are not allowed to execute additional requests"); } }; - QueryRewriteContext copy = new QueryRewriteContext(original.getIndexSettings(), original.getMapperService(), scriptService, - original.getXContentRegistry(), client, original.getIndexReader(), original::nowInMillis); + QueryRewriteContext copy = new QueryRewriteContext( + original.getXContentRegistry(), client, original::nowInMillis); queryBuilder.rewrite(copy); } } diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java index 315ed624cf3..8d4c20dc62c 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java @@ -679,7 +679,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { Client client = mock(Client.class); when(client.settings()).thenReturn(Settings.EMPTY); final long nowInMillis = randomNonNegativeLong(); - QueryRewriteContext context = new QueryRewriteContext(null, null, scriptService, xContentRegistry(), client, null, + QueryRewriteContext context = new QueryRewriteContext(xContentRegistry(), client, () -> nowInMillis); QueryBuilder queryBuilder1 = new TermsQueryBuilder("field", "val1", "val2"); SecurityIndexSearcherWrapper.failIfQueryUsesClient(scriptService, queryBuilder1, context);