Skip to content

Commit 443db48

Browse files
drop profileName parameter
1 parent 478bf6e commit 443db48

File tree

6 files changed

+2
-14
lines changed

6 files changed

+2
-14
lines changed

x-pack/plugin/security/qa/rcs-extension/src/main/java/org/elasticsearch/xpack/security/rcs/extension/TestRemoteClusterSecurityExtension.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public boolean isRemoteClusterConnection(Transport.Connection connection) {
5555

5656
@Override
5757
public Optional<ServerTransportFilter> getRemoteProfileTransportFilter(
58-
String profileName,
5958
SslProfile sslProfile,
6059
DestructiveOperations destructiveOperations
6160
) {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/CrossClusterAccessTransportInterceptor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import java.util.function.Function;
5454

5555
import static org.elasticsearch.core.Strings.format;
56-
import static org.elasticsearch.transport.RemoteClusterPortSettings.REMOTE_CLUSTER_PROFILE;
5756
import static org.elasticsearch.transport.RemoteClusterPortSettings.REMOTE_CLUSTER_SERVER_ENABLED;
5857
import static org.elasticsearch.transport.RemoteClusterPortSettings.TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY;
5958

@@ -325,13 +324,11 @@ public boolean isRemoteClusterConnection(Transport.Connection connection) {
325324

326325
@Override
327326
public Optional<ServerTransportFilter> getRemoteProfileTransportFilter(
328-
String profileName,
329327
SslProfile sslProfile,
330328
DestructiveOperations destructiveOperations
331329
) {
332-
assert REMOTE_CLUSTER_PROFILE.equals(profileName) : "should only be called for remote cluster transport profiles";
333330
final SslConfiguration profileConfiguration = sslProfile.configuration();
334-
assert profileConfiguration != null : "SSL Profile [" + sslProfile + "] for [" + profileName + "] has a null configuration";
331+
assert profileConfiguration != null : "SSL Profile [" + sslProfile + "] has a null configuration";
335332
final boolean remoteClusterServerEnabled = REMOTE_CLUSTER_SERVER_ENABLED.get(settings);
336333
final boolean remoteClusterServerSSLEnabled = XPackSettings.REMOTE_CLUSTER_SERVER_SSL_ENABLED.get(settings);
337334
if (remoteClusterServerEnabled) {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/RemoteClusterTransportInterceptor.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ public interface RemoteClusterTransportInterceptor {
4646
* @return a custom {@link ServerTransportFilter}s for the given transport profile,
4747
* or an empty optional to fall back to the default transport filter
4848
*/
49-
Optional<ServerTransportFilter> getRemoteProfileTransportFilter(
50-
String profileName,
51-
SslProfile sslProfile,
52-
DestructiveOperations destructiveOperations
53-
);
49+
Optional<ServerTransportFilter> getRemoteProfileTransportFilter(SslProfile sslProfile, DestructiveOperations destructiveOperations);
5450

5551
/**
5652
* Returns {@code true} if any of the remote cluster access headers are in the security context.

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ private Map<String, ServerTransportFilter> initializeProfileFilters(
9292
final SslProfile sslProfile = entry.getValue();
9393
if (profileName.equals(REMOTE_CLUSTER_PROFILE)) {
9494
var remoteProfileTransportFilter = this.remoteClusterTransportInterceptor.getRemoteProfileTransportFilter(
95-
profileName,
9695
sslProfile,
9796
destructiveOperations
9897
);

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/CrossClusterAccessTransportInterceptorTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ public void testGetRemoteProfileTransportFilter() {
849849
);
850850

851851
final Optional<ServerTransportFilter> remoteProfileTransportFilter = interceptor.getRemoteProfileTransportFilter(
852-
RemoteClusterPortSettings.REMOTE_CLUSTER_PROFILE,
853852
remoteProfile,
854853
destructiveOperations
855854
);
@@ -901,7 +900,6 @@ public void testGetRemoteProfileTransportFilterWhenRemoteClusterServerIsDisabled
901900
);
902901

903902
final Optional<ServerTransportFilter> remoteProfileTransportFilter = interceptor.getRemoteProfileTransportFilter(
904-
RemoteClusterPortSettings.REMOTE_CLUSTER_PROFILE,
905903
remoteProfile,
906904
destructiveOperations
907905
);

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ public boolean isRemoteClusterConnection(Connection connection) {
545545

546546
@Override
547547
public Optional<ServerTransportFilter> getRemoteProfileTransportFilter(
548-
String profileName,
549548
SslProfile sslProfile,
550549
DestructiveOperations destructiveOperations
551550
) {

0 commit comments

Comments
 (0)