Skip to content

Commit

Permalink
Fix the SecurityInterceptorTests
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Sep 8, 2023
1 parent 0407489 commit a1a8632
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@ public SecuritySSLNettyHttpServerTransport(
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(settings, networkService, bigArrays, threadPool, namedXContentRegistry, dispatcher, clusterSettings, sharedGroupFactory, tracer);
super(
settings,
networkService,
bigArrays,
threadPool,
namedXContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory,
tracer
);
this.sks = sks;
this.errorHandler = errorHandler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.opensearch.rest.RestChannel;
import org.opensearch.rest.RestRequest;
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;

Expand Down Expand Up @@ -78,7 +79,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
NamedXContentRegistry xContentRegistry,
NetworkService networkService,
Dispatcher dispatcher,
ClusterSettings clusterSettings
ClusterSettings clusterSettings,
Tracer tracer
) {

final UserInjectingDispatcher validatingDispatcher = new UserInjectingDispatcher(dispatcher);
Expand All @@ -92,7 +94,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
xContentRegistry,
validatingDispatcher,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
)
);
}
Expand All @@ -107,9 +110,20 @@ public UserInjectingServerTransport(
final NamedXContentRegistry namedXContentRegistry,
final Dispatcher dispatcher,
ClusterSettings clusterSettings,
SharedGroupFactory sharedGroupFactory
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(settings, networkService, bigArrays, threadPool, namedXContentRegistry, dispatcher, clusterSettings, sharedGroupFactory);
super(
settings,
networkService,
bigArrays,
threadPool,
namedXContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory,
tracer
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.opensearch.security.support.Base64Helper;
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.security.user.User;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.test.transport.MockTransport;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport.Connection;
Expand Down Expand Up @@ -122,7 +123,8 @@ public void testSendRequestDecorate() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
boundTransportAddress -> clusterService.state().nodes().get(SecurityInterceptor.class.getSimpleName()),
null,
emptySet()
emptySet(),
NoopTracer.INSTANCE
);

// CS-SUPPRESS-SINGLE: RegexpSingleline Extensions manager used for creating a mock
Expand Down

0 comments on commit a1a8632

Please sign in to comment.