diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/XPackPlugin.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/XPackPlugin.java index dca131d78bc..29b65b277bc 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/XPackPlugin.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/XPackPlugin.java @@ -459,8 +459,8 @@ public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin, I } @Override - public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry) { - return security.getTransportInterceptors(namedWriteableRegistry); + public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry, ThreadContext threadContext) { + return security.getTransportInterceptors(namedWriteableRegistry, threadContext); } @Override diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/security/Security.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/security/Security.java index b5bbd18762a..ae552465114 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -166,7 +166,7 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin { /* what a PITA that we need an extra indirection to initialize this. Yet, once we got rid of guice we can thing about how * to fix this or make it simpler. Today we need several service that are created in createComponents but we need to register * an instance of TransportInterceptor way earlier before createComponents is called. */ - private final SetOnce securityIntercepter = new SetOnce<>(); + private final SetOnce securityInterceptor = new SetOnce<>(); private final SetOnce ipFilter = new SetOnce<>(); private final SetOnce authcService = new SetOnce<>(); @@ -334,7 +334,7 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin { ipFilter.set(new IPFilter(settings, auditTrailService, clusterService.getClusterSettings(), licenseState)); components.add(ipFilter.get()); DestructiveOperations destructiveOperations = new DestructiveOperations(settings, clusterService.getClusterSettings()); - securityIntercepter.set(new SecurityServerTransportInterceptor(settings, threadPool, authcService.get(), authzService, licenseState, + securityInterceptor.set(new SecurityServerTransportInterceptor(settings, threadPool, authcService.get(), authzService, licenseState, sslService, securityContext, destructiveOperations)); return components; } @@ -686,7 +686,7 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin { } @Override - public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry) { + public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry, ThreadContext threadContext) { if (transportClientMode || enabled == false) { // don't register anything if we are not enabled // interceptors are not installed if we are running on the transport client return Collections.emptyList(); @@ -695,14 +695,14 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin { @Override public TransportRequestHandler interceptHandler(String action, String executor, TransportRequestHandler actualHandler) { - assert securityIntercepter.get() != null; - return securityIntercepter.get().interceptHandler(action, executor, actualHandler); + assert securityInterceptor.get() != null; + return securityInterceptor.get().interceptHandler(action, executor, actualHandler); } @Override public AsyncSender interceptSender(AsyncSender sender) { - assert securityIntercepter.get() != null; - return securityIntercepter.get().interceptSender(sender); + assert securityInterceptor.get() != null; + return securityInterceptor.get().interceptSender(sender); } }); }