From 5d47b96905150fa81993bad3b2e4c6336458247e Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Wed, 15 Nov 2017 09:48:17 -0700 Subject: [PATCH] Modify x-pack to for `TransportChannel` changes (elastic/x-pack-elasticsearch#3013) This is related to elastic/elasticsearch#elastic/x-pack-elasticsearch#27388. It modifies x-pack to be compatible with the removal of the delegating transport channel. Original commit: elastic/x-pack-elasticsearch@3bd7bf6773753c378aeb00fef9cd4456b312d9d1 --- .../xpack/security/transport/ServerTransportFilter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java b/plugin/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java index 22840e640d0..f28482c1ac6 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/security/transport/ServerTransportFilter.java @@ -19,7 +19,7 @@ import org.elasticsearch.action.admin.indices.open.OpenIndexAction; import org.elasticsearch.action.support.DestructiveOperations; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.transport.DelegatingTransportChannel; +import org.elasticsearch.transport.TaskTransportChannel; import org.elasticsearch.transport.TcpTransportChannel; import org.elasticsearch.transport.TransportChannel; import org.elasticsearch.transport.TransportRequest; @@ -109,8 +109,8 @@ public interface ServerTransportFilter { String securityAction = actionMapper.action(action, request); TransportChannel unwrappedChannel = transportChannel; - while (unwrappedChannel instanceof DelegatingTransportChannel) { - unwrappedChannel = ((DelegatingTransportChannel) unwrappedChannel).getChannel(); + if (unwrappedChannel instanceof TaskTransportChannel) { + unwrappedChannel = ((TaskTransportChannel) unwrappedChannel).getChannel(); } if (extractClientCert && (unwrappedChannel instanceof TcpTransportChannel) &&