diff --git a/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/JaasAuthProvider.java b/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/JaasAuthProvider.java index 73a5ceb9c9be..ae5eb3549005 100644 --- a/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/JaasAuthProvider.java +++ b/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/JaasAuthProvider.java @@ -96,6 +96,7 @@ public void authenticate( server.getWorkerExecutor().executeBlocking( p -> getUser(contextName, username, password, allowedRoles, p), + false, resultHandler ); } diff --git a/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/KsqlAuthorizationProviderHandler.java b/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/KsqlAuthorizationProviderHandler.java index 56aeb35f5cec..2ce99e013bc0 100644 --- a/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/KsqlAuthorizationProviderHandler.java +++ b/ksqldb-rest-app/src/main/java/io/confluent/ksql/api/auth/KsqlAuthorizationProviderHandler.java @@ -57,6 +57,7 @@ public void handle(final RoutingContext routingContext) { workerExecutor.executeBlocking( promise -> authorize(promise, routingContext), + false, ar -> handleAuthorizeResult(ar, routingContext)); } diff --git a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/auth/JaasAuthProviderTest.java b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/auth/JaasAuthProviderTest.java index db510156959d..e1d28d373bde 100644 --- a/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/auth/JaasAuthProviderTest.java +++ b/ksqldb-rest-app/src/test/java/io/confluent/ksql/api/auth/JaasAuthProviderTest.java @@ -19,6 +19,7 @@ import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -253,11 +254,11 @@ private void handleAsyncExecution() { when(server.getWorkerExecutor()).thenReturn(worker); doAnswer(invocation -> { final Handler> blockingCodeHandler = invocation.getArgument(0); - final Handler> resultHandler = invocation.getArgument(1); + final Handler> resultHandler = invocation.getArgument(2); final Promise promise = Promise.promise(); promise.future().onComplete(resultHandler); blockingCodeHandler.handle(promise); return null; - }).when(worker).executeBlocking(any(), any()); + }).when(worker).executeBlocking(any(), eq(false), any()); } }