Skip to content

Commit

Permalink
Add integ test with old Signer override for sigv4a (#4617)
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Oct 20, 2023
1 parent 42da3aa commit 040d6f2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
6 changes: 6 additions & 0 deletions services/acm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,11 @@
<artifactId>http-auth-aws</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth-crt</artifactId>
<version>${awsjavasdk.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.junit.BeforeClass;
import org.junit.Test;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.authcrt.signer.AwsCrtV4aSigner;
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
import software.amazon.awssdk.services.acm.model.AcmException;
import software.amazon.awssdk.services.acm.model.GetCertificateRequest;
import software.amazon.awssdk.services.acm.model.ListCertificatesRequest;
Expand All @@ -40,6 +42,17 @@ public void list_certificates() {
Assert.assertTrue(result.certificateSummaryList().size() >= 0);
}

@Test
public void list_certificates_using_oldSigv4aSigner() {
AcmClient client = AcmClient.builder()
.credentialsProvider(StaticCredentialsProvider.create(getCredentials()))
.overrideConfiguration(c -> c.putAdvancedOption(SdkAdvancedClientOption.SIGNER,
AwsCrtV4aSigner.create()))
.build();
ListCertificatesResponse result = client.listCertificates(ListCertificatesRequest.builder().build());
Assert.assertTrue(result.certificateSummaryList().size() >= 0);
}

/**
* Ideally the service must be throwing a Invalid Arn exception
* instead of SdkServiceException. Have reported this to service to
Expand Down
38 changes: 38 additions & 0 deletions services/acm/src/it/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#

status = warn

appender.console.type = Console
appender.console.name = ConsoleAppender
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n%throwable

rootLogger.level = info
rootLogger.appenderRef.stdout.ref = ConsoleAppender

# Uncomment below to enable more specific logging
#
#logger.sdk.name = software.amazon.awssdk
#logger.sdk.level = debug
#
#logger.request.name = software.amazon.awssdk.request
#logger.request.level = debug
#
#logger.apache.name = org.apache.http.wire
#logger.apache.level = debug
#
#logger.netty.name = io.netty.handler.logging
#logger.netty.level = debug

0 comments on commit 040d6f2

Please sign in to comment.