diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-02 12:50:27 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-02 12:50:27 +0300 |
commit | d0f80d5e60d77854f9d6262a59a7349e2b21f9d2 (patch) | |
tree | 01f1e033ce5519d96b7d6a83718221dcb8021eec /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws | |
parent | 26286f616cee657612a9d820be6da2cdbd4de0ef (diff) | |
download | ydb-d0f80d5e60d77854f9d6262a59a7349e2b21f9d2.tar.gz |
intermediate changes
ref:40ac71fae6ea311a73473cf4297ca93bf27559c3
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws')
12 files changed, 199 insertions, 4 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h index 4fcdb17779..7c2d7af53f 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h @@ -97,6 +97,10 @@ namespace Aws */ std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> md5Factory_create_fn; /** + * If set, this closure will be used to create and install the factory. + */ + std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> sha1Factory_create_fn; + /** * If set, this closure will be used to create and install the factory. */ std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> sha256Factory_create_fn; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h index 9304d56ee7..fd965734a6 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h @@ -3,4 +3,4 @@ * SPDX-License-Identifier: Apache-2.0. */ -#define AWS_SDK_VERSION_STRING "1.8.113" +#define AWS_SDK_VERSION_STRING "1.8.186" diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h new file mode 100644 index 0000000000..288beccb3b --- /dev/null +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h @@ -0,0 +1,48 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + + +#pragma once + +#include <aws/core/Core_EXPORTS.h> +#include <aws/core/auth/AWSCredentialsProvider.h> +#include <memory> + +namespace Aws { + namespace Auth { + /** + * To support usage of SSO credentials + */ + class AWS_CORE_API SSOCredentialsProvider : public AWSCredentialsProvider + { + public: + SSOCredentialsProvider(); + explicit SSOCredentialsProvider(const Aws::String& profile); + /** + * Retrieves the credentials if found, otherwise returns empty credential set. + */ + AWSCredentials GetAWSCredentials() override; + + private: + Aws::UniquePtr<Aws::Internal::SSOCredentialsClient> m_client; + Aws::Auth::AWSCredentials m_credentials; + + // Profile description variables + Aws::String m_profileToUse; + + // The AWS account ID that temporary AWS credentials are resolved for. + Aws::String m_ssoAccountId; + // The AWS region where the SSO directory for the given sso_start_url is hosted. + // This is independent of the general region configuration and MUST NOT be conflated. + Aws::String m_ssoRegion; + // The expiration time of the accessToken. + Aws::Utils::DateTime m_expiresAt; + + void Reload() override; + void RefreshIfExpired(); + Aws::String LoadAccessTokenFile(const Aws::String& ssoAccessTokenPath); + }; + } // namespace Auth +} // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h index c88c1bdd5d..39f033c3fc 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h @@ -56,8 +56,8 @@ namespace Aws m_errorType(errorType), m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(isRetryable), m_errorPayloadType(ErrorPayloadType::NOT_SET) {} - AWSError(AWSError&& rhs) = default; - AWSError(const AWSError& rhs) = default; + AWSError(AWSError&&) = default; + AWSError(const AWSError&) = default; template<typename OTHER_ERROR_TYPE> AWSError(AWSError<OTHER_ERROR_TYPE>&& rhs) : diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h index ba54baaa83..69c2166a6e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h @@ -10,6 +10,7 @@ #include <aws/core/Region.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/http/HttpTypes.h> +#include <aws/core/utils/Array.h> #include <memory> namespace Aws @@ -165,6 +166,10 @@ namespace Aws */ Aws::String proxySSLKeyPassword; /** + * Calls to hosts in this vector will not use proxy configuration + */ + Aws::Utils::Array<Aws::String> nonProxyHosts; + /** * Threading Executor implementation. Default uses std::thread::detach() */ std::shared_ptr<Aws::Utils::Threading::Executor> executor; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h index 84c62713da..ee467c5640 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h @@ -36,6 +36,14 @@ namespace Aws inline void SetRoleArn(const Aws::String& value) { m_roleArn = value; } inline const Aws::String& GetExternalId() const { return m_externalId; } inline void SetExternalId(const Aws::String& value) { m_externalId = value; } + inline const Aws::String& GetSsoStartUrl() const { return m_ssoStartUrl; } + inline void SetSsoStartUrl(const Aws::String& value) { m_ssoStartUrl = value; } + inline const Aws::String& GetSsoRegion() const { return m_ssoRegion; } + inline void SetSsoRegion(const Aws::String& value) { m_ssoRegion = value; } + inline const Aws::String& GetSsoAccountId() const { return m_ssoAccountId; } + inline void SetSsoAccountId(const Aws::String& value) { m_ssoAccountId = value; } + inline const Aws::String& GetSsoRoleName() const { return m_ssoRoleName; } + inline void SetSsoRoleName(const Aws::String& value) { m_ssoRoleName = value; } inline const Aws::String& GetSourceProfile() const { return m_sourceProfile; } inline void SetSourceProfile(const Aws::String& value ) { m_sourceProfile = value; } inline const Aws::String& GetCredentialProcess() const { return m_credentialProcess; } @@ -56,6 +64,10 @@ namespace Aws Aws::String m_externalId; Aws::String m_sourceProfile; Aws::String m_credentialProcess; + Aws::String m_ssoStartUrl; + Aws::String m_ssoRegion; + Aws::String m_ssoAccountId; + Aws::String m_ssoRoleName; Aws::Map<Aws::String, Aws::String> m_allKeyValPairs; }; @@ -156,7 +168,6 @@ namespace Aws protected: virtual bool LoadInternal() override; - private: std::shared_ptr<Aws::Internal::EC2MetadataClient> m_ec2metadataClient; }; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h index 31f96befd5..d706405add 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h @@ -60,6 +60,7 @@ private: Aws::String m_proxySSLKeyType; Aws::String m_proxyKeyPasswd; unsigned m_proxyPort; + Aws::String m_nonProxyHosts; bool m_verifySSL; Aws::String m_caPath; Aws::String m_caFile; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h index c58a1b70bf..bc28cd8861 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h @@ -221,5 +221,36 @@ namespace Aws private: Aws::String m_endpoint; }; + + /** + * To support retrieving credentials from SSO. + */ + class AWS_CORE_API SSOCredentialsClient : public AWSHttpResourceClient + { + public: + SSOCredentialsClient(const Client::ClientConfiguration& clientConfiguration); + + SSOCredentialsClient& operator =(SSOCredentialsClient& rhs) = delete; + SSOCredentialsClient(const SSOCredentialsClient& rhs) = delete; + SSOCredentialsClient& operator =(SSOCredentialsClient&& rhs) = delete; + SSOCredentialsClient(SSOCredentialsClient&& rhs) = delete; + + struct SSOGetRoleCredentialsRequest + { + Aws::String m_ssoAccountId; + Aws::String m_ssoRoleName; + Aws::String m_accessToken; + }; + + struct SSOGetRoleCredentialsResult + { + Aws::Auth::AWSCredentials creds; + }; + + SSOGetRoleCredentialsResult GetSSOCredentials(const SSOGetRoleCredentialsRequest& request); + + private: + Aws::String m_endpoint; + }; } // namespace Internal } // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h index 48c04daf59..465c9827b2 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h @@ -68,6 +68,16 @@ namespace Aws static ByteBuffer CalculateSHA256TreeHash(Aws::IOStream& stream); /** + * Calculates a SHA1 Hash digest (not hex encoded) + */ + static ByteBuffer CalculateSHA1(const Aws::String& str); + + /** + * Calculates a SHA1 Hash digest on a stream (the entire stream is read, not hex encoded.) + */ + static ByteBuffer CalculateSHA1(Aws::IOStream& stream); + + /** * Calculates a MD5 Hash value */ static ByteBuffer CalculateMD5(const Aws::String& str); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h index b4c17b2a96..a219d3eae5 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h @@ -44,6 +44,10 @@ namespace Aws */ AWS_CORE_API std::shared_ptr<Hash> CreateMD5Implementation(); /** + * Create a Sha1 Hash provider + */ + AWS_CORE_API std::shared_ptr<Hash> CreateSha1Implementation(); + /** * Create a Sha256 Hash provider */ AWS_CORE_API std::shared_ptr<Hash> CreateSha256Implementation(); @@ -114,6 +118,10 @@ namespace Aws */ AWS_CORE_API void SetMD5Factory(const std::shared_ptr<HashFactory>& factory); /** + * Set the global factory for Sha1 Hash providers + */ + AWS_CORE_API void SetSha1Factory(const std::shared_ptr<HashFactory>& factory); + /** * Set the global factory for Sha256 Hash providers */ AWS_CORE_API void SetSha256Factory(const std::shared_ptr<HashFactory>& factory); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha1.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha1.h new file mode 100644 index 0000000000..5d9d44f867 --- /dev/null +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha1.h @@ -0,0 +1,65 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* +* Interface for Sha1 encryptor +*/ +#pragma once + +#ifdef __APPLE__ + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif // __clang__ + +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif // __GNUC__ + +#endif // __APPLE__ + +#include <aws/core/Core_EXPORTS.h> + +#include <aws/core/utils/crypto/Hash.h> + +namespace Aws +{ + namespace Utils + { + namespace Crypto + { + class WindowsHashImpl; + + /** + * Sha1 hash implementation. + */ + class AWS_CORE_API Sha1 : public Hash + { + public: + /** + * Initializes platform crypto libs. + */ + Sha1(); + virtual ~Sha1(); + + /** + * Calculates a SHA1 Hash digest (not hex encoded) + */ + virtual HashResult Calculate(const Aws::String& str) override; + + /** + * Calculates a SHA1 Hash digest on a stream (the entire stream is read) + */ + virtual HashResult Calculate(Aws::IStream& stream) override; + + private: + + std::shared_ptr< Hash > m_hashImpl; + }; + + } // namespace Crypto + } // namespace Utils +} // namespace Aws + diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h index e3f37edda9..39f5e5fcd4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h @@ -70,6 +70,18 @@ namespace Aws }; + class Sha1OpenSSLImpl : public Hash + { + public: + + Sha1OpenSSLImpl() {} + virtual ~Sha1OpenSSLImpl() = default; + + virtual HashResult Calculate(const Aws::String& str) override; + + virtual HashResult Calculate(Aws::IStream& stream) override; + }; + class Sha256OpenSSLImpl : public Hash { public: |