From a66c049306f98955ecd9f27d64fbc39bdc77f556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Tue, 29 Aug 2023 13:06:04 -0700 Subject: [PATCH 1/4] Clean up auth schemes/signers that are no longer needed --- .../auth/aws/crt/AwsCrtS3V4aAuthScheme.java | 67 ------------------- .../auth/aws/crt/AwsCrtS3V4aHttpSigner.java | 39 ----------- .../auth/aws/crt/AwsCrtV4aAuthScheme.java | 67 ------------------- .../auth/aws/crt/AwsCrtV4aHttpSigner.java | 39 ----------- .../DefaultAwsCrtS3V4aHttpSigner.java | 42 ------------ .../signer/DefaultAwsCrtV4aHttpSigner.java | 7 ++ .../http/auth/aws/AwsS3V4AuthScheme.java | 62 ----------------- .../http/auth/aws/AwsS3V4HttpSigner.java | 39 ----------- .../http/auth/aws/AwsV4QueryAuthScheme.java | 62 ----------------- .../http/auth/aws/AwsV4QueryHttpSigner.java | 42 ------------ .../aws/internal/signer/SignerLoader.java | 7 +- 11 files changed, 8 insertions(+), 465 deletions(-) delete mode 100644 core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aAuthScheme.java delete mode 100644 core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aHttpSigner.java delete mode 100644 core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aAuthScheme.java delete mode 100644 core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aHttpSigner.java delete mode 100644 core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/DefaultAwsCrtS3V4aHttpSigner.java delete mode 100644 core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4AuthScheme.java delete mode 100644 core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4HttpSigner.java delete mode 100644 core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryAuthScheme.java delete mode 100644 core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryHttpSigner.java diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aAuthScheme.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aAuthScheme.java deleted file mode 100644 index 402ef08de8f5..000000000000 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aAuthScheme.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws.crt; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; -import software.amazon.awssdk.http.auth.spi.AuthScheme; -import software.amazon.awssdk.http.auth.spi.IdentityProviderConfiguration; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; -import software.amazon.awssdk.identity.spi.IdentityProvider; - -/** - * The aws.auth#sigv4a auth scheme, which uses a {@link AwsCredentialsIdentity} and {@link AwsCrtS3V4aHttpSigner}. - */ -@SdkPublicApi -public interface AwsCrtS3V4aAuthScheme extends AuthScheme { - - /** - * The scheme ID for this interface. - */ - String SCHEME_ID = "aws.auth#sigv4a"; - - /** - * Get a default implementation of a {@link AwsCrtS3V4aAuthScheme} - */ - static AwsCrtS3V4aAuthScheme create() { - return new AwsCrtS3V4aAuthScheme() { - }; - } - - /** - * Retrieve the scheme ID. - */ - @Override - default String schemeId() { - return SCHEME_ID; - } - - /** - * Retrieve the {@link AwsCredentialsIdentity} based {@link IdentityProvider} associated with this authentication scheme. - */ - @Override - default IdentityProvider identityProvider(IdentityProviderConfiguration providers) { - return providers.identityProvider(AwsCredentialsIdentity.class); - } - - /** - * Retrieve the {@link AwsV4aHttpSigner} associated with this authentication scheme. - */ - @Override - default AwsV4aHttpSigner signer() { - return AwsCrtV4aHttpSigner.create(); - } -} diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aHttpSigner.java deleted file mode 100644 index 2089d3e12be6..000000000000 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtS3V4aHttpSigner.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws.crt; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; -import software.amazon.awssdk.http.auth.aws.crt.internal.DefaultAwsCrtS3V4aHttpSigner; -import software.amazon.awssdk.http.auth.spi.HttpSigner; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; - -/** - * An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}), - * specifically for S3-CRT. - */ -@SdkPublicApi -public interface AwsCrtS3V4aHttpSigner extends AwsV4aHttpSigner { - - /** - * Get a default implementation of a {@link AwsCrtS3V4aHttpSigner} - * - * @return AwsCrtS3V4aHttpSigner - */ - static AwsV4aHttpSigner create() { - return new DefaultAwsCrtS3V4aHttpSigner(); - } -} diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aAuthScheme.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aAuthScheme.java deleted file mode 100644 index c4e94d488616..000000000000 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aAuthScheme.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws.crt; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; -import software.amazon.awssdk.http.auth.spi.AuthScheme; -import software.amazon.awssdk.http.auth.spi.IdentityProviderConfiguration; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; -import software.amazon.awssdk.identity.spi.IdentityProvider; - -/** - * The aws.auth#sigv4a auth scheme, which uses a {@link AwsCredentialsIdentity} and {@link AwsCrtV4aHttpSigner}. - */ -@SdkPublicApi -public interface AwsCrtV4aAuthScheme extends AuthScheme { - - /** - * The scheme ID for this interface. - */ - String SCHEME_ID = "aws.auth#sigv4a"; - - /** - * Get a default implementation of a {@link AwsCrtV4aAuthScheme} - */ - static AwsCrtV4aAuthScheme create() { - return new AwsCrtV4aAuthScheme() { - }; - } - - /** - * Retrieve the scheme ID. - */ - @Override - default String schemeId() { - return SCHEME_ID; - } - - /** - * Retrieve the {@link AwsCredentialsIdentity} based {@link IdentityProvider} associated with this authentication scheme. - */ - @Override - default IdentityProvider identityProvider(IdentityProviderConfiguration providers) { - return providers.identityProvider(AwsCredentialsIdentity.class); - } - - /** - * Retrieve the {@link AwsV4aHttpSigner} associated with this authentication scheme. - */ - @Override - default AwsV4aHttpSigner signer() { - return AwsCrtV4aHttpSigner.create(); - } -} diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aHttpSigner.java deleted file mode 100644 index 1eb4aade96ca..000000000000 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/AwsCrtV4aHttpSigner.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws.crt; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; -import software.amazon.awssdk.http.auth.aws.crt.internal.signer.DefaultAwsCrtV4aHttpSigner; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; - -/** - * An {@link AwsV4aHttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}), specifically - * using CRT. - * TODO: Remove this once we can remove the auth-scheme. - */ -@SdkPublicApi -public interface AwsCrtV4aHttpSigner extends AwsV4aHttpSigner { - - /** - * Get a default implementation of a {@link AwsCrtV4aHttpSigner} - * - * @return AwsV4aHttpSigner - */ - static AwsV4aHttpSigner create() { - return new DefaultAwsCrtV4aHttpSigner(); - } -} diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/DefaultAwsCrtS3V4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/DefaultAwsCrtS3V4aHttpSigner.java deleted file mode 100644 index fe50ecf3eb6a..000000000000 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/DefaultAwsCrtS3V4aHttpSigner.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws.crt.internal; - -import java.util.concurrent.CompletableFuture; -import software.amazon.awssdk.annotations.SdkInternalApi; -import software.amazon.awssdk.http.auth.aws.crt.AwsCrtS3V4aHttpSigner; -import software.amazon.awssdk.http.auth.spi.AsyncSignRequest; -import software.amazon.awssdk.http.auth.spi.AsyncSignedRequest; -import software.amazon.awssdk.http.auth.spi.SyncSignRequest; -import software.amazon.awssdk.http.auth.spi.SyncSignedRequest; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; - -/** - * A default implementation of {@link AwsCrtS3V4aHttpSigner}. - */ -@SdkInternalApi -public class DefaultAwsCrtS3V4aHttpSigner implements AwsCrtS3V4aHttpSigner { - - @Override - public SyncSignedRequest sign(SyncSignRequest request) { - throw new UnsupportedOperationException(); - } - - @Override - public CompletableFuture signAsync(AsyncSignRequest request) { - throw new UnsupportedOperationException(); - } -} diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java index 39aabe42eaf4..9b1806c000c9 100644 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java +++ b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java @@ -47,6 +47,13 @@ @SdkInternalApi public final class DefaultAwsCrtV4aHttpSigner implements AwsV4aHttpSigner { + /** + * Returns a default implementation for {@link AwsV4aHttpSigner}. + */ + public static AwsV4aHttpSigner create() { + return new DefaultAwsCrtV4aHttpSigner(); + } + private static Duration validateExpirationDuration(Duration expirationDuration) { if (expirationDuration.compareTo(PRESIGN_URL_MAX_EXPIRATION_DURATION) > 0) { throw new IllegalArgumentException( diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4AuthScheme.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4AuthScheme.java deleted file mode 100644 index 34098146d24a..000000000000 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4AuthScheme.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.spi.AuthScheme; -import software.amazon.awssdk.http.auth.spi.IdentityProviderConfiguration; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; -import software.amazon.awssdk.identity.spi.IdentityProvider; - -/** - * The aws.auth#sigv4 auth scheme, which uses a - * {@link AwsCredentialsIdentity} and {@link AwsS3V4HttpSigner}. - */ -@SdkPublicApi -public interface AwsS3V4AuthScheme extends AuthScheme { - - /** - * Get a default implementation of a {@link AwsS3V4AuthScheme} - */ - static AwsS3V4AuthScheme create() { - return new AwsS3V4AuthScheme() { - }; - } - - /** - * Retrieve the scheme ID. - */ - @Override - default String schemeId() { - return "aws.auth#sigv4"; - } - - /** - * Retrieve the {@link AwsCredentialsIdentity} based {@link IdentityProvider} associated with this authentication scheme. - */ - @Override - default IdentityProvider identityProvider(IdentityProviderConfiguration providers) { - return providers.identityProvider(AwsCredentialsIdentity.class); - } - - /** - * Retrieve the {@link AwsS3V4HttpSigner} associated with this authentication scheme. - */ - @Override - default AwsS3V4HttpSigner signer() { - return AwsS3V4HttpSigner.create(); - } -} diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4HttpSigner.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4HttpSigner.java deleted file mode 100644 index e786edaace06..000000000000 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsS3V4HttpSigner.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.aws.internal.signer.SignerLoader; -import software.amazon.awssdk.http.auth.spi.HttpSigner; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; - -/** - * An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}), - * specifically for S3. - * TODO: Delete this interface once auth-scheme is cleaned up. - */ -@SdkPublicApi -public interface AwsS3V4HttpSigner extends HttpSigner { - - /** - * Get a default implementation of a {@link AwsS3V4HttpSigner} - * - * @return AwsS3V4HttpSigner - */ - static AwsS3V4HttpSigner create() { - return SignerLoader.getS3SigV4aSigner(); - } -} diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryAuthScheme.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryAuthScheme.java deleted file mode 100644 index 8e7f02471d78..000000000000 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryAuthScheme.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.spi.AuthScheme; -import software.amazon.awssdk.http.auth.spi.IdentityProviderConfiguration; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; -import software.amazon.awssdk.identity.spi.IdentityProvider; - -/** - * The aws.auth#sigv4 auth scheme, which uses a - * {@link AwsCredentialsIdentity} and {@link AwsV4QueryHttpSigner}. - */ -@SdkPublicApi -public interface AwsV4QueryAuthScheme extends AuthScheme { - - /** - * Get a default implementation of a {@link AwsV4QueryAuthScheme} - */ - static AwsV4QueryAuthScheme create() { - return new AwsV4QueryAuthScheme() { - }; - } - - /** - * Retrieve the scheme ID. - */ - @Override - default String schemeId() { - return "aws.auth#sigv4"; - } - - /** - * Retrieve the {@link AwsCredentialsIdentity} based {@link IdentityProvider} associated with this authentication scheme. - */ - @Override - default IdentityProvider identityProvider(IdentityProviderConfiguration providers) { - return providers.identityProvider(AwsCredentialsIdentity.class); - } - - /** - * Retrieve the {@link AwsV4QueryHttpSigner} associated with this authentication scheme. - */ - @Override - default AwsV4QueryHttpSigner signer() { - return AwsV4QueryHttpSigner.create(); - } -} diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryHttpSigner.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryHttpSigner.java deleted file mode 100644 index 6467ca1d0932..000000000000 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4QueryHttpSigner.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -package software.amazon.awssdk.http.auth.aws; - -import software.amazon.awssdk.annotations.SdkPublicApi; -import software.amazon.awssdk.http.auth.spi.HttpSigner; -import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; - -/** - * An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}), specifically for - * query. - *

- * The process for signing requests to AWS services is documented - * here. - *

- * TODO: Delete this interface once auth-scheme is cleaned up. - */ -@SdkPublicApi -public interface AwsV4QueryHttpSigner extends AwsV4HttpSigner { - - /** - * Get a default implementation of a {@link AwsV4QueryHttpSigner} - * - * @return DefaultAwsV4QueryHttpSigner - */ - static AwsV4QueryHttpSigner create() { - return null; - } -} diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java index 80c749e749d8..4c38afc36a6f 100644 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java +++ b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java @@ -20,7 +20,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import software.amazon.awssdk.annotations.SdkInternalApi; -import software.amazon.awssdk.http.auth.aws.AwsS3V4HttpSigner; import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; import software.amazon.awssdk.http.auth.spi.HttpSigner; import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; @@ -38,11 +37,7 @@ private SignerLoader() { } public static AwsV4aHttpSigner getSigV4aSigner() { - return get(AwsV4aHttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.AwsCrtV4aHttpSigner"); - } - - public static AwsS3V4HttpSigner getS3SigV4aSigner() { - return get(AwsS3V4HttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.AwsCrtS3V4aHttpSigner"); + return get(AwsV4aHttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.internal.signer.DefaultAwsCrtV4aHttpSigner"); } @SuppressWarnings("unchecked") From 50475c214d496c1857b61acc836c27911fa31771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Tue, 29 Aug 2023 13:43:50 -0700 Subject: [PATCH 2/4] Add used but undeclared dependencies --- core/http-auth-aws-crt/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/http-auth-aws-crt/pom.xml b/core/http-auth-aws-crt/pom.xml index d6f59ea0915c..6fb73bd7c704 100644 --- a/core/http-auth-aws-crt/pom.xml +++ b/core/http-auth-aws-crt/pom.xml @@ -54,6 +54,16 @@ http-auth-aws ${awsjavasdk.version} + + software.amazon.awssdk + http-client-spi + ${awsjavasdk.version} + + + software.amazon.awssdk + utils + ${awsjavasdk.version} + software.amazon.awssdk.crt aws-crt From 26b6cb4648413245a6991feecf0e827b5b329e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Tue, 29 Aug 2023 15:32:01 -0700 Subject: [PATCH 3/4] Address some PR comments --- .../aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java | 4 ++-- .../amazon/awssdk/http/auth/aws/AwsV4aHttpSigner.java | 2 +- .../awssdk/http/auth/aws/internal/signer/SignerLoader.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java index 9b1806c000c9..91a8a11f50d6 100644 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java +++ b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java @@ -23,7 +23,7 @@ import java.time.Clock; import java.time.Duration; import java.util.concurrent.CompletableFuture; -import software.amazon.awssdk.annotations.SdkInternalApi; +import software.amazon.awssdk.annotations.SdkProtectedApi; import software.amazon.awssdk.crt.auth.signing.AwsSigner; import software.amazon.awssdk.crt.auth.signing.AwsSigningConfig; import software.amazon.awssdk.crt.auth.signing.AwsSigningResult; @@ -44,7 +44,7 @@ * An implementation of a {@link AwsV4aHttpSigner} that uses properties to compose v4a-signers in order to delegate signing of a * request and payload (if applicable) accordingly. */ -@SdkInternalApi +@SdkProtectedApi public final class DefaultAwsCrtV4aHttpSigner implements AwsV4aHttpSigner { /** diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4aHttpSigner.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4aHttpSigner.java index 77110bf8b9fe..efc47cb7483e 100644 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4aHttpSigner.java +++ b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/AwsV4aHttpSigner.java @@ -89,7 +89,7 @@ public interface AwsV4aHttpSigner extends HttpSigner { * Get a default implementation of a {@link AwsV4aHttpSigner} */ static AwsV4aHttpSigner create() { - return SignerLoader.getSigV4aSigner(); + return SignerLoader.getAwsV4aHttpSigner(); } /** diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java index 4c38afc36a6f..759e27975e97 100644 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java +++ b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java @@ -19,7 +19,7 @@ import java.lang.reflect.Method; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import software.amazon.awssdk.annotations.SdkInternalApi; +import software.amazon.awssdk.annotations.SdkProtectedApi; import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; import software.amazon.awssdk.http.auth.spi.HttpSigner; import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; @@ -28,7 +28,7 @@ /** * Utility class for instantiating signers only if they're available on the class path. */ -@SdkInternalApi +@SdkProtectedApi public final class SignerLoader { private static final Map> SIGNERS = new ConcurrentHashMap<>(); @@ -36,7 +36,7 @@ public final class SignerLoader { private SignerLoader() { } - public static AwsV4aHttpSigner getSigV4aSigner() { + public static AwsV4aHttpSigner getAwsV4aHttpSigner() { return get(AwsV4aHttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.internal.signer.DefaultAwsCrtV4aHttpSigner"); } From 04b3c7870a0fe067f1a6e3a8d94997ab70e10ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Tue, 29 Aug 2023 16:23:31 -0700 Subject: [PATCH 4/4] Address PR comments --- .../{internal/signer => }/DefaultAwsCrtV4aHttpSigner.java | 4 +++- .../signer => }/DefaultAwsCrtV4aHttpSignerTest.java | 3 +-- .../awssdk/http/auth/aws/internal/signer/SignerLoader.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) rename core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/{internal/signer => }/DefaultAwsCrtV4aHttpSigner.java (97%) rename core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/{internal/signer => }/DefaultAwsCrtV4aHttpSignerTest.java (98%) diff --git a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSigner.java similarity index 97% rename from core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java rename to core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSigner.java index 91a8a11f50d6..6bfb3c9d04e5 100644 --- a/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSigner.java +++ b/core/http-auth-aws-crt/src/main/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSigner.java @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.awssdk.http.auth.aws.crt.internal.signer; +package software.amazon.awssdk.http.auth.aws.crt; import static software.amazon.awssdk.http.auth.aws.crt.internal.CrtHttpRequestConverter.toRequest; import static software.amazon.awssdk.http.auth.aws.crt.internal.CrtUtils.sanitizeRequest; @@ -31,6 +31,8 @@ import software.amazon.awssdk.http.ContentStreamProvider; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; +import software.amazon.awssdk.http.auth.aws.crt.internal.signer.V4aContext; +import software.amazon.awssdk.http.auth.aws.crt.internal.signer.V4aPayloadSigner; import software.amazon.awssdk.http.auth.aws.util.CredentialUtils; import software.amazon.awssdk.http.auth.spi.AsyncSignRequest; import software.amazon.awssdk.http.auth.spi.AsyncSignedRequest; diff --git a/core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java b/core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSignerTest.java similarity index 98% rename from core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java rename to core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSignerTest.java index d9cc8899d9c0..50ffa09d9a0b 100644 --- a/core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java +++ b/core/http-auth-aws-crt/src/test/java/software/amazon/awssdk/http/auth/aws/crt/DefaultAwsCrtV4aHttpSignerTest.java @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.awssdk.http.auth.aws.crt.internal.signer; +package software.amazon.awssdk.http.auth.aws.crt; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; @@ -28,7 +28,6 @@ import java.time.Duration; import org.junit.jupiter.api.Test; import software.amazon.awssdk.crt.auth.signing.AwsSigningConfig; -import software.amazon.awssdk.http.auth.aws.crt.TestUtils; import software.amazon.awssdk.http.auth.spi.AsyncSignRequest; import software.amazon.awssdk.http.auth.spi.SyncSignRequest; import software.amazon.awssdk.http.auth.spi.SyncSignedRequest; diff --git a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java index 759e27975e97..6b9f5022f14a 100644 --- a/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java +++ b/core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/SignerLoader.java @@ -19,7 +19,7 @@ import java.lang.reflect.Method; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import software.amazon.awssdk.annotations.SdkProtectedApi; +import software.amazon.awssdk.annotations.SdkInternalApi; import software.amazon.awssdk.http.auth.aws.AwsV4aHttpSigner; import software.amazon.awssdk.http.auth.spi.HttpSigner; import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity; @@ -28,7 +28,7 @@ /** * Utility class for instantiating signers only if they're available on the class path. */ -@SdkProtectedApi +@SdkInternalApi public final class SignerLoader { private static final Map> SIGNERS = new ConcurrentHashMap<>(); @@ -37,7 +37,7 @@ private SignerLoader() { } public static AwsV4aHttpSigner getAwsV4aHttpSigner() { - return get(AwsV4aHttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.internal.signer.DefaultAwsCrtV4aHttpSigner"); + return get(AwsV4aHttpSigner.class, "software.amazon.awssdk.http.auth.aws.crt.DefaultAwsCrtV4aHttpSigner"); } @SuppressWarnings("unchecked")