Skip to content

Commit

Permalink
Merge customizations for service s3
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-cpp-automation committed Nov 28, 2023
1 parent c9fa804 commit 1a4150c
Show file tree
Hide file tree
Showing 888 changed files with 70,524 additions and 25,335 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// Aws common runtime API
"Mtls",
// Opentelemetry
"Otel", "opentelemetry", "nostd", "OPTEL", "tparam"
"Otel", "opentelemetry", "nostd", "OPTEL", "tparam","OTLP"
],
"ignoreWords": [
// variables defined in ConcurrentStreamBuf
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release
*#
*.iml
tags
.vscode

# CI Artifacts
BuildSpec.json
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if (LEGACY_BUILD)
option(BUILD_BENCHMARKS "Enables building the benchmark executable" OFF)
option(BUILD_OPTEL "Enables building the open telemetry implementation of tracing" OFF)
option(AWS_SDK_WARNINGS_ARE_ERRORS "Compiler warning is treated as an error. Try turning this off when observing errors on a new or uncommon compiler" ON)
option(BUILD_OPTEL_OTLP_BENCHMARKS "Enables building the benchmark tests with open telemetry OTLP clients" OFF)
option(USE_TLS_V1_2 "Set http client to enforce TLS 1.2" ON)
option(USE_TLS_V1_3 "Set http client to enforce TLS 1.3" OFF)

Expand Down
6 changes: 6 additions & 0 deletions cmake/external_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ endif()
if (BUILD_OPTEL)
find_package(opentelemetry-cpp CONFIG REQUIRED)
endif ()
if (BUILD_OPTEL_OTLP_BENCHMARKS)
find_package(Protobuf REQUIRED)
find_package(CURL REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(opentelemetry-cpp CONFIG REQUIRED)
endif ()

if (EXTERNAL_DEPS_INCLUDE_DIRS)
List(REMOVE_DUPLICATES EXTERNAL_DEPS_INCLUDE_DIRS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ namespace Aws
partSize(5 * 1024 * 1024),
throughputTargetGbps(2.0) {}

ClientConfiguration(const S3Crt::ClientConfiguration& other,
Client::AWSAuthV4Signer::PayloadSigningPolicy iPayloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
bool iUseVirtualAddressing = true,
US_EAST_1_REGIONAL_ENDPOINT_OPTION iUseUSEast1RegionalEndPointOption = US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET):
S3CrtClientConfiguration(other, iPayloadSigningPolicy,iUseVirtualAddressing, iUseUSEast1RegionalEndPointOption),
clientBootstrap(other.clientBootstrap),
partSize(other.partSize),
tlsConnectionOptions(other.tlsConnectionOptions),
throughputTargetGbps(other.throughputTargetGbps),
downloadMemoryUsageWindow(other.downloadMemoryUsageWindow),
clientShutdownCallback(other.clientShutdownCallback),
shutdownCallbackUserData(other.shutdownCallbackUserData)
{}

ClientConfiguration& operator=(const ClientConfiguration& other) = default;

/** Client bootstrap used for common staples such as event loop group, host resolver, etc..
* If this is nullptr, SDK will create a default one for you.
*/
Expand Down
2,697 changes: 1,681 additions & 1,016 deletions generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtClient.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include <aws/s3-crt/S3Crt_EXPORTS.h>
#include <aws/s3-crt/S3ExpressIdentityProvider.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/core/auth/signer/AWSAuthV4Signer.h>

Expand Down Expand Up @@ -56,6 +57,11 @@ namespace Aws
bool disableMultiRegionAccessPoints = false;
bool useArnRegion = false;
Client::AWSAuthV4Signer::PayloadSigningPolicy payloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::RequestDependent;
bool disableS3ExpressAuth = false;
using IdentityProviderSupplier = std::function<std::shared_ptr<S3ExpressIdentityProvider> (const S3CrtClient &)>;
IdentityProviderSupplier identityProviderSupplier = [](const S3CrtClient &client) -> std::shared_ptr<S3ExpressIdentityProvider> {
return Aws::MakeShared<DefaultS3ExpressIdentityProvider>("S3CrtClientConfiguration", client);
};
private:
void LoadS3CrtSpecificConfig(const Aws::String& profileName);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class AWS_S3CRT_API S3CrtClientContextParameters : public Aws::Endpoint::ClientC
*/
void SetAccelerate(bool value);
const ClientContextParameters::EndpointParameter& GetAccelerate() const;

/**
* Disables this client's usage of Session Auth for S3Express
buckets and reverts to using conventional SigV4 for those.
*/
void SetDisableS3ExpressSessionAuth(bool value);
const ClientContextParameters::EndpointParameter& GetDisableS3ExpressSessionAuth() const;
};

class AWS_S3CRT_API S3CrtBuiltInParameters : public Aws::Endpoint::BuiltInParameters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/s3/s3express_credentials_provider.h>
#include <aws/s3-crt/S3ExpressIdentityProvider.h>

namespace Aws {
namespace S3Crt {
/**
* Factory for a CRT aws_s3express_credentials_provider. Cannot subclass or instantiate,
* only for building a crt provider to be used in crt configuration.
*/
class S3CrtIdentityProviderAdapter final {
public:
S3CrtIdentityProviderAdapter() = delete;
S3CrtIdentityProviderAdapter(const S3CrtIdentityProviderAdapter &other) = delete;
S3CrtIdentityProviderAdapter(S3CrtIdentityProviderAdapter &&other) noexcept = delete;
S3CrtIdentityProviderAdapter& operator=(const S3CrtIdentityProviderAdapter &other) = delete;
S3CrtIdentityProviderAdapter& operator=(S3CrtIdentityProviderAdapter &&other) noexcept = delete;

/**
* Returns a c style function pointer that can be used in CRT configuration for
* the delegation of the identity provider for S3 Express requests.
*/
static aws_s3express_credentials_provider* ProviderFactory(struct aws_allocator* allocator,
struct aws_s3_client* client,
aws_simple_completion_callback on_provider_shutdown_callback,
void* shutdown_user_data,
void* factory_user_data);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <aws/s3-crt/model/CopyObjectResult.h>
#include <aws/s3-crt/model/CreateBucketResult.h>
#include <aws/s3-crt/model/CreateMultipartUploadResult.h>
#include <aws/s3-crt/model/CreateSessionResult.h>
#include <aws/s3-crt/model/DeleteObjectResult.h>
#include <aws/s3-crt/model/DeleteObjectTaggingResult.h>
#include <aws/s3-crt/model/DeleteObjectsResult.h>
Expand Down Expand Up @@ -55,12 +56,14 @@
#include <aws/s3-crt/model/GetObjectTaggingResult.h>
#include <aws/s3-crt/model/GetObjectTorrentResult.h>
#include <aws/s3-crt/model/GetPublicAccessBlockResult.h>
#include <aws/s3-crt/model/HeadBucketResult.h>
#include <aws/s3-crt/model/HeadObjectResult.h>
#include <aws/s3-crt/model/ListBucketAnalyticsConfigurationsResult.h>
#include <aws/s3-crt/model/ListBucketIntelligentTieringConfigurationsResult.h>
#include <aws/s3-crt/model/ListBucketInventoryConfigurationsResult.h>
#include <aws/s3-crt/model/ListBucketMetricsConfigurationsResult.h>
#include <aws/s3-crt/model/ListBucketsResult.h>
#include <aws/s3-crt/model/ListDirectoryBucketsResult.h>
#include <aws/s3-crt/model/ListMultipartUploadsResult.h>
#include <aws/s3-crt/model/ListObjectVersionsResult.h>
#include <aws/s3-crt/model/ListObjectsResult.h>
Expand Down Expand Up @@ -120,6 +123,7 @@ namespace Aws
class CopyObjectRequest;
class CreateBucketRequest;
class CreateMultipartUploadRequest;
class CreateSessionRequest;
class DeleteBucketRequest;
class DeleteBucketAnalyticsConfigurationRequest;
class DeleteBucketCorsRequest;
Expand Down Expand Up @@ -172,6 +176,7 @@ namespace Aws
class ListBucketIntelligentTieringConfigurationsRequest;
class ListBucketInventoryConfigurationsRequest;
class ListBucketMetricsConfigurationsRequest;
class ListDirectoryBucketsRequest;
class ListMultipartUploadsRequest;
class ListObjectVersionsRequest;
class ListObjectsRequest;
Expand Down Expand Up @@ -215,6 +220,7 @@ namespace Aws
typedef Aws::Utils::Outcome<CopyObjectResult, S3CrtError> CopyObjectOutcome;
typedef Aws::Utils::Outcome<CreateBucketResult, S3CrtError> CreateBucketOutcome;
typedef Aws::Utils::Outcome<CreateMultipartUploadResult, S3CrtError> CreateMultipartUploadOutcome;
typedef Aws::Utils::Outcome<CreateSessionResult, S3CrtError> CreateSessionOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, S3CrtError> DeleteBucketOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, S3CrtError> DeleteBucketAnalyticsConfigurationOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, S3CrtError> DeleteBucketCorsOutcome;
Expand Down Expand Up @@ -261,13 +267,14 @@ namespace Aws
typedef Aws::Utils::Outcome<GetObjectTaggingResult, S3CrtError> GetObjectTaggingOutcome;
typedef Aws::Utils::Outcome<GetObjectTorrentResult, S3CrtError> GetObjectTorrentOutcome;
typedef Aws::Utils::Outcome<GetPublicAccessBlockResult, S3CrtError> GetPublicAccessBlockOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, S3CrtError> HeadBucketOutcome;
typedef Aws::Utils::Outcome<HeadBucketResult, S3CrtError> HeadBucketOutcome;
typedef Aws::Utils::Outcome<HeadObjectResult, S3CrtError> HeadObjectOutcome;
typedef Aws::Utils::Outcome<ListBucketAnalyticsConfigurationsResult, S3CrtError> ListBucketAnalyticsConfigurationsOutcome;
typedef Aws::Utils::Outcome<ListBucketIntelligentTieringConfigurationsResult, S3CrtError> ListBucketIntelligentTieringConfigurationsOutcome;
typedef Aws::Utils::Outcome<ListBucketInventoryConfigurationsResult, S3CrtError> ListBucketInventoryConfigurationsOutcome;
typedef Aws::Utils::Outcome<ListBucketMetricsConfigurationsResult, S3CrtError> ListBucketMetricsConfigurationsOutcome;
typedef Aws::Utils::Outcome<ListBucketsResult, S3CrtError> ListBucketsOutcome;
typedef Aws::Utils::Outcome<ListDirectoryBucketsResult, S3CrtError> ListDirectoryBucketsOutcome;
typedef Aws::Utils::Outcome<ListMultipartUploadsResult, S3CrtError> ListMultipartUploadsOutcome;
typedef Aws::Utils::Outcome<ListObjectVersionsResult, S3CrtError> ListObjectVersionsOutcome;
typedef Aws::Utils::Outcome<ListObjectsResult, S3CrtError> ListObjectsOutcome;
Expand Down Expand Up @@ -310,6 +317,7 @@ namespace Aws
typedef std::future<CompleteMultipartUploadOutcome> CompleteMultipartUploadOutcomeCallable;
typedef std::future<CreateBucketOutcome> CreateBucketOutcomeCallable;
typedef std::future<CreateMultipartUploadOutcome> CreateMultipartUploadOutcomeCallable;
typedef std::future<CreateSessionOutcome> CreateSessionOutcomeCallable;
typedef std::future<DeleteBucketOutcome> DeleteBucketOutcomeCallable;
typedef std::future<DeleteBucketAnalyticsConfigurationOutcome> DeleteBucketAnalyticsConfigurationOutcomeCallable;
typedef std::future<DeleteBucketCorsOutcome> DeleteBucketCorsOutcomeCallable;
Expand Down Expand Up @@ -362,6 +370,7 @@ namespace Aws
typedef std::future<ListBucketInventoryConfigurationsOutcome> ListBucketInventoryConfigurationsOutcomeCallable;
typedef std::future<ListBucketMetricsConfigurationsOutcome> ListBucketMetricsConfigurationsOutcomeCallable;
typedef std::future<ListBucketsOutcome> ListBucketsOutcomeCallable;
typedef std::future<ListDirectoryBucketsOutcome> ListDirectoryBucketsOutcomeCallable;
typedef std::future<ListMultipartUploadsOutcome> ListMultipartUploadsOutcomeCallable;
typedef std::future<ListObjectVersionsOutcome> ListObjectVersionsOutcomeCallable;
typedef std::future<ListObjectsOutcome> ListObjectsOutcomeCallable;
Expand Down Expand Up @@ -407,6 +416,7 @@ namespace Aws
typedef std::function<void(const S3CrtClient*, const Model::CopyObjectRequest&, const Model::CopyObjectOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CopyObjectResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::CreateBucketRequest&, const Model::CreateBucketOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateBucketResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::CreateMultipartUploadRequest&, const Model::CreateMultipartUploadOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateMultipartUploadResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::CreateSessionRequest&, const Model::CreateSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSessionResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::DeleteBucketRequest&, const Model::DeleteBucketOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBucketResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::DeleteBucketAnalyticsConfigurationRequest&, const Model::DeleteBucketAnalyticsConfigurationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBucketAnalyticsConfigurationResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::DeleteBucketCorsRequest&, const Model::DeleteBucketCorsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBucketCorsResponseReceivedHandler;
Expand Down Expand Up @@ -460,6 +470,7 @@ namespace Aws
typedef std::function<void(const S3CrtClient*, const Model::ListBucketInventoryConfigurationsRequest&, const Model::ListBucketInventoryConfigurationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListBucketInventoryConfigurationsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListBucketMetricsConfigurationsRequest&, const Model::ListBucketMetricsConfigurationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListBucketMetricsConfigurationsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListBucketsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListBucketsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListDirectoryBucketsRequest&, const Model::ListDirectoryBucketsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListDirectoryBucketsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListMultipartUploadsRequest&, const Model::ListMultipartUploadsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListMultipartUploadsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListObjectVersionsRequest&, const Model::ListObjectVersionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListObjectVersionsResponseReceivedHandler;
typedef std::function<void(const S3CrtClient*, const Model::ListObjectsRequest&, const Model::ListObjectsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListObjectsResponseReceivedHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>

#include <utility>

namespace Aws {
namespace S3Crt {
class S3ExpressIdentity final {
public:
S3ExpressIdentity() = default;

inline S3ExpressIdentity(String accessKeyId,
String secretKeyId,
String sessionToken,
const Utils::DateTime &expiration) :
m_accessKeyId(std::move(accessKeyId)),
m_secretKeyId(std::move(secretKeyId)),
m_sessionToken(std::move(sessionToken)),
m_expiration(expiration) {}

const String &getAccessKeyId() const {
return m_accessKeyId;
}

const String &getSecretKeyId() const {
return m_secretKeyId;
}

const String &getSessionToken() const {
return m_sessionToken;
}

const Utils::DateTime &getExpiration() const {
return m_expiration;
}


private:
Aws::String m_accessKeyId;
Aws::String m_secretKeyId;
Aws::String m_sessionToken;
Aws::Utils::DateTime m_expiration;
};
}
}
Loading

0 comments on commit 1a4150c

Please sign in to comment.