From 8255920473ede2df2bdbdc6d336ffcb9f243a73f Mon Sep 17 00:00:00 2001 From: David Venable Date: Thu, 18 Apr 2024 18:32:28 -0500 Subject: [PATCH] Updates Ameria to 1.28.2. To support this change, also updates gRPC to 1.63.0, and Netty to 4.1.108. Fixes unit tests that were expecting a failure. Armeria fixed a bug so the old expectation was no longer valid. (#4440) Signed-off-by: David Venable --- build.gradle | 4 ++-- .../GrpcBasicAuthenticationProviderTest.java | 8 +++++--- ...authenticatedGrpcAuthenticationProviderTest.java | 13 ++++++++----- settings.gradle | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 3e508098ae..f4bbccbcc2 100644 --- a/build.gradle +++ b/build.gradle @@ -212,10 +212,10 @@ subprojects { resolutionStrategy.eachDependency { def details -> if (details.requested.group == 'io.netty') { if (details.requested.name == 'netty') { - details.useTarget group: 'io.netty', name: 'netty-all', version: '4.1.100.Final' + details.useTarget group: 'io.netty', name: 'netty-all', version: '4.1.108.Final' details.because 'Fixes CVE-2022-41881, CVE-2021-21290 and CVE-2022-41915.' } else if (!details.requested.name.startsWith('netty-tcnative')) { - details.useVersion '4.1.100.Final' + details.useVersion '4.1.108.Final' details.because 'Fixes CVE-2022-41881, CVE-2021-21290 and CVE-2022-41915.' } } else if (details.requested.group == 'log4j' && details.requested.name == 'log4j') { diff --git a/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/GrpcBasicAuthenticationProviderTest.java b/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/GrpcBasicAuthenticationProviderTest.java index 8e2799da72..cbd5404c35 100644 --- a/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/GrpcBasicAuthenticationProviderTest.java +++ b/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/GrpcBasicAuthenticationProviderTest.java @@ -7,6 +7,7 @@ import com.linecorp.armeria.client.WebClient; import com.linecorp.armeria.common.AggregatedHttpResponse; +import com.linecorp.armeria.common.HttpData; import com.linecorp.armeria.common.HttpMethod; import com.linecorp.armeria.common.HttpRequest; import com.linecorp.armeria.common.HttpStatus; @@ -29,6 +30,7 @@ import org.opensearch.dataprepper.armeria.authentication.GrpcAuthenticationProvider; import org.opensearch.dataprepper.armeria.authentication.HttpBasicAuthenticationConfig; +import java.nio.charset.Charset; import java.util.Collections; import java.util.UUID; @@ -152,12 +154,12 @@ void httpRequest_with_correct_authentication_responds_OK() { .method(HttpMethod.POST) .path("/grpc.health.v1.Health/Check") .contentType(MediaType.JSON_UTF_8) - .build()); + .build(), + HttpData.of(Charset.defaultCharset(), "{\"healthCheckConfig\":{\"serviceName\": \"test\"} }")); final AggregatedHttpResponse httpResponse = client.execute(request).aggregate().join(); - // TODO: Figure out how to get SampleHealthGrpcService to return a status of 200 - assertThat(httpResponse.status(), equalTo(HttpStatus.SERVICE_UNAVAILABLE)); + assertThat(httpResponse.status(), equalTo(HttpStatus.OK)); } } } diff --git a/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/UnauthenticatedGrpcAuthenticationProviderTest.java b/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/UnauthenticatedGrpcAuthenticationProviderTest.java index a61180f369..a82e0765ad 100644 --- a/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/UnauthenticatedGrpcAuthenticationProviderTest.java +++ b/data-prepper-plugins/armeria-common/src/test/java/org/opensearch/dataprepper/plugins/UnauthenticatedGrpcAuthenticationProviderTest.java @@ -7,6 +7,7 @@ import com.linecorp.armeria.client.WebClient; import com.linecorp.armeria.common.AggregatedHttpResponse; +import com.linecorp.armeria.common.HttpData; import com.linecorp.armeria.common.HttpMethod; import com.linecorp.armeria.common.HttpRequest; import com.linecorp.armeria.common.HttpStatus; @@ -26,6 +27,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.opensearch.dataprepper.armeria.authentication.GrpcAuthenticationProvider; +import java.nio.charset.Charset; import java.util.UUID; import static org.hamcrest.CoreMatchers.equalTo; @@ -66,12 +68,12 @@ void httpRequest_without_authentication_responds_OK() { .method(HttpMethod.POST) .path("/grpc.health.v1.Health/Check") .contentType(MediaType.JSON_UTF_8) - .build()); + .build(), + HttpData.of(Charset.defaultCharset(), "{\"healthCheckConfig\":{\"serviceName\": \"test\"} }")); final AggregatedHttpResponse httpResponse = client.execute(request).aggregate().join(); - // TODO: Figure out how to get SampleHealthGrpcService to return a status of 200 - assertThat(httpResponse.status(), equalTo(HttpStatus.SERVICE_UNAVAILABLE)); + assertThat(httpResponse.status(), equalTo(HttpStatus.OK)); } @Test @@ -84,11 +86,12 @@ void httpRequest_with_BasicAuthentication_responds_OK() { .method(HttpMethod.POST) .path("/grpc.health.v1.Health/Check") .contentType(MediaType.JSON_UTF_8) - .build()); + .build(), + HttpData.of(Charset.defaultCharset(), "{\"healthCheckConfig\":{\"serviceName\": \"test\"} }")); final AggregatedHttpResponse httpResponse = client.execute(request).aggregate().join(); // TODO: Figure out how to get SampleHealthGrpcService to return a status of 200 - assertThat(httpResponse.status(), equalTo(HttpStatus.SERVICE_UNAVAILABLE)); + assertThat(httpResponse.status(), equalTo(HttpStatus.OK)); } } diff --git a/settings.gradle b/settings.gradle index 8a80325710..7298c486ba 100644 --- a/settings.gradle +++ b/settings.gradle @@ -30,11 +30,11 @@ dependencyResolutionManagement { libs { version('slf4j', '2.0.6') library('slf4j-api', 'org.slf4j', 'slf4j-api').versionRef('slf4j') - version('armeria', '1.26.4') + version('armeria', '1.28.2') library('armeria-core', 'com.linecorp.armeria', 'armeria').versionRef('armeria') library('armeria-grpc', 'com.linecorp.armeria', 'armeria-grpc').versionRef('armeria') library('armeria-junit', 'com.linecorp.armeria', 'armeria-junit5').versionRef('armeria') - version('grpc', '1.58.0') + version('grpc', '1.63.0') library('grpc-inprocess', 'io.grpc', 'grpc-inprocess').versionRef('grpc') version('protobuf', '3.24.3') library('protobuf-core', 'com.google.protobuf', 'protobuf-java').versionRef('protobuf')