Skip to content

Commit

Permalink
Updates Ameria to 1.28.2. To support this change, also updates gRPC t…
Browse files Browse the repository at this point in the history
…o 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. (opensearch-project#4440)

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable authored Apr 18, 2024
1 parent a17dbe5 commit 8255920
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 8255920

Please sign in to comment.