-
Notifications
You must be signed in to change notification settings - Fork 853
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add s3 express suppport for AWS CRT-based S3 Client (#4723)
* Integrate with CRT S3 express support * Add integ tests * Fix test
- Loading branch information
Showing
10 changed files
with
327 additions
and
105 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changes/next-release/feature-AWSCRTbasedS3client-153faa9.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS CRT-based S3 client", | ||
"contributor": "", | ||
"description": "Add S3 express support for the AWS CRT-based S3 client." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...main/java/software/amazon/awssdk/services/s3/internal/crt/CrtS3ExpressNoOpAuthScheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* 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.services.s3.internal.crt; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.http.auth.spi.signer.AsyncSignRequest; | ||
import software.amazon.awssdk.http.auth.spi.signer.AsyncSignedRequest; | ||
import software.amazon.awssdk.http.auth.spi.signer.HttpSigner; | ||
import software.amazon.awssdk.http.auth.spi.signer.SignRequest; | ||
import software.amazon.awssdk.http.auth.spi.signer.SignedRequest; | ||
import software.amazon.awssdk.identity.spi.IdentityProvider; | ||
import software.amazon.awssdk.identity.spi.IdentityProviders; | ||
import software.amazon.awssdk.identity.spi.ResolveIdentityRequest; | ||
import software.amazon.awssdk.services.s3.s3express.S3ExpressAuthScheme; | ||
import software.amazon.awssdk.services.s3.s3express.S3ExpressSessionCredentials; | ||
|
||
/** | ||
* An implementation of {@link S3ExpressAuthScheme} that returns a noop {@link IdentityProvider}. | ||
*/ | ||
@SdkInternalApi | ||
public final class CrtS3ExpressNoOpAuthScheme implements S3ExpressAuthScheme { | ||
@Override | ||
public String schemeId() { | ||
return S3ExpressAuthScheme.SCHEME_ID; | ||
} | ||
|
||
@Override | ||
public IdentityProvider<S3ExpressSessionCredentials> identityProvider(IdentityProviders providers) { | ||
return NoOpIdentityProvider.INSTANCE; | ||
} | ||
|
||
@Override | ||
public HttpSigner<S3ExpressSessionCredentials> signer() { | ||
return NoOpSigner.INSTANCE; | ||
} | ||
|
||
private static final class NoOpIdentityProvider implements IdentityProvider<S3ExpressSessionCredentials> { | ||
private static final NoOpIdentityProvider INSTANCE = new NoOpIdentityProvider(); | ||
|
||
@Override | ||
public Class<S3ExpressSessionCredentials> identityType() { | ||
return S3ExpressSessionCredentials.class; | ||
} | ||
|
||
@Override | ||
public CompletableFuture<? extends S3ExpressSessionCredentials> resolveIdentity(ResolveIdentityRequest request) { | ||
return CompletableFuture.completedFuture(null); | ||
} | ||
} | ||
|
||
private static final class NoOpSigner implements HttpSigner<S3ExpressSessionCredentials> { | ||
private static final NoOpSigner INSTANCE = new NoOpSigner(); | ||
|
||
@Override | ||
public SignedRequest sign(SignRequest<? extends S3ExpressSessionCredentials> request) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<AsyncSignedRequest> signAsync(AsyncSignRequest<? extends S3ExpressSessionCredentials> request) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.