Skip to content

Commit 9d5d6b3

Browse files
change SecurityNetty4Transport to depend on RemoteClusterAuthenticationService
1 parent 6e6f79f commit 9d5d6b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/core/security/transport/netty4/SecurityNetty4Transport.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import org.elasticsearch.xpack.core.security.transport.SecurityTransportExceptionHandler;
4848
import org.elasticsearch.xpack.core.ssl.SSLService;
4949
import org.elasticsearch.xpack.core.ssl.SslProfile;
50-
import org.elasticsearch.xpack.security.authc.CrossClusterAccessAuthenticationService;
50+
import org.elasticsearch.xpack.security.authc.RemoteClusterAuthenticationService;
5151

5252
import java.net.InetSocketAddress;
5353
import java.net.SocketAddress;
@@ -79,7 +79,7 @@ public class SecurityNetty4Transport extends Netty4Transport {
7979
private final boolean remoteClusterServerSslEnabled;
8080
private final SslProfile remoteClusterClientSslProfile;
8181
private final RemoteClusterClientBootstrapOptions remoteClusterClientBootstrapOptions;
82-
private final CrossClusterAccessAuthenticationService crossClusterAccessAuthenticationService;
82+
private final RemoteClusterAuthenticationService remoteClusterAuthenticationService;
8383

8484
public SecurityNetty4Transport(
8585
final Settings settings,
@@ -91,7 +91,7 @@ public SecurityNetty4Transport(
9191
final CircuitBreakerService circuitBreakerService,
9292
final SSLService sslService,
9393
final SharedGroupFactory sharedGroupFactory,
94-
final CrossClusterAccessAuthenticationService crossClusterAccessAuthenticationService
94+
final RemoteClusterAuthenticationService remoteClusterAuthenticationService
9595
) {
9696
super(
9797
settings,
@@ -103,7 +103,7 @@ public SecurityNetty4Transport(
103103
circuitBreakerService,
104104
sharedGroupFactory
105105
);
106-
this.crossClusterAccessAuthenticationService = crossClusterAccessAuthenticationService;
106+
this.remoteClusterAuthenticationService = remoteClusterAuthenticationService;
107107
this.exceptionHandler = new SecurityTransportExceptionHandler(logger, lifecycle, (c, e) -> super.onException(c, e));
108108
this.sslService = sslService;
109109
this.transportSslEnabled = XPackSettings.TRANSPORT_SSL_ENABLED.get(settings);
@@ -180,7 +180,7 @@ protected void headerReceived(Header header) {
180180
channel.config().setAutoRead(false);
181181
// this prevents thread-context changes to propagate beyond the validation, as netty worker threads are reused
182182
try (ThreadContext.StoredContext ignore = threadPool.getThreadContext().newStoredContext()) {
183-
crossClusterAccessAuthenticationService.tryAuthenticate(
183+
remoteClusterAuthenticationService.tryAuthenticate(
184184
header.getRequestHeaders(),
185185
ActionListener.runAfter(ActionListener.wrap(aVoid -> {
186186
// authn is successful -> NOOP (the complete request will be subsequently authn & authz & audited)

0 commit comments

Comments
 (0)