Skip to content

Commit

Permalink
fix s3 copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Dec 21, 2023
1 parent 9abd257 commit f2d85ab
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 7 deletions.
4 changes: 2 additions & 2 deletions generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ const char* S3CrtClient::ALLOCATION_TAG = "S3CrtClient";
S3CrtClient::S3CrtClient(const S3CrtClient &rhs) :
BASECLASS(rhs.m_clientConfiguration,
Aws::MakeShared<Aws::Auth::S3ExpressSignerProvider>(ALLOCATION_TAG,
Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
Aws::MakeShared<DefaultS3ExpressIdentityProvider>(ALLOCATION_TAG, *this),
rhs.GetCredentialsProvider(),
rhs.m_clientConfiguration.identityProviderSupplier(*this),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(rhs.m_clientConfiguration.region),
rhs.m_clientConfiguration.payloadSigningPolicy,
Expand Down
2 changes: 1 addition & 1 deletion generated/src/aws-cpp-sdk-s3/source/S3Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const char* S3Client::ALLOCATION_TAG = "S3Client";
S3Client::S3Client(const S3Client &rhs) :
BASECLASS(rhs.m_clientConfiguration,
Aws::MakeShared<Aws::Auth::S3ExpressSignerProvider>(ALLOCATION_TAG,
Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
rhs.GetCredentialsProvider(),
rhs.m_clientConfiguration.identityProviderSupplier(*this),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(rhs.m_clientConfiguration.region),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ namespace Aws
namespace Auth
{
class AWSCredentialsProvider;
class DefaultAWSCredentialsProviderChain;

class AWS_CORE_API AWSAuthSignerProvider
{
public:
virtual std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const = 0;
virtual void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) = 0;
virtual std::shared_ptr<AWSCredentialsProvider> GetCredentialsProvider() const;
virtual ~AWSAuthSignerProvider() = default;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ namespace Aws
explicit DefaultAuthSignerProvider(const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer);
void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) override;
std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const override;
std::shared_ptr<AWSCredentialsProvider> GetCredentialsProvider() const override { return m_credentialsProvider; }
protected:
Aws::Vector<std::shared_ptr<Aws::Client::AWSAuthSigner>> m_signers;
std::shared_ptr<AWSCredentialsProvider> m_credentialsProvider;
};
}
}
4 changes: 4 additions & 0 deletions src/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ namespace Aws
Aws::Client::AWSAuthSigner* GetSignerByName(const char* name) const;

friend Aws::Client::AWSAuthSigner* AWSUrlPresigner::GetSignerByName(const char* name) const;

std::shared_ptr<Auth::AWSCredentialsProvider> GetCredentialsProvider() const {
return m_signerProvider->GetCredentialsProvider();
}
protected:

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/auth/signer-provider/AWSAuthSignerProviderBase.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>

using namespace Aws::Auth;

std::shared_ptr<AWSCredentialsProvider> AWSAuthSignerProvider::GetCredentialsProvider() const {
return MakeShared<DefaultAWSCredentialsProviderChain>("AWSAuthSignerProvider");
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const char CLASS_TAG[] = "AuthSignerProvider";
using namespace Aws::Auth;

DefaultAuthSignerProvider::DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
const Aws::String& serviceName, const Aws::String& region, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signingPolicy, bool urlEscapePath)
const Aws::String& serviceName,
const Aws::String& region,
Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signingPolicy,
bool urlEscapePath):
m_credentialsProvider(credentialsProvider)
{
m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region, signingPolicy, urlEscapePath, AWSSigningAlgorithm::SIGV4));
m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region, signingPolicy, urlEscapePath, AWSSigningAlgorithm::ASYMMETRIC_SIGV4));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
${className}::${className}(const ${className} &rhs) :
BASECLASS(rhs.m_clientConfiguration,
Aws::MakeShared<${signerToMake}>(ALLOCATION_TAG,
${defaultCredentialsProviderChainParam},
rhs.GetCredentialsProvider(),
rhs.m_clientConfiguration.identityProviderSupplier(*this),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(rhs.m_clientConfiguration.region),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
${className}::${className}(const ${className} &rhs) :
BASECLASS(rhs.m_clientConfiguration,
Aws::MakeShared<Aws::Auth::S3ExpressSignerProvider>(ALLOCATION_TAG,
Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
Aws::MakeShared<DefaultS3ExpressIdentityProvider>(ALLOCATION_TAG, *this),
rhs.GetCredentialsProvider(),
rhs.m_clientConfiguration.identityProviderSupplier(*this),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(rhs.m_clientConfiguration.region),
rhs.m_clientConfiguration.payloadSigningPolicy,
Expand Down

0 comments on commit f2d85ab

Please sign in to comment.