diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws')
130 files changed, 2464 insertions, 2464 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h index f8a433ebca..2ba298546e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -14,12 +14,12 @@ namespace Aws { - static const char JSON_CONTENT_TYPE[] = "application/json"; - static const char AMZN_JSON_CONTENT_TYPE_1_0[] = "application/x-amz-json-1.0"; - static const char AMZN_JSON_CONTENT_TYPE_1_1[] = "application/x-amz-json-1.1"; - static const char FORM_CONTENT_TYPE[] = "application/x-www-form-urlencoded"; - static const char AMZN_XML_CONTENT_TYPE[] = "application/xml"; - static const char AMZN_EVENTSTREAM_CONTENT_TYPE[] = "application/vnd.amazon.eventstream"; + static const char JSON_CONTENT_TYPE[] = "application/json"; + static const char AMZN_JSON_CONTENT_TYPE_1_0[] = "application/x-amz-json-1.0"; + static const char AMZN_JSON_CONTENT_TYPE_1_1[] = "application/x-amz-json-1.1"; + static const char FORM_CONTENT_TYPE[] = "application/x-www-form-urlencoded"; + static const char AMZN_XML_CONTENT_TYPE[] = "application/xml"; + static const char AMZN_EVENTSTREAM_CONTENT_TYPE[] = "application/vnd.amazon.eventstream"; /** * High-level abstraction over AWS requests. GetBody() calls SerializePayload() and uses a stringbuf under the hood. diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h index 0af609359a..c267d06aaf 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -55,11 +55,11 @@ namespace Aws } /** - * AmazonStreamingWebServiceRequest always returns true. - */ - bool IsStreaming() const override { return true; } - - /** + * AmazonStreamingWebServiceRequest always returns true. + */ + bool IsStreaming() const override { return true; } + + /** * Get the user set contentType. Defaults to binary/octet-stream */ const Aws::String& GetContentType() const { return m_contentType; } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h index 0ff7b1317e..1fc7c0e7e0 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -28,7 +28,7 @@ namespace Aws * Closure definition for handling a retry notification. This is only for if you want to be notified that a particular request is being retried. */ typedef std::function<void(const AmazonWebServiceRequest&)> RequestRetryHandler; - typedef std::function<void(const Aws::Http::HttpRequest&)> RequestSignedHandler; + typedef std::function<void(const Aws::Http::HttpRequest&)> RequestSignedHandler; /** * Base level abstraction for all modeled AWS requests @@ -62,34 +62,34 @@ namespace Aws virtual void PutToPresignedUrl(Aws::Http::URI& uri) const { DumpBodyToUrl(uri); AddQueryStringParameters(uri); } /** - * Defaults to false, if this is set to true, it's a streaming request, which means the payload is not well structured bits. - */ - virtual bool IsStreaming() const { return false; } - - /** - * Defaults to false, if this is set to true in derived class, it's an event stream request, which means the payload is consisted by multiple structured events. - */ - inline virtual bool IsEventStreamRequest() const { return false; } - /** + * Defaults to false, if this is set to true, it's a streaming request, which means the payload is not well structured bits. + */ + virtual bool IsStreaming() const { return false; } + + /** + * Defaults to false, if this is set to true in derived class, it's an event stream request, which means the payload is consisted by multiple structured events. + */ + inline virtual bool IsEventStreamRequest() const { return false; } + /** * Defaults to true, if this is set to false, then signers, if they support body signing, will not do so */ virtual bool SignBody() const { return true; } /** - * Defaults to false, if this is set to true, it supports chunked transfer encoding. - */ - virtual bool IsChunked() const { return false; } - - /** - * Register closure for request signed event. - */ - inline virtual void SetRequestSignedHandler(const RequestSignedHandler& handler) { m_onRequestSigned = handler; } - /** - * Get closure for request signed event. - */ - inline virtual const RequestSignedHandler& GetRequestSignedHandler() const { return m_onRequestSigned; } - - /** + * Defaults to false, if this is set to true, it supports chunked transfer encoding. + */ + virtual bool IsChunked() const { return false; } + + /** + * Register closure for request signed event. + */ + inline virtual void SetRequestSignedHandler(const RequestSignedHandler& handler) { m_onRequestSigned = handler; } + /** + * Get closure for request signed event. + */ + inline virtual const RequestSignedHandler& GetRequestSignedHandler() const { return m_onRequestSigned; } + + /** * Retrieves the factory for creating response streams. */ const Aws::IOStreamFactory& GetResponseStreamFactory() const { return m_responseStreamFactory; } @@ -98,7 +98,7 @@ namespace Aws */ void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) { m_responseStreamFactory = factory; } /** - * Register closure for data received event. + * Register closure for data received event. */ inline virtual void SetDataReceivedEventHandler(const Aws::Http::DataReceivedEventHandler& dataReceivedEventHandler) { m_onDataReceived = dataReceivedEventHandler; } /** @@ -110,32 +110,32 @@ namespace Aws */ inline virtual void SetContinueRequestHandler(const Aws::Http::ContinueRequestHandler& continueRequestHandler) { m_continueRequest = continueRequestHandler; } /** - * Register closure for data received event. - */ + * Register closure for data received event. + */ inline virtual void SetDataReceivedEventHandler(Aws::Http::DataReceivedEventHandler&& dataReceivedEventHandler) { m_onDataReceived = std::move(dataReceivedEventHandler); } /** - * register closure for data sent event - */ + * register closure for data sent event + */ inline virtual void SetDataSentEventHandler(Aws::Http::DataSentEventHandler&& dataSentEventHandler) { m_onDataSent = std::move(dataSentEventHandler); } /** * Register closure for handling whether or not to cancel a request. */ inline virtual void SetContinueRequestHandler(Aws::Http::ContinueRequestHandler&& continueRequestHandler) { m_continueRequest = std::move(continueRequestHandler); } /** - * Register closure for notification that a request is being retried - */ + * Register closure for notification that a request is being retried + */ inline virtual void SetRequestRetryHandler(const RequestRetryHandler& handler) { m_requestRetryHandler = handler; } /** - * Register closure for notification that a request is being retried - */ + * Register closure for notification that a request is being retried + */ inline virtual void SetRequestRetryHandler(RequestRetryHandler&& handler) { m_requestRetryHandler = std::move(handler); } /** - * get closure for data received event. - */ + * get closure for data received event. + */ inline virtual const Aws::Http::DataReceivedEventHandler& GetDataReceivedEventHandler() const { return m_onDataReceived; } /** - * get closure for data sent event - */ + * get closure for data sent event + */ inline virtual const Aws::Http::DataSentEventHandler& GetDataSentEventHandler() const { return m_onDataSent; } /** * get closure for handling whether or not to cancel a request. @@ -165,7 +165,7 @@ namespace Aws Aws::Http::DataReceivedEventHandler m_onDataReceived; Aws::Http::DataSentEventHandler m_onDataSent; Aws::Http::ContinueRequestHandler m_continueRequest; - RequestSignedHandler m_onRequestSigned; + RequestSignedHandler m_onRequestSigned; RequestRetryHandler m_requestRetryHandler; }; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h index e72dec3f13..cde25d80f6 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -18,7 +18,7 @@ namespace Aws class AmazonWebServiceResult { public: - AmazonWebServiceResult() : m_responseCode(Http::HttpResponseCode::REQUEST_NOT_MADE) {} + AmazonWebServiceResult() : m_responseCode(Http::HttpResponseCode::REQUEST_NOT_MADE) {} /** * Sets payload, header collection and a response code. 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 4c9ed49fb9..4fcdb17779 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/utils/logging/LogLevel.h> @@ -76,7 +76,7 @@ namespace Aws bool initAndCleanupCurl; /** * Installs a global SIGPIPE handler that logs the error and prevents it from terminating the current process. - * This can be used on operating systems on which CURL is being used. In some situations CURL cannot avoid + * This can be used on operating systems on which CURL is being used. In some situations CURL cannot avoid * triggering a SIGPIPE. * For more information see: https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html * NOTE: CURLOPT_NOSIGNAL is already being set. @@ -126,19 +126,19 @@ namespace Aws std::function<std::shared_ptr<Aws::Utils::Crypto::SecureRandomFactory>()> secureRandomFactory_create_fn; /** * OpenSSL infects everything with its global state. If it is being used then we automatically initialize and clean it up. - * If this is a problem for you, set this to false. Be aware that if you don't use our init and cleanup and you are using + * If this is a problem for you, set this to false. Be aware that if you don't use our init and cleanup and you are using * crypto functionality, you are responsible for installing thread locking, and loading strings and error messages. */ bool initAndCleanupOpenSSL; }; /** - * MonitoringOptions is used to set up monitoring functionalities globally and(or) for users to customize monitoring listeners. + * MonitoringOptions is used to set up monitoring functionalities globally and(or) for users to customize monitoring listeners. */ struct MonitoringOptions { /** - * These factory functions will be used to try to create customized monitoring listener factories, then be used to create monitoring listener instances. + * These factory functions will be used to try to create customized monitoring listener factories, then be used to create monitoring listener instances. * Based on functions and factory's implementation, it may fail to create an instance. * If a function failed to create factory or a created factory failed to create an instance, SDK just ignore it. * By default, SDK will try to create a default Client Side Monitoring Listener. @@ -208,7 +208,7 @@ namespace Aws /** * Options used to set up customized monitoring implementations - * Put your monitoring factory in a closure (a create factory function) and put all closures in a vector. + * Put your monitoring factory in a closure (a create factory function) and put all closures in a vector. * Basic usage can be found in aws-cpp-sdk-core-tests/monitoring/MonitoringTest.cpp */ MonitoringOptions monitoringOptions; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h index 67029be06e..12e9dfc9be 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h @@ -1,13 +1,13 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/SDKConfig.h> -#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) +#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) #ifdef _MSC_VER #pragma warning(disable : 4251) #endif // _MSC_VER @@ -21,81 +21,81 @@ #else // USE_IMPORT_EXPORT #define AWS_CORE_API #endif // USE_IMPORT_EXPORT -#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) +#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) #define AWS_CORE_API -#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) - -#ifdef _MSC_VER - #define AWS_SUPPRESS_WARNING_PUSH(W) \ - __pragma(warning(push)) \ - __pragma(warning(disable:W)) - - #define AWS_SUPPRESS_WARNING_POP __pragma(warning(pop)) - - #define AWS_SUPPRESS_WARNING(W, ...) \ - AWS_SUPPRESS_WARNING_PUSH(W) \ - __VA_ARGS__; \ - AWS_SUPPRESS_WARNING_POP - - #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING(4996, __VA_ARGS__) - -#elif defined (__clang__) - #define DO_PRAGMA(x) _Pragma(#x) - - #define AWS_SUPPRESS_WARNING_PUSH(W) \ - DO_PRAGMA(clang diagnostic push) \ - DO_PRAGMA(clang diagnostic ignored W) - - #define AWS_SUPPRESS_WARNING_POP DO_PRAGMA(clang diagnostic pop) - - #define AWS_SUPPRESS_WARNING(W, ...) \ - AWS_SUPPRESS_WARNING_PUSH(W) \ - __VA_ARGS__; \ - AWS_SUPPRESS_WARNING_POP - - #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING("-Wdeprecated-declarations", __VA_ARGS__) - -#elif defined (__GNUC__) - #define DO_PRAGMA(x) _Pragma(#x) - - #define AWS_SUPPRESS_WARNING_PUSH(W) \ - DO_PRAGMA(GCC diagnostic push) \ - DO_PRAGMA(GCC diagnostic ignored W) - - #define AWS_SUPPRESS_WARNING_POP DO_PRAGMA(GCC diagnostic pop) - /** - * WRAP_() is a useless macro to get around GCC quirks related to expanding macros which includes _Pragma - * see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715271 - * and https://stackoverflow.com/questions/49698645/how-to-use-pragma-operator-in-macro - */ - #define WRAP_(W, ...) \ - W \ - __VA_ARGS__ \ - AWS_SUPPRESS_WARNING_POP - - #define AWS_SUPPRESS_WARNING(W, ...) WRAP_(AWS_SUPPRESS_WARNING_PUSH(W), __VA_ARGS__) - - #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING("-Wdeprecated-declarations", __VA_ARGS__) - -#else - #define AWS_SUPPRESS_WARNING(W, ...) __VAR_ARGS__ - #define AWS_SUPPRESS_WARNING_PUSH(W) - #define AWS_SUPPRESS_WARNING_POP - #define AWS_SUPPRESS_DEPRECATION(...) __VA_ARGS__ -#endif - -// Due to MSVC can't recognize base class deprecated function in derived class. -// We need AWS_DISABLE_DEPRECATION to make AWS_DEPRECATED useless only on MSVC -// Update: When deprecating a function/components, we won't remove the existing tests -// immediately, so we need AWS_DISABLE_DEPRECATION as well. -#if defined(AWS_DISABLE_DEPRECATION) +#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32) + +#ifdef _MSC_VER + #define AWS_SUPPRESS_WARNING_PUSH(W) \ + __pragma(warning(push)) \ + __pragma(warning(disable:W)) + + #define AWS_SUPPRESS_WARNING_POP __pragma(warning(pop)) + + #define AWS_SUPPRESS_WARNING(W, ...) \ + AWS_SUPPRESS_WARNING_PUSH(W) \ + __VA_ARGS__; \ + AWS_SUPPRESS_WARNING_POP + + #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING(4996, __VA_ARGS__) + +#elif defined (__clang__) + #define DO_PRAGMA(x) _Pragma(#x) + + #define AWS_SUPPRESS_WARNING_PUSH(W) \ + DO_PRAGMA(clang diagnostic push) \ + DO_PRAGMA(clang diagnostic ignored W) + + #define AWS_SUPPRESS_WARNING_POP DO_PRAGMA(clang diagnostic pop) + + #define AWS_SUPPRESS_WARNING(W, ...) \ + AWS_SUPPRESS_WARNING_PUSH(W) \ + __VA_ARGS__; \ + AWS_SUPPRESS_WARNING_POP + + #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING("-Wdeprecated-declarations", __VA_ARGS__) + +#elif defined (__GNUC__) + #define DO_PRAGMA(x) _Pragma(#x) + + #define AWS_SUPPRESS_WARNING_PUSH(W) \ + DO_PRAGMA(GCC diagnostic push) \ + DO_PRAGMA(GCC diagnostic ignored W) + + #define AWS_SUPPRESS_WARNING_POP DO_PRAGMA(GCC diagnostic pop) + /** + * WRAP_() is a useless macro to get around GCC quirks related to expanding macros which includes _Pragma + * see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715271 + * and https://stackoverflow.com/questions/49698645/how-to-use-pragma-operator-in-macro + */ + #define WRAP_(W, ...) \ + W \ + __VA_ARGS__ \ + AWS_SUPPRESS_WARNING_POP + + #define AWS_SUPPRESS_WARNING(W, ...) WRAP_(AWS_SUPPRESS_WARNING_PUSH(W), __VA_ARGS__) + + #define AWS_SUPPRESS_DEPRECATION(...) AWS_SUPPRESS_WARNING("-Wdeprecated-declarations", __VA_ARGS__) + +#else + #define AWS_SUPPRESS_WARNING(W, ...) __VAR_ARGS__ + #define AWS_SUPPRESS_WARNING_PUSH(W) + #define AWS_SUPPRESS_WARNING_POP + #define AWS_SUPPRESS_DEPRECATION(...) __VA_ARGS__ +#endif + +// Due to MSVC can't recognize base class deprecated function in derived class. +// We need AWS_DISABLE_DEPRECATION to make AWS_DEPRECATED useless only on MSVC +// Update: When deprecating a function/components, we won't remove the existing tests +// immediately, so we need AWS_DISABLE_DEPRECATION as well. +#if defined(AWS_DISABLE_DEPRECATION) #define AWS_DEPRECATED(msg) #elif defined (__cplusplus) && __cplusplus > 201103L // standard attributes are available since C++14 #define AWS_DEPRECATED(msg) [[deprecated(msg)]] #else #ifdef _MSC_VER #define AWS_DEPRECATED(msg) __declspec(deprecated(msg)) - #elif defined (__clang__) || defined (__GNUC__) + #elif defined (__clang__) || defined (__GNUC__) #define AWS_DEPRECATED(msg) __attribute__((deprecated(msg))) #else #define AWS_DEPRECATED(msg) diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h index e203fba8c0..cebe4891b7 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h index 7cf653ea3c..c4f233cbb9 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -9,24 +9,24 @@ namespace Aws { -namespace Utils -{ -namespace Xml -{ - class XmlDocument; -} -namespace Json -{ - class JsonValue; -} -} // namespace Utils +namespace Utils +{ +namespace Xml +{ + class XmlDocument; +} +namespace Json +{ + class JsonValue; +} +} // namespace Utils -class AWS_CORE_API NoResult -{ -public: - NoResult() {}; - NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>&) {}; - NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>&) {}; -}; +class AWS_CORE_API NoResult +{ +public: + NoResult() {}; + NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>&) {}; + NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>&) {}; +}; } // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h index 09adb1f00c..a728c829ed 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -16,37 +16,37 @@ namespace Aws */ namespace Region { - // AWS_GLOBAL is a pseudo region that can be used to tell SDK to use the service global endpoint if there is any. - // You can specify this region to corresponding environment variable, config file item and in your code. - // For services without global region, the request will be directed to us-east-1 - static const char AWS_GLOBAL[] = "aws-global"; - static const char US_EAST_1[] = "us-east-1"; - static const char US_EAST_2[] = "us-east-2"; - static const char US_WEST_1[] = "us-west-1"; - static const char US_WEST_2[] = "us-west-2"; - static const char AF_SOUTH_1[] = "af-south-1"; - static const char EU_WEST_1[] = "eu-west-1"; - static const char EU_WEST_2[] = "eu-west-2"; - static const char EU_WEST_3[] = "eu-west-3"; - static const char EU_CENTRAL_1[] = "eu-central-1"; - static const char EU_NORTH_1[] = "eu-north-1"; - static const char AP_EAST_1[] = "ap-east-1"; - static const char AP_SOUTH_1[] = "ap-south-1"; - static const char AP_SOUTHEAST_1[] = "ap-southeast-1"; - static const char AP_SOUTHEAST_2[] = "ap-southeast-2"; - static const char AP_NORTHEAST_1[] = "ap-northeast-1"; - static const char AP_NORTHEAST_2[] = "ap-northeast-2"; - static const char AP_NORTHEAST_3[] = "ap-northeast-3"; - static const char SA_EAST_1[] = "sa-east-1"; - static const char CA_CENTRAL_1[] = "ca-central-1"; - static const char CN_NORTH_1[] = "cn-north-1"; - static const char CN_NORTHWEST_1[] = "cn-northwest-1"; - static const char ME_SOUTH_1[] = "me-south-1"; - static const char US_GOV_WEST_1[] = "us-gov-west-1"; - static const char US_GOV_EAST_1[] = "us-gov-east-1"; - - // If a pseudo region, for example, aws-global or us-east-1-fips is provided, it should be converted to the region name used for signing. - Aws::String AWS_CORE_API ComputeSignerRegion(const Aws::String& region); + // AWS_GLOBAL is a pseudo region that can be used to tell SDK to use the service global endpoint if there is any. + // You can specify this region to corresponding environment variable, config file item and in your code. + // For services without global region, the request will be directed to us-east-1 + static const char AWS_GLOBAL[] = "aws-global"; + static const char US_EAST_1[] = "us-east-1"; + static const char US_EAST_2[] = "us-east-2"; + static const char US_WEST_1[] = "us-west-1"; + static const char US_WEST_2[] = "us-west-2"; + static const char AF_SOUTH_1[] = "af-south-1"; + static const char EU_WEST_1[] = "eu-west-1"; + static const char EU_WEST_2[] = "eu-west-2"; + static const char EU_WEST_3[] = "eu-west-3"; + static const char EU_CENTRAL_1[] = "eu-central-1"; + static const char EU_NORTH_1[] = "eu-north-1"; + static const char AP_EAST_1[] = "ap-east-1"; + static const char AP_SOUTH_1[] = "ap-south-1"; + static const char AP_SOUTHEAST_1[] = "ap-southeast-1"; + static const char AP_SOUTHEAST_2[] = "ap-southeast-2"; + static const char AP_NORTHEAST_1[] = "ap-northeast-1"; + static const char AP_NORTHEAST_2[] = "ap-northeast-2"; + static const char AP_NORTHEAST_3[] = "ap-northeast-3"; + static const char SA_EAST_1[] = "sa-east-1"; + static const char CA_CENTRAL_1[] = "ca-central-1"; + static const char CN_NORTH_1[] = "cn-north-1"; + static const char CN_NORTHWEST_1[] = "cn-northwest-1"; + static const char ME_SOUTH_1[] = "me-south-1"; + static const char US_GOV_WEST_1[] = "us-gov-west-1"; + static const char US_GOV_EAST_1[] = "us-gov-east-1"; + + // If a pseudo region, for example, aws-global or us-east-1-fips is provided, it should be converted to the region name used for signing. + Aws::String AWS_CORE_API ComputeSignerRegion(const Aws::String& region); } } // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h index 39865d2ec1..9561d20253 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ -/* #undef USE_AWS_MEMORY_MANAGEMENT */ +/* #undef USE_AWS_MEMORY_MANAGEMENT */ diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h index 408c155adf..71215ec6bd 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #include <aws/core/Core_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> 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 015a370c17..9304d56ee7 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 @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ -#define AWS_SDK_VERSION_STRING "1.8.113" +#define AWS_SDK_VERSION_STRING "1.8.113" diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h index 7728390309..8061ee1e25 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -66,44 +66,44 @@ namespace Aws /** * Signs the request itself (usually by adding a signature header) based on info in the request and uri. - * If signBody is false and https is being used then the body of the payload will not be signed. + * If signBody is false and https is being used then the body of the payload will not be signed. * The default virtual function, just calls SignRequest. */ - virtual bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const - { - AWS_UNREFERENCED_PARAM(signBody); - return SignRequest(request); - } + virtual bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const + { + AWS_UNREFERENCED_PARAM(signBody); + return SignRequest(request); + } + + /** + * Signs the request itself (usually by adding a signature header) based on info in the request and uri. + * If signBody is false and https is being used then the body of the payload will not be signed. + * The default virtual function, just calls SignRequest. + * Using m_region by default if parameter region is nullptr. + */ + virtual bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const + { + AWS_UNREFERENCED_PARAM(signBody); + AWS_UNREFERENCED_PARAM(region); + return SignRequest(request); + } + + /** + * Signs the request itself (usually by adding a signature header) based on info in the request and uri. + * If signBody is false and https is being used then the body of the payload will not be signed. + * The default virtual function, just calls SignRequest. + * Using m_region by default if parameter region is nullptr. + * Using m_serviceName by default if parameter serviceName is nullptr. + */ + virtual bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const + { + AWS_UNREFERENCED_PARAM(signBody); + AWS_UNREFERENCED_PARAM(region); + AWS_UNREFERENCED_PARAM(serviceName); + return SignRequest(request); + } /** - * Signs the request itself (usually by adding a signature header) based on info in the request and uri. - * If signBody is false and https is being used then the body of the payload will not be signed. - * The default virtual function, just calls SignRequest. - * Using m_region by default if parameter region is nullptr. - */ - virtual bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const - { - AWS_UNREFERENCED_PARAM(signBody); - AWS_UNREFERENCED_PARAM(region); - return SignRequest(request); - } - - /** - * Signs the request itself (usually by adding a signature header) based on info in the request and uri. - * If signBody is false and https is being used then the body of the payload will not be signed. - * The default virtual function, just calls SignRequest. - * Using m_region by default if parameter region is nullptr. - * Using m_serviceName by default if parameter serviceName is nullptr. - */ - virtual bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const - { - AWS_UNREFERENCED_PARAM(signBody); - AWS_UNREFERENCED_PARAM(region); - AWS_UNREFERENCED_PARAM(serviceName); - return SignRequest(request); - } - - /** * Signs a single event message in an event stream. * The input message buffer is copied and signed. The message's input buffer will be deallocated and a new * buffer will be assigned. The new buffer encodes the original message with its headers as the payload of @@ -126,15 +126,15 @@ namespace Aws /** * Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults * to 0 which is the default 7 days. - * Using m_region by default if parameter region is nullptr. + * Using m_region by default if parameter region is nullptr. */ virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const = 0; /** * Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults * to 0 which is the default 7 days. - * Using m_region by default if parameter region is nullptr. - * Using m_serviceName by default if parameter serviceName is nullptr. + * Using m_region by default if parameter region is nullptr. + * Using m_serviceName by default if parameter serviceName is nullptr. */ virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const = 0; @@ -154,7 +154,7 @@ namespace Aws */ virtual Aws::Utils::DateTime GetSigningTimestamp() const { return Aws::Utils::DateTime::Now() + GetClockSkewOffset(); } - protected: + protected: virtual std::chrono::milliseconds GetClockSkewOffset() const { return m_clockSkew.load(); } std::atomic<std::chrono::milliseconds> m_clockSkew; @@ -211,39 +211,39 @@ namespace Aws * Signs the request itself based on info in the request and uri. * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. */ - bool SignRequest(Aws::Http::HttpRequest& request) const override - { - return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), true/*signBody*/); - } + bool SignRequest(Aws::Http::HttpRequest& request) const override + { + return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), true/*signBody*/); + } /** * Signs the request itself based on info in the request and uri. * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false * and https is being used then the body of the payload will not be signed. */ - bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const override - { - return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), signBody); - } + bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const override + { + return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), signBody); + } + + /** + * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false + * and https is being used then the body of the payload will not be signed. + * Using m_region by default if parameter region is nullptr. + */ + bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const override + { + return SignRequest(request, region, m_serviceName.c_str(), signBody); + } + + /** + * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false + * and https is being used then the body of the payload will not be signed. + * Using m_region by default if parameter region is nullptr. + */ + bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const override; /** - * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false - * and https is being used then the body of the payload will not be signed. - * Using m_region by default if parameter region is nullptr. - */ - bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const override - { - return SignRequest(request, region, m_serviceName.c_str(), signBody); - } - - /** - * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false - * and https is being used then the body of the payload will not be signed. - * Using m_region by default if parameter region is nullptr. - */ - bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const override; - - /** * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request. * the region the signer was initialized with will be used for the signature. * The URI can then be used in a normal HTTP call until expiration. @@ -253,11 +253,11 @@ namespace Aws bool PresignRequest(Aws::Http::HttpRequest& request, long long expirationInSeconds = 0) const override; /** - * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request. + * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request. * The URI can then be used in a normal HTTP call until expiration. * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. * expirationInSeconds defaults to 0 which provides a URI good for 7 days. - * Using m_region by default if parameter region is nullptr. + * Using m_region by default if parameter region is nullptr. */ bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const override; @@ -266,8 +266,8 @@ namespace Aws * The URI can then be used in a normal HTTP call until expiration. * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. * expirationInSeconds defaults to 0 which provides a URI good for 7 days. - * Using m_region by default if parameter region is nullptr. - * Using m_serviceName by default if parameter serviceName is nullptr. + * Using m_region by default if parameter region is nullptr. + * Using m_serviceName by default if parameter serviceName is nullptr. */ bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const override; @@ -283,7 +283,7 @@ namespace Aws private: Aws::String GenerateSignature(const Aws::Auth::AWSCredentials& credentials, - const Aws::String& stringToSign, const Aws::String& simpleDate, const Aws::String& region, + const Aws::String& stringToSign, const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const; Aws::String GenerateSignature(const Aws::String& stringToSign, const Aws::Utils::ByteBuffer& key) const; @@ -326,23 +326,23 @@ namespace Aws bool SignEventMessage(Aws::Utils::Event::Message&, Aws::String& priorSignature) const override; - bool SignRequest(Aws::Http::HttpRequest& request) const override + bool SignRequest(Aws::Http::HttpRequest& request) const override + { + return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), true); + } + + bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const override { - return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), true); + return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), signBody); } - bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const override - { - return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), signBody); - } - - bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const override - { - return SignRequest(request, region, m_serviceName.c_str(), signBody); - } - - bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const override; - + bool SignRequest(Aws::Http::HttpRequest& request, const char* region, bool signBody) const override + { + return SignRequest(request, region, m_serviceName.c_str(), signBody); + } + + bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const override; + /** * Do nothing */ @@ -361,7 +361,7 @@ namespace Aws bool ShouldSignHeader(const Aws::String& header) const; private: Utils::ByteBuffer GenerateSignature(const Aws::Auth::AWSCredentials& credentials, - const Aws::String& stringToSign, const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const; + const Aws::String& stringToSign, const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const; Utils::ByteBuffer GenerateSignature(const Aws::String& stringToSign, const Aws::Utils::ByteBuffer& key) const; Aws::String GenerateStringToSign(const Aws::String& dateValue, const Aws::String& simpleDate, const Aws::String& canonicalRequestHash, const Aws::String& region, diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h index 937f4047d9..305c58cd9d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -20,31 +20,31 @@ namespace Aws } namespace Auth { - class AWSCredentialsProvider; - + class AWSCredentialsProvider; + 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 void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) = 0; virtual ~AWSAuthSignerProvider() = default; }; class AWS_CORE_API DefaultAuthSignerProvider : public AWSAuthSignerProvider { public: - /** - * Creates a Signature-V4 signer provider that supports the different implementations of Signature-V4 - * used for standard and event-stream requests. - * - * @param credentialsProvider A provider to retrieve the access/secret key used to derive the signing - * @param serviceName The canonical name of the AWS service to be used in the signature - * @param region The AWS region in which the requests will be made. - */ - DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider, - const Aws::String& serviceName, const Aws::String& region); + /** + * Creates a Signature-V4 signer provider that supports the different implementations of Signature-V4 + * used for standard and event-stream requests. + * + * @param credentialsProvider A provider to retrieve the access/secret key used to derive the signing + * @param serviceName The canonical name of the AWS service to be used in the signature + * @param region The AWS region in which the requests will be made. + */ + DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider, + const Aws::String& serviceName, const Aws::String& region); explicit DefaultAuthSignerProvider(const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer); - void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) override; + void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) override; std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const override; private: Aws::Vector<std::shared_ptr<Aws::Client::AWSAuthSigner>> m_signers; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentials.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentials.h index c31fbd3d82..1c14b955fc 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentials.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentials.h @@ -1,13 +1,13 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/memory/stl/AWSString.h> -#include <aws/core/utils/DateTime.h> +#include <aws/core/utils/DateTime.h> namespace Aws { namespace Auth @@ -18,65 +18,65 @@ namespace Aws class AWS_CORE_API AWSCredentials { public: - /** - * Initializes an empty credentials set. - * Empty credentials are not expired by default. - * Credentials expire only if an expiration date is explicitly set on them. - */ - AWSCredentials() : m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) - { - } - - /** - * Initializes object with accessKeyId, secretKey. - * SessionToken defaults to empty string. - * Expiration date is set to "never expire". - */ - AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey) : - m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) - { - } - - /** - * Initializes object with accessKeyId, secretKey, and sessionToken. - * Expiration date is set to "never expire". - */ - AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey, const Aws::String& sessionToken) : - m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_sessionToken(sessionToken), m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) - { - } - - /** - * Initializes object with accessKeyId, secretKey, sessionToken and expiration date. - */ - AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey, const Aws::String& sessionToken, Aws::Utils::DateTime expiration) : - m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_sessionToken(sessionToken), m_expiration(expiration) - { - } - - bool operator == (const AWSCredentials& other) const - { - return m_accessKeyId == other.m_accessKeyId - && m_secretKey == other.m_secretKey - && m_sessionToken == other.m_sessionToken - && m_expiration == other.m_expiration; - } - - bool operator != (const AWSCredentials& other) const - { - return !(other == *this); - } - - /** + /** + * Initializes an empty credentials set. + * Empty credentials are not expired by default. + * Credentials expire only if an expiration date is explicitly set on them. + */ + AWSCredentials() : m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) + { + } + + /** + * Initializes object with accessKeyId, secretKey. + * SessionToken defaults to empty string. + * Expiration date is set to "never expire". + */ + AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey) : + m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) + { + } + + /** + * Initializes object with accessKeyId, secretKey, and sessionToken. + * Expiration date is set to "never expire". + */ + AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey, const Aws::String& sessionToken) : + m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_sessionToken(sessionToken), m_expiration((std::chrono::time_point<std::chrono::system_clock>::max)()) + { + } + + /** + * Initializes object with accessKeyId, secretKey, sessionToken and expiration date. + */ + AWSCredentials(const Aws::String& accessKeyId, const Aws::String& secretKey, const Aws::String& sessionToken, Aws::Utils::DateTime expiration) : + m_accessKeyId(accessKeyId), m_secretKey(secretKey), m_sessionToken(sessionToken), m_expiration(expiration) + { + } + + bool operator == (const AWSCredentials& other) const + { + return m_accessKeyId == other.m_accessKeyId + && m_secretKey == other.m_secretKey + && m_sessionToken == other.m_sessionToken + && m_expiration == other.m_expiration; + } + + bool operator != (const AWSCredentials& other) const + { + return !(other == *this); + } + + /** * If credentials haven't been initialized or been initialized to emtpy values. - * Expiration date does not affect the result of this function. + * Expiration date does not affect the result of this function. */ inline bool IsEmpty() const { return m_accessKeyId.empty() && m_secretKey.empty(); } - inline bool IsExpired() const { return m_expiration <= Aws::Utils::DateTime::Now(); } - - inline bool IsExpiredOrEmpty() const { return IsEmpty() || IsExpired(); } - + inline bool IsExpired() const { return m_expiration <= Aws::Utils::DateTime::Now(); } + + inline bool IsExpiredOrEmpty() const { return IsEmpty() || IsExpired(); } + /** * Gets the underlying access key credential */ @@ -102,14 +102,14 @@ namespace Aws } /** - * Gets the expiration date of the credential - */ - inline Aws::Utils::DateTime GetExpiration() const - { - return m_expiration; - } - - /** + * Gets the expiration date of the credential + */ + inline Aws::Utils::DateTime GetExpiration() const + { + return m_expiration; + } + + /** * Sets the underlying access key credential. Copies from parameter accessKeyId. */ inline void SetAWSAccessKeyId(const Aws::String& accessKeyId) @@ -126,51 +126,51 @@ namespace Aws } /** - * Sets the underlying session token. Copies from parameter sessionToken + * Sets the underlying session token. Copies from parameter sessionToken */ inline void SetSessionToken(const Aws::String& sessionToken) { m_sessionToken = sessionToken; } - + /** - * Sets the underlying access key credential. Copies from parameter accessKeyId. - */ + * Sets the underlying access key credential. Copies from parameter accessKeyId. + */ inline void SetAWSAccessKeyId(const char* accessKeyId) { m_accessKeyId = accessKeyId; } /** - * Sets the underlying secret key credential. Copies from parameter secretKey - */ + * Sets the underlying secret key credential. Copies from parameter secretKey + */ inline void SetAWSSecretKey(const char* secretKey) { m_secretKey = secretKey; } /** - * Sets the underlying secret key credential. Copies from parameter secretKey - */ + * Sets the underlying secret key credential. Copies from parameter secretKey + */ inline void SetSessionToken(const char* sessionToken) { m_sessionToken = sessionToken; } - /** - * Sets the expiration date of the credential - */ - inline void SetExpiration(Aws::Utils::DateTime expiration) - { - m_expiration = expiration; - } - + /** + * Sets the expiration date of the credential + */ + inline void SetExpiration(Aws::Utils::DateTime expiration) + { + m_expiration = expiration; + } + private: Aws::String m_accessKeyId; Aws::String m_secretKey; Aws::String m_sessionToken; - Aws::Utils::DateTime m_expiration; + Aws::Utils::DateTime m_expiration; }; } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h index a3c26cfd92..a3a46964e8 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -15,35 +15,35 @@ #include <aws/core/internal/AWSHttpResourceClient.h> #include <aws/core/auth/AWSCredentials.h> #include <aws/core/config/AWSProfileConfigLoader.h> -#include <aws/core/client/RetryStrategy.h> +#include <aws/core/client/RetryStrategy.h> #include <memory> namespace Aws { namespace Auth { - constexpr int REFRESH_THRESHOLD = 1000 * 60 * 5; + constexpr int REFRESH_THRESHOLD = 1000 * 60 * 5; - /** - * Returns the full path of the config file. - */ - AWS_CORE_API Aws::String GetConfigProfileFilename(); //defaults to "config" + /** + * Returns the full path of the config file. + */ + AWS_CORE_API Aws::String GetConfigProfileFilename(); //defaults to "config" + + /** + * Returns the default profile name. + * The value is the first non-empty value of the following: + * 1. AWS_PROFILE environment variable + * 2. AWS_DEFAULT_PROFILE environment variable + * 3. The literal name "default" + */ + AWS_CORE_API Aws::String GetConfigProfileName(); //defaults to "default" + + /* + * Fetches credentials by executing the process in the parameter + */ + AWS_CORE_API AWSCredentials GetCredentialsFromProcess(const Aws::String& process); /** - * Returns the default profile name. - * The value is the first non-empty value of the following: - * 1. AWS_PROFILE environment variable - * 2. AWS_DEFAULT_PROFILE environment variable - * 3. The literal name "default" - */ - AWS_CORE_API Aws::String GetConfigProfileName(); //defaults to "default" - - /* - * Fetches credentials by executing the process in the parameter - */ - AWS_CORE_API AWSCredentials GetCredentialsFromProcess(const Aws::String& process); - - /** * Abstract class for retrieving AWS credentials. Create a derived class from this to allow * various methods of storing and retrieving credentials. Examples would be cognito-identity, some encrypted store etc... */ @@ -87,7 +87,7 @@ namespace Aws /** * Returns empty credentials object. */ - inline AWSCredentials GetAWSCredentials() override { return AWSCredentials(); } + inline AWSCredentials GetAWSCredentials() override { return AWSCredentials(); } }; /** @@ -102,14 +102,14 @@ namespace Aws * Initializes object from awsAccessKeyId, awsSecretAccessKey, and sessionToken parameters. sessionToken parameter is defaulted to empty. */ inline SimpleAWSCredentialsProvider(const Aws::String& awsAccessKeyId, const Aws::String& awsSecretAccessKey, const Aws::String& sessionToken = "") - : m_credentials(awsAccessKeyId, awsSecretAccessKey, sessionToken) + : m_credentials(awsAccessKeyId, awsSecretAccessKey, sessionToken) { } /** * Initializes object from credentials object. everything is copied. */ inline SimpleAWSCredentialsProvider(const AWSCredentials& credentials) - : m_credentials(credentials) + : m_credentials(credentials) { } /** @@ -117,11 +117,11 @@ namespace Aws */ inline AWSCredentials GetAWSCredentials() override { - return m_credentials; + return m_credentials; } private: - AWSCredentials m_credentials; + AWSCredentials m_credentials; }; /** @@ -141,7 +141,7 @@ namespace Aws /** * Reads credentials profile from the default Profile Config File. Refreshes at set interval for credential rotation. * Looks for environment variables AWS_SHARED_CREDENTIALS_FILE and AWS_PROFILE. If they aren't found, then it defaults - * to the default profile in ~/.aws/credentials. + * to the default profile in ~/.aws/credentials. * Optionally a user can specify the profile and it will override the environment variable * and defaults. To alter the file this pulls from, then the user should alter the AWS_SHARED_CREDENTIALS_FILE variable. */ @@ -180,8 +180,8 @@ namespace Aws private: /** - * Checks to see if the refresh interval has expired and reparses the file if it has. - */ + * Checks to see if the refresh interval has expired and reparses the file if it has. + */ void RefreshIfExpired(); Aws::String m_profileToUse; @@ -279,7 +279,7 @@ namespace Aws * The default profile name to look up this configuration is "default", same as normal aws credentials configuration and other configurations. * The expected valid output of the command is a Json doc output to stdout: * {"Version": 1, "AccessKeyId": "AccessKey123", "SecretAccessKey": "SecretKey321", "SessionToken": "Token123", "Expiration": "1970-01-01T00:00:01Z"} - * The Version key specifies the version of the JSON payload and must be set to 1 for now (as an integer type). + * The Version key specifies the version of the JSON payload and must be set to 1 for now (as an integer type). * If the Version key is bumped to 2, SDKs would support both versions of the returned payload. * Value of Expiration field should be an valid ISO8601 formatted date string as above example. * The expected error message of the command is a string to output to stderr. diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h index 0aaad928b7..dae8cf5a42 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h index f538b99f94..92d997c7ca 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h @@ -1,51 +1,51 @@ -/** - * 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/utils/DateTime.h> -#include <aws/core/utils/memory/stl/AWSString.h> -#include <aws/core/internal/AWSHttpResourceClient.h> -#include <aws/core/auth/AWSCredentialsProvider.h> -#include <memory> - -namespace Aws -{ - namespace Auth - { - /** - * To support retrieving credentials of STS AssumeRole with web identity. - * Note that STS accepts request with protocol of queryxml. Calling GetAWSCredentials() will trigger (if expired) - * a query request using AWSHttpResourceClient under the hood. - */ - class AWS_CORE_API STSAssumeRoleWebIdentityCredentialsProvider : public AWSCredentialsProvider - { - public: - STSAssumeRoleWebIdentityCredentialsProvider(); - - /** - * Retrieves the credentials if found, otherwise returns empty credential set. - */ - AWSCredentials GetAWSCredentials() override; - - protected: - void Reload() override; - - private: - void RefreshIfExpired(); - Aws::String CalculateQueryString() const; - - Aws::UniquePtr<Aws::Internal::STSCredentialsClient> m_client; - Aws::Auth::AWSCredentials m_credentials; - Aws::String m_roleArn; - Aws::String m_tokenFile; - Aws::String m_sessionName; - Aws::String m_token; - bool m_initialized; - }; - } // namespace Auth -} // namespace Aws +/** + * 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/utils/DateTime.h> +#include <aws/core/utils/memory/stl/AWSString.h> +#include <aws/core/internal/AWSHttpResourceClient.h> +#include <aws/core/auth/AWSCredentialsProvider.h> +#include <memory> + +namespace Aws +{ + namespace Auth + { + /** + * To support retrieving credentials of STS AssumeRole with web identity. + * Note that STS accepts request with protocol of queryxml. Calling GetAWSCredentials() will trigger (if expired) + * a query request using AWSHttpResourceClient under the hood. + */ + class AWS_CORE_API STSAssumeRoleWebIdentityCredentialsProvider : public AWSCredentialsProvider + { + public: + STSAssumeRoleWebIdentityCredentialsProvider(); + + /** + * Retrieves the credentials if found, otherwise returns empty credential set. + */ + AWSCredentials GetAWSCredentials() override; + + protected: + void Reload() override; + + private: + void RefreshIfExpired(); + Aws::String CalculateQueryString() const; + + Aws::UniquePtr<Aws::Internal::STSCredentialsClient> m_client; + Aws::Auth::AWSCredentials m_credentials; + Aws::String m_roleArn; + Aws::String m_tokenFile; + Aws::String m_sessionName; + Aws::String m_token; + bool m_initialized; + }; + } // namespace Auth +} // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h index 8733a72a56..186206a66e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -106,42 +106,42 @@ namespace Aws virtual ~AWSClient() { }; /** - * Generates a signed Uri using the injected signer. for the supplied uri and http method. expirationInSeconds defaults + * Generates a signed Uri using the injected signer. for the supplied uri and http method. expirationInSeconds defaults * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it. */ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, long long expirationInSeconds = 0); /** - * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults + * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it. */ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0); /** - * Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults - * to 0 which is the default 7 days. - */ + * Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults + * to 0 which is the default 7 days. + */ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, long long expirationInSeconds = 0) const; /** - * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults - * to 0 which is the default 7 days. - */ - Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0); - - /** - * Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults - * to 0 which is the default 7 days. - */ + * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults + * to 0 which is the default 7 days. + */ + Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0); + + /** + * Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults + * to 0 which is the default 7 days. + */ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, long long expirationInSeconds = 0) const; - /** - * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults - * to 0 which is the default 7 days. - */ - Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0); - - Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, + /** + * Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults + * to 0 which is the default 7 days. + */ + Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0); + + Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const; Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, @@ -161,39 +161,39 @@ namespace Aws */ void EnableRequestProcessing(); - inline virtual const char* GetServiceClientName() const { return m_serviceName.c_str(); } - /** - * service client name is part of userAgent. - * We need to update userAgent after setting this name if it's not pre-set by customer. - * Note: this API should only be called in your extended class constructors. - */ - virtual void SetServiceClientName(const Aws::String& name); + inline virtual const char* GetServiceClientName() const { return m_serviceName.c_str(); } + /** + * service client name is part of userAgent. + * We need to update userAgent after setting this name if it's not pre-set by customer. + * Note: this API should only be called in your extended class constructors. + */ + virtual void SetServiceClientName(const Aws::String& name); protected: /** - * Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy, + * Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy, * or encounters and error that is not retryable. */ HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri, const Aws::AmazonWebServiceRequest& request, Http::HttpMethod httpMethod, - const char* signerName, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* signerName, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** - * Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy, + * Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy, * or encounters and error that is not retryable. This method is for payloadless requests e.g. GET, DELETE, HEAD - * - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. + * + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. */ - HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri, + HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri, Http::HttpMethod httpMethod, const char* signerName, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * Build an Http Request from the AmazonWebServiceRequest object. Signs the request, sends it accross the wire @@ -201,22 +201,22 @@ namespace Aws */ HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest, const Aws::AmazonWebServiceRequest& request, - const char* signerName, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* signerName, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * Signs an Http Request, sends it accross the wire * then reports the http response. This method is for payloadless requests e.g. GET, DELETE, HEAD - * - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. + * + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. */ HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest, const char* signerName, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon @@ -225,23 +225,23 @@ namespace Aws StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri, const Aws::AmazonWebServiceRequest& request, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, - const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* signerName = Aws::Auth::SIGV4_SIGNER, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon * return transfers ownership of the underlying stream for the http response to the caller. - * - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. + * + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. */ StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * Abstract. Subclassing clients should override this to tell the client how to marshall error payloads @@ -263,7 +263,7 @@ namespace Aws } /** - * Gets the corresponding signer from the signers map by name. + * Gets the corresponding signer from the signers map by name. */ Aws::Client::AWSAuthSigner* GetSignerByName(const char* name) const; protected: @@ -283,7 +283,7 @@ namespace Aws * Performs the HTTP request via the HTTP client while enforcing rate limiters */ std::shared_ptr<Aws::Http::HttpResponse> MakeHttpRequest(std::shared_ptr<Aws::Http::HttpRequest>& request) const; - Aws::String m_region; + Aws::String m_region; private: /** * Try to adjust signer's clock @@ -291,8 +291,8 @@ namespace Aws */ bool AdjustClockSkew(HttpResponseOutcome& outcome, const char* signerName) const; void AddHeadersToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const Http::HeaderValueCollection& headerValues) const; - void AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const std::shared_ptr<Aws::IOStream>& body, - bool needsContentMd5 = false, bool isChunked = false) const; + void AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const std::shared_ptr<Aws::IOStream>& body, + bool needsContentMd5 = false, bool isChunked = false) const; void AddCommonHeaders(Aws::Http::HttpRequest& httpRequest) const; void InitializeGlobalStatics(); std::shared_ptr<Aws::Http::HttpRequest> ConvertToRequestForPresigning(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, @@ -305,15 +305,15 @@ namespace Aws std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_writeRateLimiter; std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_readRateLimiter; Aws::String m_userAgent; - bool m_customizedUserAgent; + bool m_customizedUserAgent; std::shared_ptr<Aws::Utils::Crypto::Hash> m_hash; - long m_requestTimeoutMs; + long m_requestTimeoutMs; bool m_enableClockSkewAdjustment; - Aws::String m_serviceName; + Aws::String m_serviceName; }; typedef Utils::Outcome<AmazonWebServiceResult<Utils::Json::JsonValue>, AWSError<CoreErrors>> JsonOutcome; - AWS_CORE_API Aws::String GetAuthorizationHeader(const Aws::Http::HttpRequest& httpRequest); + AWS_CORE_API Aws::String GetAuthorizationHeader(const Aws::Http::HttpRequest& httpRequest); /** * AWSClient that handles marshalling json response bodies. You would inherit from this class @@ -355,25 +355,25 @@ namespace Aws JsonOutcome MakeRequest(const Aws::Http::URI& uri, const Aws::AmazonWebServiceRequest& request, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, - const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* signerName = Aws::Auth::SIGV4_SIGNER, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * Returns a Json document or an error from the request. Does some marshalling json and raw streams, * then just calls AttemptExhaustively. * - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. - * + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. + * * method defaults to POST */ JsonOutcome MakeRequest(const Aws::Http::URI& uri, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; JsonOutcome MakeEventStreamRequest(std::shared_ptr<Aws::Http::HttpRequest>& request) const; }; @@ -415,26 +415,26 @@ namespace Aws XmlOutcome MakeRequest(const Aws::Http::URI& uri, const Aws::AmazonWebServiceRequest& request, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, - const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* signerName = Aws::Auth::SIGV4_SIGNER, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * Returns an xml document or an error from the request. Does some marshalling xml and raw streams, * then just calls AttemptExhaustively. * - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. - * + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. + * * method defaults to POST */ XmlOutcome MakeRequest(const Aws::Http::URI& uri, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * This is used for event stream response. @@ -442,21 +442,21 @@ namespace Aws XmlOutcome MakeRequestWithEventStream(const Aws::Http::URI& uri, const Aws::AmazonWebServiceRequest& request, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, - const char* singerName = Aws::Auth::SIGV4_SIGNER, - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* singerName = Aws::Auth::SIGV4_SIGNER, + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; /** * This is used for event stream response. - * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid - * name. + * requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid + * name. */ XmlOutcome MakeRequestWithEventStream(const Aws::Http::URI& uri, Http::HttpMethod method = Http::HttpMethod::HTTP_POST, const char* signerName = Aws::Auth::SIGV4_SIGNER, - const char* requestName = "", - const char* signerRegionOverride = nullptr, - const char* signerServiceNameOverride = nullptr) const; + const char* requestName = "", + const char* signerRegionOverride = nullptr, + const char* signerServiceNameOverride = nullptr) const; }; } // namespace Client 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 f5d1ea2b45..c88c1bdd5d 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 @@ -1,15 +1,15 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/memory/stl/AWSString.h> #include <aws/core/http/HttpResponse.h> -#include <aws/core/utils/xml/XmlSerializer.h> -#include <aws/core/utils/json/JsonSerializer.h> +#include <aws/core/utils/xml/XmlSerializer.h> +#include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/utils/StringUtils.h> namespace Aws @@ -17,77 +17,77 @@ namespace Aws namespace Client { enum class CoreErrors; - class XmlErrorMarshaller; - class JsonErrorMarshaller; - - enum class ErrorPayloadType - { - NOT_SET, - XML, - JSON - }; - + class XmlErrorMarshaller; + class JsonErrorMarshaller; + + enum class ErrorPayloadType + { + NOT_SET, + XML, + JSON + }; + /** * Container for Error enumerations with additional exception information. Name, message, retryable etc.... */ template<typename ERROR_TYPE> class AWSError { - // Allow ErrorMarshaller to set error payload. - friend class XmlErrorMarshaller; - friend class JsonErrorMarshaller; - template<typename T> friend class AWSError; + // Allow ErrorMarshaller to set error payload. + friend class XmlErrorMarshaller; + friend class JsonErrorMarshaller; + template<typename T> friend class AWSError; public: /** * Initializes AWSError object as empty with the error not being retryable. */ - AWSError() : m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(false) {} + AWSError() : m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(false) {} /** * Initializes AWSError object with errorType, exceptionName, message, and retryable flag. */ AWSError(ERROR_TYPE errorType, Aws::String exceptionName, const Aws::String message, bool isRetryable) : - m_errorType(errorType), m_exceptionName(exceptionName), m_message(message), - m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(isRetryable), - m_errorPayloadType(ErrorPayloadType::NOT_SET) {} + m_errorType(errorType), m_exceptionName(exceptionName), m_message(message), + m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(isRetryable), + m_errorPayloadType(ErrorPayloadType::NOT_SET) {} /** * Initializes AWSError object with errorType and retryable flag. ExceptionName and message are empty. */ AWSError(ERROR_TYPE errorType, bool isRetryable) : - 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; - - template<typename OTHER_ERROR_TYPE> - AWSError(AWSError<OTHER_ERROR_TYPE>&& rhs) : - m_errorType(static_cast<ERROR_TYPE>(rhs.m_errorType)), m_exceptionName(std::move(rhs.m_exceptionName)), - m_message(std::move(rhs.m_message)), m_remoteHostIpAddress(std::move(rhs.m_remoteHostIpAddress)), - m_requestId(std::move(rhs.m_requestId)), m_responseHeaders(std::move(rhs.m_responseHeaders)), - m_responseCode(rhs.m_responseCode), m_isRetryable(rhs.m_isRetryable), m_errorPayloadType(rhs.m_errorPayloadType), - m_xmlPayload(std::move(rhs.m_xmlPayload)), m_jsonPayload(std::move(rhs.m_jsonPayload)) + 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; + + template<typename OTHER_ERROR_TYPE> + AWSError(AWSError<OTHER_ERROR_TYPE>&& rhs) : + m_errorType(static_cast<ERROR_TYPE>(rhs.m_errorType)), m_exceptionName(std::move(rhs.m_exceptionName)), + m_message(std::move(rhs.m_message)), m_remoteHostIpAddress(std::move(rhs.m_remoteHostIpAddress)), + m_requestId(std::move(rhs.m_requestId)), m_responseHeaders(std::move(rhs.m_responseHeaders)), + m_responseCode(rhs.m_responseCode), m_isRetryable(rhs.m_isRetryable), m_errorPayloadType(rhs.m_errorPayloadType), + m_xmlPayload(std::move(rhs.m_xmlPayload)), m_jsonPayload(std::move(rhs.m_jsonPayload)) + {} + + template<typename OTHER_ERROR_TYPE> + AWSError(const AWSError<OTHER_ERROR_TYPE>& rhs) : + m_errorType(static_cast<ERROR_TYPE>(rhs.m_errorType)), m_exceptionName(rhs.m_exceptionName), + m_message(rhs.m_message), m_remoteHostIpAddress(rhs.m_remoteHostIpAddress), m_requestId(rhs.m_requestId), + m_responseHeaders(rhs.m_responseHeaders), m_responseCode(rhs.m_responseCode), + m_isRetryable(rhs.m_isRetryable), m_errorPayloadType(rhs.m_errorPayloadType), + m_xmlPayload(rhs.m_xmlPayload), m_jsonPayload(rhs.m_jsonPayload) {} - template<typename OTHER_ERROR_TYPE> - AWSError(const AWSError<OTHER_ERROR_TYPE>& rhs) : - m_errorType(static_cast<ERROR_TYPE>(rhs.m_errorType)), m_exceptionName(rhs.m_exceptionName), - m_message(rhs.m_message), m_remoteHostIpAddress(rhs.m_remoteHostIpAddress), m_requestId(rhs.m_requestId), - m_responseHeaders(rhs.m_responseHeaders), m_responseCode(rhs.m_responseCode), - m_isRetryable(rhs.m_isRetryable), m_errorPayloadType(rhs.m_errorPayloadType), - m_xmlPayload(rhs.m_xmlPayload), m_jsonPayload(rhs.m_jsonPayload) - {} - - /** - * Copy assignment operator - */ - AWSError& operator=(const AWSError<ERROR_TYPE>&) = default; - - /** - * Move assignment operator - */ - AWSError& operator=(AWSError<ERROR_TYPE>&& other) = default; - - /** + /** + * Copy assignment operator + */ + AWSError& operator=(const AWSError<ERROR_TYPE>&) = default; + + /** + * Move assignment operator + */ + AWSError& operator=(AWSError<ERROR_TYPE>&& other) = default; + + /** * Gets underlying errorType. */ inline const ERROR_TYPE GetErrorType() const { return m_errorType; } @@ -108,26 +108,26 @@ namespace Aws */ inline void SetMessage(const Aws::String& message) { m_message = message; } /** - * Gets the resolved remote host IP address. - * This value is only available after DNS resolution and with CURL http client right now. - * Otherwise an empty string is returned. - */ - inline const Aws::String& GetRemoteHostIpAddress() const { return m_remoteHostIpAddress; } - /** - * Sets the resolved remote host IP address. - */ - inline void SetRemoteHostIpAddress(const Aws::String& remoteHostIpAddress) { m_remoteHostIpAddress = remoteHostIpAddress; } - /** - * Gets the request ID. - * This value is available after request is made and when services return it in response. - * Otherwise an empty string is returned. - */ - inline const Aws::String& GetRequestId() const { return m_requestId; } - /** - * Sets the request ID. - */ - inline void SetRequestId(const Aws::String& requestId) { m_requestId = requestId; } - /** + * Gets the resolved remote host IP address. + * This value is only available after DNS resolution and with CURL http client right now. + * Otherwise an empty string is returned. + */ + inline const Aws::String& GetRemoteHostIpAddress() const { return m_remoteHostIpAddress; } + /** + * Sets the resolved remote host IP address. + */ + inline void SetRemoteHostIpAddress(const Aws::String& remoteHostIpAddress) { m_remoteHostIpAddress = remoteHostIpAddress; } + /** + * Gets the request ID. + * This value is available after request is made and when services return it in response. + * Otherwise an empty string is returned. + */ + inline const Aws::String& GetRequestId() const { return m_requestId; } + /** + * Sets the request ID. + */ + inline void SetRequestId(const Aws::String& requestId) { m_requestId = requestId; } + /** * Returns whether or not this error is eligible for retry. */ inline bool ShouldRetry() const { return m_isRetryable; } @@ -152,59 +152,59 @@ namespace Aws */ inline void SetResponseCode(Aws::Http::HttpResponseCode responseCode) { m_responseCode = responseCode; } - protected: - inline ErrorPayloadType GetErrorPayloadType() { return m_errorPayloadType; } - inline void SetXmlPayload(const Aws::Utils::Xml::XmlDocument& xmlPayload) - { - m_errorPayloadType = ErrorPayloadType::XML; - m_xmlPayload = xmlPayload; - } - inline void SetXmlPayload(Aws::Utils::Xml::XmlDocument&& xmlPayload) - { - m_errorPayloadType = ErrorPayloadType::XML; - m_xmlPayload = std::move(xmlPayload); - } - inline const Aws::Utils::Xml::XmlDocument& GetXmlPayload() const - { - assert(m_errorPayloadType != ErrorPayloadType::JSON); - return m_xmlPayload; - } - inline void SetJsonPayload(const Aws::Utils::Json::JsonValue& jsonPayload) - { - m_errorPayloadType = ErrorPayloadType::JSON; - m_jsonPayload = jsonPayload; - } - inline void SetJsonPayload(Aws::Utils::Json::JsonValue&& jsonPayload) - { - m_errorPayloadType = ErrorPayloadType::JSON; - m_jsonPayload = std::move(jsonPayload); - } - inline const Aws::Utils::Json::JsonValue& GetJsonPayload() const - { - assert(m_errorPayloadType != ErrorPayloadType::XML); - return m_jsonPayload; - } - + protected: + inline ErrorPayloadType GetErrorPayloadType() { return m_errorPayloadType; } + inline void SetXmlPayload(const Aws::Utils::Xml::XmlDocument& xmlPayload) + { + m_errorPayloadType = ErrorPayloadType::XML; + m_xmlPayload = xmlPayload; + } + inline void SetXmlPayload(Aws::Utils::Xml::XmlDocument&& xmlPayload) + { + m_errorPayloadType = ErrorPayloadType::XML; + m_xmlPayload = std::move(xmlPayload); + } + inline const Aws::Utils::Xml::XmlDocument& GetXmlPayload() const + { + assert(m_errorPayloadType != ErrorPayloadType::JSON); + return m_xmlPayload; + } + inline void SetJsonPayload(const Aws::Utils::Json::JsonValue& jsonPayload) + { + m_errorPayloadType = ErrorPayloadType::JSON; + m_jsonPayload = jsonPayload; + } + inline void SetJsonPayload(Aws::Utils::Json::JsonValue&& jsonPayload) + { + m_errorPayloadType = ErrorPayloadType::JSON; + m_jsonPayload = std::move(jsonPayload); + } + inline const Aws::Utils::Json::JsonValue& GetJsonPayload() const + { + assert(m_errorPayloadType != ErrorPayloadType::XML); + return m_jsonPayload; + } + ERROR_TYPE m_errorType; Aws::String m_exceptionName; Aws::String m_message; - Aws::String m_remoteHostIpAddress; - Aws::String m_requestId; + Aws::String m_remoteHostIpAddress; + Aws::String m_requestId; Aws::Http::HeaderValueCollection m_responseHeaders; Aws::Http::HttpResponseCode m_responseCode; bool m_isRetryable; - - ErrorPayloadType m_errorPayloadType; - Aws::Utils::Xml::XmlDocument m_xmlPayload; - Aws::Utils::Json::JsonValue m_jsonPayload; + + ErrorPayloadType m_errorPayloadType; + Aws::Utils::Xml::XmlDocument m_xmlPayload; + Aws::Utils::Json::JsonValue m_jsonPayload; }; template<typename T> Aws::OStream& operator << (Aws::OStream& s, const AWSError<T>& e) { s << "HTTP response code: " << static_cast<int>(e.GetResponseCode()) << "\n" - << "Resolved remote host IP address: " << e.GetRemoteHostIpAddress() << "\n" - << "Request ID: " << e.GetRequestId() << "\n" + << "Resolved remote host IP address: " << e.GetRemoteHostIpAddress() << "\n" + << "Request ID: " << e.GetRequestId() << "\n" << "Exception name: " << e.GetExceptionName() << "\n" << "Error message: " << e.GetMessage() << "\n" << e.GetResponseHeaders().size() << " response headers:"; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h index c7a4b349e0..628b9565fd 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -16,18 +16,18 @@ namespace Aws enum class HttpResponseCode; } - namespace Utils - { - namespace Xml - { - class XmlDocument; - } - namespace Json - { - class JsonValue; - } - } - + namespace Utils + { + namespace Xml + { + class XmlDocument; + } + namespace Json + { + class JsonValue; + } + } + namespace Client { enum class CoreErrors; @@ -40,7 +40,7 @@ namespace Aws */ class AWS_CORE_API AWSErrorMarshaller { - public: + public: virtual ~AWSErrorMarshaller() {} /** @@ -53,14 +53,14 @@ namespace Aws */ virtual AWSError<CoreErrors> FindErrorByName(const char* exceptionName) const; virtual AWSError<CoreErrors> FindErrorByHttpResponseCode(Aws::Http::HttpResponseCode code) const; - /** - * Attempts to extract region from error. - */ - virtual Aws::String ExtractRegion(const AWSError<CoreErrors>&) const { return {}; } - /** - * Attempts to extract endpoint from error. - */ - virtual Aws::String ExtractEndpoint(const AWSError<CoreErrors>&) const { return {}; } + /** + * Attempts to extract region from error. + */ + virtual Aws::String ExtractRegion(const AWSError<CoreErrors>&) const { return {}; } + /** + * Attempts to extract endpoint from error. + */ + virtual Aws::String ExtractEndpoint(const AWSError<CoreErrors>&) const { return {}; } protected: AWSError<CoreErrors> Marshall(const Aws::String& exceptionName, const Aws::String& message) const; }; @@ -68,29 +68,29 @@ namespace Aws class AWS_CORE_API JsonErrorMarshaller : public AWSErrorMarshaller { using AWSErrorMarshaller::Marshall; - public: + public: /** * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns * and AWSError with CoreErrors::UNKNOWN as the error type. */ AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override; - - protected: - const Aws::Utils::Json::JsonValue& GetJsonPayloadFromError(const AWSError<CoreErrors>&) const; + + protected: + const Aws::Utils::Json::JsonValue& GetJsonPayloadFromError(const AWSError<CoreErrors>&) const; }; class AWS_CORE_API XmlErrorMarshaller : public AWSErrorMarshaller { using AWSErrorMarshaller::Marshall; - public: + public: /** * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns * and AWSError with CoreErrors::UNKNOWN as the error type. */ AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override; - - protected: - const Aws::Utils::Xml::XmlDocument& GetXmlPayloadFromError(const AWSError<CoreErrors>&) const; + + protected: + const Aws::Utils::Xml::XmlDocument& GetXmlPayloadFromError(const AWSError<CoreErrors>&) const; }; } // namespace Client diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h index feffd5f38e..6831791ffc 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once 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 2765d0cc8d..ba54baaa83 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -31,33 +31,33 @@ namespace Aws class RetryStrategy; // forward declare /** - * Sets the behaviors of the underlying HTTP clients handling response with 30x status code. - * By default, HTTP clients will always redirect the 30x response automatically, except when - * specifying aws-global as the client region, then SDK will handle 30x response and redirect - * the request manually. - */ - enum class FollowRedirectsPolicy - { - DEFAULT, - ALWAYS, - NEVER - }; - - /** - * This mutable structure is used to configure any of the AWS clients. - * Default values can only be overwritten prior to passing to the client constructors. - */ + * Sets the behaviors of the underlying HTTP clients handling response with 30x status code. + * By default, HTTP clients will always redirect the 30x response automatically, except when + * specifying aws-global as the client region, then SDK will handle 30x response and redirect + * the request manually. + */ + enum class FollowRedirectsPolicy + { + DEFAULT, + ALWAYS, + NEVER + }; + + /** + * This mutable structure is used to configure any of the AWS clients. + * Default values can only be overwritten prior to passing to the client constructors. + */ struct AWS_CORE_API ClientConfiguration { ClientConfiguration(); - - /** - * Create a configuration based on settings in the aws configuration file for the given profile name. - * The configuration file location can be set via the environment variable AWS_CONFIG_FILE - */ - ClientConfiguration(const char* profileName); - - /** + + /** + * Create a configuration based on settings in the aws configuration file for the given profile name. + * The configuration file location can be set via the environment variable AWS_CONFIG_FILE + */ + ClientConfiguration(const char* profileName); + + /** * User Agent string user for http calls. This is filled in for you in the constructor. Don't override this unless you have a really good reason. */ Aws::String userAgent; @@ -78,17 +78,17 @@ namespace Aws */ unsigned maxConnections; /** - * This is currently only applicable for Curl to set the http request level timeout, including possible dns lookup time, connection establish time, ssl handshake time and actual data transmission time. - * the corresponding Curl option is CURLOPT_TIMEOUT_MS - * defaults to 0, no http request level timeout. - */ - long httpRequestTimeoutMs; - /** - * Socket read timeouts for HTTP clients on Windows. Default 3000 ms. This should be more than adequate for most services. However, if you are transfering large amounts of data - * or are worried about higher latencies, you should set to something that makes more sense for your use case. - * For Curl, it's the low speed time, which contains the time in number milliseconds that transfer speed should be below "lowSpeedLimit" for the library to consider it too slow and abort. - * Note that for Curl this config is converted to seconds by rounding down to the nearest whole second except when the value is greater than 0 and less than 1000. In this case it is set to one second. When it's 0, low speed limit check will be disabled. - * Note that for Windows when this config is 0, the behavior is not specified by Windows. + * This is currently only applicable for Curl to set the http request level timeout, including possible dns lookup time, connection establish time, ssl handshake time and actual data transmission time. + * the corresponding Curl option is CURLOPT_TIMEOUT_MS + * defaults to 0, no http request level timeout. + */ + long httpRequestTimeoutMs; + /** + * Socket read timeouts for HTTP clients on Windows. Default 3000 ms. This should be more than adequate for most services. However, if you are transfering large amounts of data + * or are worried about higher latencies, you should set to something that makes more sense for your use case. + * For Curl, it's the low speed time, which contains the time in number milliseconds that transfer speed should be below "lowSpeedLimit" for the library to consider it too slow and abort. + * Note that for Curl this config is converted to seconds by rounding down to the nearest whole second except when the value is greater than 0 and less than 1000. In this case it is set to one second. When it's 0, low speed limit check will be disabled. + * Note that for Windows when this config is 0, the behavior is not specified by Windows. */ long requestTimeoutMs; /** @@ -96,22 +96,22 @@ namespace Aws */ long connectTimeoutMs; /** - * Enable TCP keep-alive. Default true; - * No-op for WinHTTP, WinINet and IXMLHTTPRequest2 client. - */ - bool enableTcpKeepAlive; - /** - * Interval to send a keep-alive packet over the connection. Default 30 seconds. Minimum 15 seconds. - * WinHTTP & libcurl support this option. Note that for Curl, this value will be rounded to an integer with second granularity. - * No-op for WinINet and IXMLHTTPRequest2 client. - */ - unsigned long tcpKeepAliveIntervalMs; - /** - * Average transfer speed in bytes per second that the transfer should be below during the request timeout interval for it to be considered too slow and abort. - * Default 1 byte/second. Only for CURL client currently. - */ - unsigned long lowSpeedLimit; - /** + * Enable TCP keep-alive. Default true; + * No-op for WinHTTP, WinINet and IXMLHTTPRequest2 client. + */ + bool enableTcpKeepAlive; + /** + * Interval to send a keep-alive packet over the connection. Default 30 seconds. Minimum 15 seconds. + * WinHTTP & libcurl support this option. Note that for Curl, this value will be rounded to an integer with second granularity. + * No-op for WinINet and IXMLHTTPRequest2 client. + */ + unsigned long tcpKeepAliveIntervalMs; + /** + * Average transfer speed in bytes per second that the transfer should be below during the request timeout interval for it to be considered too slow and abort. + * Default 1 byte/second. Only for CURL client currently. + */ + unsigned long lowSpeedLimit; + /** * Strategy to use in case of failed requests. Default is DefaultRetryStrategy (e.g. exponential backoff) */ std::shared_ptr<RetryStrategy> retryStrategy; @@ -140,31 +140,31 @@ namespace Aws */ Aws::String proxyPassword; /** - * SSL Certificate file to use for connecting to an HTTPS proxy. - * Used to set CURLOPT_PROXY_SSLCERT in libcurl. Example: client.pem - */ - Aws::String proxySSLCertPath; - /** - * Type of proxy client SSL certificate. - * Used to set CURLOPT_PROXY_SSLCERTTYPE in libcurl. Example: PEM - */ - Aws::String proxySSLCertType; - /** - * Private key file to use for connecting to an HTTPS proxy. - * Used to set CURLOPT_PROXY_SSLKEY in libcurl. Example: key.pem - */ - Aws::String proxySSLKeyPath; - /** - * Type of private key file used to connect to an HTTPS proxy. - * Used to set CURLOPT_PROXY_SSLKEYTYPE in libcurl. Example: PEM - */ - Aws::String proxySSLKeyType; - /** - * Passphrase to the private key file used to connect to an HTTPS proxy. - * Used to set CURLOPT_PROXY_KEYPASSWD in libcurl. Example: password1 - */ - Aws::String proxySSLKeyPassword; - /** + * SSL Certificate file to use for connecting to an HTTPS proxy. + * Used to set CURLOPT_PROXY_SSLCERT in libcurl. Example: client.pem + */ + Aws::String proxySSLCertPath; + /** + * Type of proxy client SSL certificate. + * Used to set CURLOPT_PROXY_SSLCERTTYPE in libcurl. Example: PEM + */ + Aws::String proxySSLCertType; + /** + * Private key file to use for connecting to an HTTPS proxy. + * Used to set CURLOPT_PROXY_SSLKEY in libcurl. Example: key.pem + */ + Aws::String proxySSLKeyPath; + /** + * Type of private key file used to connect to an HTTPS proxy. + * Used to set CURLOPT_PROXY_SSLKEYTYPE in libcurl. Example: PEM + */ + Aws::String proxySSLKeyType; + /** + * Passphrase to the private key file used to connect to an HTTPS proxy. + * Used to set CURLOPT_PROXY_KEYPASSWD in libcurl. Example: password1 + */ + Aws::String proxySSLKeyPassword; + /** * Threading Executor implementation. Default uses std::thread::detach() */ std::shared_ptr<Aws::Utils::Threading::Executor> executor; @@ -208,9 +208,9 @@ namespace Aws */ Aws::Http::TransferLibType httpLibOverride; /** - * Sets the behavior how http stack handles 30x redirect codes. + * Sets the behavior how http stack handles 30x redirect codes. */ - FollowRedirectsPolicy followRedirects; + FollowRedirectsPolicy followRedirects; /** * Only works for Curl http client. @@ -229,26 +229,26 @@ namespace Aws bool enableClockSkewAdjustment; /** - * Enable host prefix injection. + * Enable host prefix injection. * For services whose endpoint is injectable. e.g. servicediscovery, you can modify the http host's prefix so as to add "data-" prefix for DiscoverInstances request. - * Default to true, enabled. You can disable it for testing purpose. + * Default to true, enabled. You can disable it for testing purpose. */ bool enableHostPrefixInjection; /** - * Enable endpoint discovery - * For some services to dynamically set up their endpoints for different requests. + * Enable endpoint discovery + * For some services to dynamically set up their endpoints for different requests. * Defaults to false, it's an opt-in feature. * If disabled, regional or overriden endpoint will be used instead. * If a request requires endpoint discovery but you disabled it. The request will never succeed. */ bool enableEndpointDiscovery; - - /** - * profileName in config file that will be used by this object to reslove more configurations. - */ - Aws::String profileName; - + + /** + * profileName in config file that will be used by this object to reslove more configurations. + */ + Aws::String profileName; + }; } // namespace Client diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h index 6747539ac2..52ebe51c82 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h @@ -1,14 +1,14 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include "aws/core/Core_EXPORTS.h" namespace Aws { - namespace Http + namespace Http { enum class HttpResponseCode; } @@ -26,17 +26,17 @@ namespace Aws INVALID_PARAMETER_COMBINATION = 4, INVALID_QUERY_PARAMETER = 5, INVALID_PARAMETER_VALUE = 6, - MISSING_ACTION = 7, // SDK should never allow + MISSING_ACTION = 7, // SDK should never allow MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow - MISSING_PARAMETER = 9, // SDK should never allow + MISSING_PARAMETER = 9, // SDK should never allow OPT_IN_REQUIRED = 10, REQUEST_EXPIRED = 11, SERVICE_UNAVAILABLE = 12, THROTTLING = 13, VALIDATION = 14, ACCESS_DENIED = 15, - RESOURCE_NOT_FOUND = 16, // Shared with multiple services - UNRECOGNIZED_CLIENT = 17, // Most likely caused by an invalid access key or secret key + RESOURCE_NOT_FOUND = 16, // Shared with multiple services + UNRECOGNIZED_CLIENT = 17, // Most likely caused by an invalid access key or secret key MALFORMED_QUERY_STRING = 18, // Where does this come from? (cognito identity uses it) SLOW_DOWN = 19, REQUEST_TIME_TOO_SKEWED = 20, @@ -45,12 +45,12 @@ namespace Aws INVALID_ACCESS_KEY_ID = 23, REQUEST_TIMEOUT = 24, - NETWORK_CONNECTION = 99, // General failure to send message to service + NETWORK_CONNECTION = 99, // General failure to send message to service // These are needed for logical reasons - UNKNOWN = 100, // Unknown to the SDK + UNKNOWN = 100, // Unknown to the SDK CLIENT_SIGNING_FAILURE = 101, // Client failed to sign the request - USER_CANCELLED = 102, // User cancelled the request + USER_CANCELLED = 102, // User cancelled the request SERVICE_EXTENSION_START_RANGE = 128 }; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h index 3d7efb5e76..0357c5ed0c 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -18,16 +18,16 @@ class AWS_CORE_API DefaultRetryStrategy : public RetryStrategy public: DefaultRetryStrategy(long maxRetries = 10, long scaleFactor = 25) : - m_scaleFactor(scaleFactor), m_maxRetries(maxRetries) + m_scaleFactor(scaleFactor), m_maxRetries(maxRetries) {} - bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; + bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; - long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; + long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; - virtual long GetMaxAttempts() const override { return m_maxRetries + 1; } - -protected: + virtual long GetMaxAttempts() const override { return m_maxRetries + 1; } + +protected: long m_scaleFactor; long m_maxRetries; }; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h index ab1c3fa7bb..930eaa581d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h @@ -1,121 +1,121 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/threading/ReaderWriterLock.h> -#include <memory> +#include <aws/core/utils/threading/ReaderWriterLock.h> +#include <memory> namespace Aws { - namespace Http - { - class HttpResponse; - } - - namespace Utils - { - template<typename R, typename E> - class Outcome; - } - + namespace Http + { + class HttpResponse; + } + + namespace Utils + { + template<typename R, typename E> + class Outcome; + } + namespace Client { enum class CoreErrors; template<typename ERROR_TYPE> class AWSError; - typedef Utils::Outcome<std::shared_ptr<Aws::Http::HttpResponse>, AWSError<CoreErrors>> HttpResponseOutcome; - + typedef Utils::Outcome<std::shared_ptr<Aws::Http::HttpResponse>, AWSError<CoreErrors>> HttpResponseOutcome; + /** * Interface for defining a Retry Strategy. Override this class to provide your own custom retry behavior. */ class AWS_CORE_API RetryStrategy { public: - virtual ~RetryStrategy() = default; + virtual ~RetryStrategy() = default; /** * Returns true if the error can be retried given the error and the number of times already tried. */ virtual bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0; /** - * Calculates the time in milliseconds the client should sleep before attempting another request based on the error and attemptedRetries count. + * Calculates the time in milliseconds the client should sleep before attempting another request based on the error and attemptedRetries count. */ virtual long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0; - /** - * Gets max number of attempts allowed for an operation. - * Returns non positive value if not defined. - */ - virtual long GetMaxAttempts() const { return 0; } - - /** - * Retrives send tokens from the bucket. - */ - virtual void GetSendToken() {} - - /** - * Update status, like the information of retry quota when receiving a response. - */ - virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */) {} - virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */, const AWSError<CoreErrors>& /* lastError */) {} + /** + * Gets max number of attempts allowed for an operation. + * Returns non positive value if not defined. + */ + virtual long GetMaxAttempts() const { return 0; } + + /** + * Retrives send tokens from the bucket. + */ + virtual void GetSendToken() {} + + /** + * Update status, like the information of retry quota when receiving a response. + */ + virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */) {} + virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */, const AWSError<CoreErrors>& /* lastError */) {} + }; + + /** + * The container for retry quotas. + * A failed request will acquire retry quotas to retry. + * And a successful request will release quotas back. + * If running out of retry quotas, then the client is not able to retry. + */ + class AWS_CORE_API RetryQuotaContainer + { + public: + virtual ~RetryQuotaContainer() = default; + virtual bool AcquireRetryQuota(int capacityAmount) = 0; + virtual bool AcquireRetryQuota(const AWSError<CoreErrors>& error) = 0; + virtual void ReleaseRetryQuota(int capacityAmount) = 0; + virtual void ReleaseRetryQuota(const AWSError<CoreErrors>& lastError) = 0; + virtual int GetRetryQuota() const = 0; + }; + + class AWS_CORE_API DefaultRetryQuotaContainer : public RetryQuotaContainer + { + public: + DefaultRetryQuotaContainer(); + virtual ~DefaultRetryQuotaContainer() = default; + virtual bool AcquireRetryQuota(int capacityAmount) override; + virtual bool AcquireRetryQuota(const AWSError<CoreErrors>& error) override; + virtual void ReleaseRetryQuota(int capacityAmount) override; + virtual void ReleaseRetryQuota(const AWSError<CoreErrors>& lastError) override; + virtual int GetRetryQuota() const override { return m_retryQuota; } + + protected: + mutable Aws::Utils::Threading::ReaderWriterLock m_retryQuotaLock; + int m_retryQuota; }; - /** - * The container for retry quotas. - * A failed request will acquire retry quotas to retry. - * And a successful request will release quotas back. - * If running out of retry quotas, then the client is not able to retry. - */ - class AWS_CORE_API RetryQuotaContainer - { - public: - virtual ~RetryQuotaContainer() = default; - virtual bool AcquireRetryQuota(int capacityAmount) = 0; - virtual bool AcquireRetryQuota(const AWSError<CoreErrors>& error) = 0; - virtual void ReleaseRetryQuota(int capacityAmount) = 0; - virtual void ReleaseRetryQuota(const AWSError<CoreErrors>& lastError) = 0; - virtual int GetRetryQuota() const = 0; - }; - - class AWS_CORE_API DefaultRetryQuotaContainer : public RetryQuotaContainer - { - public: - DefaultRetryQuotaContainer(); - virtual ~DefaultRetryQuotaContainer() = default; - virtual bool AcquireRetryQuota(int capacityAmount) override; - virtual bool AcquireRetryQuota(const AWSError<CoreErrors>& error) override; - virtual void ReleaseRetryQuota(int capacityAmount) override; - virtual void ReleaseRetryQuota(const AWSError<CoreErrors>& lastError) override; - virtual int GetRetryQuota() const override { return m_retryQuota; } - - protected: - mutable Aws::Utils::Threading::ReaderWriterLock m_retryQuotaLock; - int m_retryQuota; - }; - - class AWS_CORE_API StandardRetryStrategy : public RetryStrategy - { - public: - StandardRetryStrategy(long maxAttempts = 3); - StandardRetryStrategy(std::shared_ptr<RetryQuotaContainer> retryQuotaContainer, long maxAttempts = 3); - - virtual void RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome) override; - virtual void RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome, const AWSError<CoreErrors>& lastError) override; - - virtual bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; - - virtual long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; - - virtual long GetMaxAttempts() const override { return m_maxAttempts; } - - protected: - std::shared_ptr<RetryQuotaContainer> m_retryQuotaContainer; - long m_maxAttempts; - }; + class AWS_CORE_API StandardRetryStrategy : public RetryStrategy + { + public: + StandardRetryStrategy(long maxAttempts = 3); + StandardRetryStrategy(std::shared_ptr<RetryQuotaContainer> retryQuotaContainer, long maxAttempts = 3); + + virtual void RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome) override; + virtual void RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome, const AWSError<CoreErrors>& lastError) override; + + virtual bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; + + virtual long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; + + virtual long GetMaxAttempts() const override { return m_maxAttempts; } + + protected: + std::shared_ptr<RetryQuotaContainer> m_retryQuotaContainer; + long m_maxAttempts; + }; } // namespace Client } // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h index 50136fbe03..09cfc95d8f 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h @@ -1,34 +1,34 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once - -#include <aws/core/client/DefaultRetryStrategy.h> -#include <aws/core/utils/memory/stl/AWSString.h> -#include <aws/core/utils/memory/stl/AWSVector.h> -namespace Aws -{ -namespace Client -{ - -/** - * @brief This retry strategy is almost identical to DefaultRetryStrategy, except it accepts a vector of error or exception names - * that you want to retry anyway (bypass the retryable definition of the error instance itself) if the retry attempts is less than maxRetries. - */ -class AWS_CORE_API SpecifiedRetryableErrorsRetryStrategy : public DefaultRetryStrategy -{ -public: - SpecifiedRetryableErrorsRetryStrategy(const Aws::Vector<Aws::String>& specifiedRetryableErrors, long maxRetries = 10, long scaleFactor = 25) : - DefaultRetryStrategy(maxRetries, scaleFactor), m_specifiedRetryableErrors(specifiedRetryableErrors) - {} - - bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; - -private: - Aws::Vector<Aws::String> m_specifiedRetryableErrors; -}; - -} // namespace Client -} // namespace Aws +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#pragma once + +#include <aws/core/client/DefaultRetryStrategy.h> +#include <aws/core/utils/memory/stl/AWSString.h> +#include <aws/core/utils/memory/stl/AWSVector.h> +namespace Aws +{ +namespace Client +{ + +/** + * @brief This retry strategy is almost identical to DefaultRetryStrategy, except it accepts a vector of error or exception names + * that you want to retry anyway (bypass the retryable definition of the error instance itself) if the retry attempts is less than maxRetries. + */ +class AWS_CORE_API SpecifiedRetryableErrorsRetryStrategy : public DefaultRetryStrategy +{ +public: + SpecifiedRetryableErrorsRetryStrategy(const Aws::Vector<Aws::String>& specifiedRetryableErrors, long maxRetries = 10, long scaleFactor = 25) : + DefaultRetryStrategy(maxRetries, scaleFactor), m_specifiedRetryableErrors(specifiedRetryableErrors) + {} + + bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override; + +private: + Aws::Vector<Aws::String> m_specifiedRetryableErrors; +}; + +} // namespace Client +} // namespace Aws 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 2c868f4904..84c62713da 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -9,7 +9,7 @@ #include <aws/core/utils/memory/stl/AWSMap.h> #include <aws/core/auth/AWSCredentials.h> #include <aws/core/utils/DateTime.h> -#include <aws/core/utils/threading/ReaderWriterLock.h> +#include <aws/core/utils/threading/ReaderWriterLock.h> namespace Aws { @@ -87,8 +87,8 @@ namespace Aws */ inline const Aws::Utils::DateTime& LastLoadTime() const { return m_lastLoadTime; } - using ProfilesContainer = Aws::Map<Aws::String, Aws::Config::Profile>; - + using ProfilesContainer = Aws::Map<Aws::String, Aws::Config::Profile>; + protected: /** * Subclasses override this method to implement fetching the profiles. @@ -100,7 +100,7 @@ namespace Aws */ virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) { return false; } - ProfilesContainer m_profiles; + ProfilesContainer m_profiles; Aws::Utils::DateTime m_lastLoadTime; }; @@ -124,12 +124,12 @@ namespace Aws */ const Aws::String& GetFileName() const { return m_fileName; } - /** - * Give loader the ability to change the file path to load config from. - * This can avoid creating new loader object if the file changed. - */ - void SetFileName(const Aws::String& fileName) { m_fileName = fileName; } - + /** + * Give loader the ability to change the file path to load config from. + * This can avoid creating new loader object if the file changed. + */ + void SetFileName(const Aws::String& fileName) { m_fileName = fileName; } + protected: virtual bool LoadInternal() override; virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) override; @@ -160,91 +160,91 @@ namespace Aws private: std::shared_ptr<Aws::Internal::EC2MetadataClient> m_ec2metadataClient; }; - - /** - * Stores the contents of config file and credentials file to avoid multiple file readings. - * At the same time provides the flexibility to reload from file. - */ - class AWS_CORE_API ConfigAndCredentialsCacheManager - { - public: - ConfigAndCredentialsCacheManager(); - - void ReloadConfigFile(); - - void ReloadCredentialsFile(); - - bool HasConfigProfile(const Aws::String& profileName) const; - - /** - * Returns cached config profile with the specified profile name. - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::Config::Profile GetConfigProfile(const Aws::String& profileName) const; - - /** - * Returns cached config profiles - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::Map<Aws::String, Aws::Config::Profile> GetConfigProfiles() const; - - /** - * Returns cached config value with the specified profile name and key. - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::String GetConfig(const Aws::String& profileName, const Aws::String& key) const; - - bool HasCredentialsProfile(const Aws::String& profileName) const; - /** - * Returns cached credentials profile with the specified profile name. - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::Config::Profile GetCredentialsProfile(const Aws::String& profileName) const; - - /** - * Returns cached credentials profiles. - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::Map<Aws::String, Aws::Config::Profile> GetCredentialsProfiles() const; - - /** - * Returns cached credentials with the specified profile name. - * Using copy instead of const reference to avoid reading bad contents due to thread contention. - */ - Aws::Auth::AWSCredentials GetCredentials(const Aws::String& profileName) const; - - private: - mutable Aws::Utils::Threading::ReaderWriterLock m_credentialsLock; - Aws::Config::AWSConfigFileProfileConfigLoader m_credentialsFileLoader; - mutable Aws::Utils::Threading::ReaderWriterLock m_configLock; - Aws::Config::AWSConfigFileProfileConfigLoader m_configFileLoader; - }; - - AWS_CORE_API void InitConfigAndCredentialsCacheManager(); - - AWS_CORE_API void CleanupConfigAndCredentialsCacheManager(); - - AWS_CORE_API void ReloadCachedConfigFile(); - - AWS_CORE_API void ReloadCachedCredentialsFile(); - - AWS_CORE_API bool HasCachedConfigProfile(const Aws::String& profileName); - - AWS_CORE_API Aws::Config::Profile GetCachedConfigProfile(const Aws::String& profileName); - - AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedConfigProfiles(); - - AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& profileName, const Aws::String& key); - - AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& key); - - AWS_CORE_API bool HasCachedCredentialsProfile(const Aws::String &profileName); - - AWS_CORE_API Aws::Config::Profile GetCachedCredentialsProfile(const Aws::String& profileName); - - AWS_CORE_API Aws::Auth::AWSCredentials GetCachedCredentials(const Aws::String& profileName); - - AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles(); - + + /** + * Stores the contents of config file and credentials file to avoid multiple file readings. + * At the same time provides the flexibility to reload from file. + */ + class AWS_CORE_API ConfigAndCredentialsCacheManager + { + public: + ConfigAndCredentialsCacheManager(); + + void ReloadConfigFile(); + + void ReloadCredentialsFile(); + + bool HasConfigProfile(const Aws::String& profileName) const; + + /** + * Returns cached config profile with the specified profile name. + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::Config::Profile GetConfigProfile(const Aws::String& profileName) const; + + /** + * Returns cached config profiles + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::Map<Aws::String, Aws::Config::Profile> GetConfigProfiles() const; + + /** + * Returns cached config value with the specified profile name and key. + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::String GetConfig(const Aws::String& profileName, const Aws::String& key) const; + + bool HasCredentialsProfile(const Aws::String& profileName) const; + /** + * Returns cached credentials profile with the specified profile name. + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::Config::Profile GetCredentialsProfile(const Aws::String& profileName) const; + + /** + * Returns cached credentials profiles. + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::Map<Aws::String, Aws::Config::Profile> GetCredentialsProfiles() const; + + /** + * Returns cached credentials with the specified profile name. + * Using copy instead of const reference to avoid reading bad contents due to thread contention. + */ + Aws::Auth::AWSCredentials GetCredentials(const Aws::String& profileName) const; + + private: + mutable Aws::Utils::Threading::ReaderWriterLock m_credentialsLock; + Aws::Config::AWSConfigFileProfileConfigLoader m_credentialsFileLoader; + mutable Aws::Utils::Threading::ReaderWriterLock m_configLock; + Aws::Config::AWSConfigFileProfileConfigLoader m_configFileLoader; + }; + + AWS_CORE_API void InitConfigAndCredentialsCacheManager(); + + AWS_CORE_API void CleanupConfigAndCredentialsCacheManager(); + + AWS_CORE_API void ReloadCachedConfigFile(); + + AWS_CORE_API void ReloadCachedCredentialsFile(); + + AWS_CORE_API bool HasCachedConfigProfile(const Aws::String& profileName); + + AWS_CORE_API Aws::Config::Profile GetCachedConfigProfile(const Aws::String& profileName); + + AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedConfigProfiles(); + + AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& profileName, const Aws::String& key); + + AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& key); + + AWS_CORE_API bool HasCachedCredentialsProfile(const Aws::String &profileName); + + AWS_CORE_API Aws::Config::Profile GetCachedCredentialsProfile(const Aws::String& profileName); + + AWS_CORE_API Aws::Auth::AWSCredentials GetCachedCredentials(const Aws::String& profileName); + + AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles(); + } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h index 7ee4c93bc8..9a010a67db 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h @@ -197,7 +197,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); -CJSON_PUBLIC(cJSON *) cJSON_CreateInt64(long long num); +CJSON_PUBLIC(cJSON *) cJSON_CreateInt64(long long num); CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); /* raw json */ CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); @@ -229,7 +229,7 @@ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJ CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); -/* Remove/Detach items from Arrays/Objects. */ +/* Remove/Detach items from Arrays/Objects. */ CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h index 54b1a6470b..3721ed1f97 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h @@ -23,7 +23,7 @@ distribution. /* This file has been modified from its original version by Amazon: (1) Memory management operations use aws memory management api - (2) Import-export preprocessor logic tweaked for better integration into core library + (2) Import-export preprocessor logic tweaked for better integration into core library (3) Wrapped everything in Amazon namespace to prevent static linking issues if the user includes a version of this code through another dependency */ #ifndef TINYXML2_INCLUDED @@ -356,7 +356,7 @@ public: ~MemPoolT() { Clear(); } - + void Clear() { // Delete the blocks. while( !_blockPtrs.Empty()) { @@ -402,7 +402,7 @@ public: ++_nUntracked; return result; } - + virtual void Free( void* mem ) { if ( !mem ) { return; @@ -578,7 +578,7 @@ public: static bool IsWhiteSpace( char p ) { return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) ); } - + inline static bool IsNameStartChar( unsigned char ch ) { if ( ch >= 128 ) { // This is a heuristic guess in attempt to not implement Unicode-aware isalpha() @@ -589,7 +589,7 @@ public: } return ch == ':' || ch == '_'; } - + inline static bool IsNameChar( unsigned char ch ) { return IsNameStartChar( ch ) || isdigit( ch ) @@ -606,7 +606,7 @@ public: TIXMLASSERT( nChar >= 0 ); return strncmp( p, q, nChar ) == 0; } - + inline static bool IsUTF8Continuation( char p ) { return ( p & 0x80 ) != 0; } @@ -888,11 +888,11 @@ public: Make a copy of this node and all its children. If the 'target' is null, then the nodes will - be allocated in the current document. If 'target' - is specified, the memory will be allocated is the + be allocated in the current document. If 'target' + is specified, the memory will be allocated is the specified XMLDocument. - NOTE: This is probably not the correct tool to + NOTE: This is probably not the correct tool to copy a document, since XMLDocuments can have multiple top level XMLNodes. You probably want to use XMLDocument::DeepCopy() @@ -931,8 +931,8 @@ public: */ virtual bool Accept( XMLVisitor* visitor ) const = 0; - /** - Set user data into the XMLNode. TinyXML-2 in + /** + Set user data into the XMLNode. TinyXML-2 in no way processes or interprets user data. It is initially 0. */ @@ -1379,14 +1379,14 @@ public: return a->QueryFloatValue( value ); } - + /** Given an attribute name, QueryAttribute() returns XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion can't be performed, or XML_NO_ATTRIBUTE if the attribute doesn't exist. It is overloaded for the primitive types, and is a generally more convenient replacement of QueryIntAttribute() and related functions. - + If successful, the result of the conversion will be written to 'value'. If not successful, nothing will be written to 'value'. This allows you to provide default @@ -1525,7 +1525,7 @@ public: @verbatim <foo>Hullaballoo!<b>This is text</b></foo> @endverbatim - + For this XML: @verbatim <foo /> @@ -1539,15 +1539,15 @@ public: /// Convenience method for setting text inside an element. See SetText() for important limitations. void SetText( int value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( unsigned value ); + void SetText( unsigned value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. void SetText(int64_t value); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( bool value ); + void SetText( bool value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( double value ); + void SetText( double value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( float value ); + void SetText( float value ); /** Convenience method to query the value of a child text node. This is probably best @@ -1655,7 +1655,7 @@ class TINYXML2_LIB XMLDocument : public XMLNode friend class XMLElement; // Gives access to SetError, but over-access for everything else. // Wishing C++ had "internal" scope. - friend class XMLNode; + friend class XMLNode; friend class XMLText; friend class XMLComment; friend class XMLDeclaration; @@ -1695,8 +1695,8 @@ public: /** Load an XML file from disk. You are responsible - for providing and closing the FILE*. - + for providing and closing the FILE*. + NOTE: The file should be opened as binary ("rb") not text in order for TinyXML-2 to correctly do newline normalization. @@ -1826,7 +1826,7 @@ public: const char* ErrorName() const; static const char* ErrorIDToName(XMLError errorID); - /** Returns a "long form" error description. A hopefully helpful + /** Returns a "long form" error description. A hopefully helpful diagnostic with location, line number, and/or additional info. */ const char* ErrorStr() const; @@ -1834,12 +1834,12 @@ public: /// A (trivial) utility function that prints the ErrorStr() to stdout. void PrintError() const; - /// Return the line where the error occurred, or zero if unknown. + /// Return the line where the error occurred, or zero if unknown. int ErrorLineNum() const { return _errorLineNum; } - + /// Clear the document, resetting it to the initial state. void Clear(); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h index 5335c68ba0..4c292064d7 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -37,16 +37,16 @@ namespace Aws virtual ~HttpClient() {} /** - * Takes an http request, makes it, and returns the newly allocated HttpResponse. + * Takes an http request, makes it, and returns the newly allocated HttpResponse. */ - virtual std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request, + virtual std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request, Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr, Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const = 0; /** - * If yes, the http client supports transfer-encoding:chunked. + * If yes, the http client supports transfer-encoding:chunked. */ - virtual bool SupportsChunkedTransferEncoding() const { return true; } + virtual bool SupportsChunkedTransferEncoding() const { return true; } /** * Stops all requests in progress and prevents any others from initiating. diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h index 2b4055b579..a82a773c04 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h index 100f203be2..ab71a3a29b 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -20,34 +20,34 @@ namespace Aws { namespace Http { - extern AWS_CORE_API const char DATE_HEADER[]; - extern AWS_CORE_API const char AWS_DATE_HEADER[]; - extern AWS_CORE_API const char AWS_SECURITY_TOKEN[]; - extern AWS_CORE_API const char ACCEPT_HEADER[]; - extern AWS_CORE_API const char ACCEPT_CHAR_SET_HEADER[]; - extern AWS_CORE_API const char ACCEPT_ENCODING_HEADER[]; - extern AWS_CORE_API const char AUTHORIZATION_HEADER[]; - extern AWS_CORE_API const char AWS_AUTHORIZATION_HEADER[]; - extern AWS_CORE_API const char COOKIE_HEADER[]; - extern AWS_CORE_API const char CONTENT_LENGTH_HEADER[]; - extern AWS_CORE_API const char CONTENT_TYPE_HEADER[]; - extern AWS_CORE_API const char TRANSFER_ENCODING_HEADER[]; - extern AWS_CORE_API const char USER_AGENT_HEADER[]; - extern AWS_CORE_API const char VIA_HEADER[]; - extern AWS_CORE_API const char HOST_HEADER[]; - extern AWS_CORE_API const char AMZ_TARGET_HEADER[]; - extern AWS_CORE_API const char X_AMZ_EXPIRES_HEADER[]; - extern AWS_CORE_API const char CONTENT_MD5_HEADER[]; - extern AWS_CORE_API const char API_VERSION_HEADER[]; - extern AWS_CORE_API const char SDK_INVOCATION_ID_HEADER[]; - extern AWS_CORE_API const char SDK_REQUEST_HEADER[]; - extern AWS_CORE_API const char CHUNKED_VALUE[]; + extern AWS_CORE_API const char DATE_HEADER[]; + extern AWS_CORE_API const char AWS_DATE_HEADER[]; + extern AWS_CORE_API const char AWS_SECURITY_TOKEN[]; + extern AWS_CORE_API const char ACCEPT_HEADER[]; + extern AWS_CORE_API const char ACCEPT_CHAR_SET_HEADER[]; + extern AWS_CORE_API const char ACCEPT_ENCODING_HEADER[]; + extern AWS_CORE_API const char AUTHORIZATION_HEADER[]; + extern AWS_CORE_API const char AWS_AUTHORIZATION_HEADER[]; + extern AWS_CORE_API const char COOKIE_HEADER[]; + extern AWS_CORE_API const char CONTENT_LENGTH_HEADER[]; + extern AWS_CORE_API const char CONTENT_TYPE_HEADER[]; + extern AWS_CORE_API const char TRANSFER_ENCODING_HEADER[]; + extern AWS_CORE_API const char USER_AGENT_HEADER[]; + extern AWS_CORE_API const char VIA_HEADER[]; + extern AWS_CORE_API const char HOST_HEADER[]; + extern AWS_CORE_API const char AMZ_TARGET_HEADER[]; + extern AWS_CORE_API const char X_AMZ_EXPIRES_HEADER[]; + extern AWS_CORE_API const char CONTENT_MD5_HEADER[]; + extern AWS_CORE_API const char API_VERSION_HEADER[]; + extern AWS_CORE_API const char SDK_INVOCATION_ID_HEADER[]; + extern AWS_CORE_API const char SDK_REQUEST_HEADER[]; + extern AWS_CORE_API const char CHUNKED_VALUE[]; class HttpRequest; class HttpResponse; /** - * closure type for receiving notifications that data has been received. + * closure type for receiving notifications that data has been received. */ typedef std::function<void(const HttpRequest*, HttpResponse*, long long)> DataReceivedEventHandler; /** @@ -69,7 +69,7 @@ namespace Aws * Initializes an HttpRequest object with uri and http method. */ HttpRequest(const URI& uri, HttpMethod method) : - m_uri(uri), m_method(method), m_isEvenStreamRequest(false) + m_uri(uri), m_method(method), m_isEvenStreamRequest(false) {} virtual ~HttpRequest() {} @@ -79,7 +79,7 @@ namespace Aws */ virtual HeaderValueCollection GetHeaders() const = 0; /** - * Get the value for a Header based on its name. (in default StandardHttpRequest implementation, an empty string will be returned if headerName doesn't exist) + * Get the value for a Header based on its name. (in default StandardHttpRequest implementation, an empty string will be returned if headerName doesn't exist) */ virtual const Aws::String& GetHeaderValue(const char* headerName) const = 0; /** @@ -131,7 +131,7 @@ namespace Aws const URI& GetUri() const { return m_uri; } /** * Converts the URI into a string and returns it. If includeQueryString is set to true, the query string - * will be included in the returned value. + * will be included in the returned value. */ inline Aws::String GetURIString(bool includeQueryString = true) const { @@ -173,7 +173,7 @@ namespace Aws m_uri.AddQueryStringParameter(key, value); } - inline bool HasDate() const + inline bool HasDate() const { return HasHeader(DATE_HEADER); } @@ -363,25 +363,25 @@ namespace Aws SetHeaderValue(CONTENT_TYPE_HEADER, value); } - inline bool HasTransferEncoding() const - { - return HasHeader(TRANSFER_ENCODING_HEADER); - } - /** - * Gets transfer-encoding header. - */ - inline const Aws::String& GetTransferEncoding() const - { - return GetHeaderValue(TRANSFER_ENCODING_HEADER); - } - /** - * Sets transfer-encoding header. - */ - inline void SetTransferEncoding(const Aws::String& value) - { - SetHeaderValue(TRANSFER_ENCODING_HEADER, value); - } - + inline bool HasTransferEncoding() const + { + return HasHeader(TRANSFER_ENCODING_HEADER); + } + /** + * Gets transfer-encoding header. + */ + inline const Aws::String& GetTransferEncoding() const + { + return GetHeaderValue(TRANSFER_ENCODING_HEADER); + } + /** + * Sets transfer-encoding header. + */ + inline void SetTransferEncoding(const Aws::String& value) + { + SetHeaderValue(TRANSFER_ENCODING_HEADER, value); + } + inline bool HasUserAgent() const { return HasHeader(USER_AGENT_HEADER); @@ -507,12 +507,12 @@ namespace Aws /** * Sets the request metrics */ - virtual void SetRequestMetrics(const Aws::Monitoring::HttpClientMetricsCollection& collection) { m_httpRequestMetrics = collection; } + virtual void SetRequestMetrics(const Aws::Monitoring::HttpClientMetricsCollection& collection) { m_httpRequestMetrics = collection; } /** * Gets the request metrics */ - virtual const Aws::Monitoring::HttpClientMetricsCollection& GetRequestMetrics() const { return m_httpRequestMetrics; } + virtual const Aws::Monitoring::HttpClientMetricsCollection& GetRequestMetrics() const { return m_httpRequestMetrics; } /** * Returns the IP address of the remote host the request was made out to. @@ -523,19 +523,19 @@ namespace Aws Aws::String GetResolvedRemoteHost() const { return m_resolvedRemoteHost; } void SetResolvedRemoteHost(const Aws::String& ip) { m_resolvedRemoteHost = ip; } - bool IsEventStreamRequest() { return m_isEvenStreamRequest; } - void SetEventStreamRequest(bool eventStreamRequest) { m_isEvenStreamRequest = eventStreamRequest; } + bool IsEventStreamRequest() { return m_isEvenStreamRequest; } + void SetEventStreamRequest(bool eventStreamRequest) { m_isEvenStreamRequest = eventStreamRequest; } private: URI m_uri; HttpMethod m_method; - bool m_isEvenStreamRequest; + bool m_isEvenStreamRequest; DataReceivedEventHandler m_onDataReceived; DataSentEventHandler m_onDataSent; ContinueRequestHandler m_continueRequest; Aws::String m_signingRegion; Aws::String m_signingAccessKey; Aws::String m_resolvedRemoteHost; - Aws::Monitoring::HttpClientMetricsCollection m_httpRequestMetrics; + Aws::Monitoring::HttpClientMetricsCollection m_httpRequestMetrics; }; } // namespace Http diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h index ccb0a11be7..1db30d1730 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -10,7 +10,7 @@ #include <aws/core/http/HttpTypes.h> #include <aws/core/utils/memory/AWSMemory.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> -#include <aws/core/client/CoreErrors.h> +#include <aws/core/client/CoreErrors.h> namespace Aws { @@ -96,7 +96,7 @@ namespace Aws GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505, VARIANT_ALSO_NEGOTIATES = 506, - INSUFFICIENT_STORAGE = 507, + INSUFFICIENT_STORAGE = 507, LOOP_DETECTED = 508, BANDWIDTH_LIMIT_EXCEEDED = 509, NOT_EXTENDED = 510, @@ -134,23 +134,23 @@ namespace Aws /** * Initializes an http response with the originalRequest and the response code. */ - HttpResponse(const std::shared_ptr<const HttpRequest>& originatingRequest) : + HttpResponse(const std::shared_ptr<const HttpRequest>& originatingRequest) : m_httpRequest(originatingRequest), m_responseCode(HttpResponseCode::REQUEST_NOT_MADE), - m_hasClientError(false) + m_hasClientError(false) {} virtual ~HttpResponse() = default; /** - * Gets the request that originated this response + * Gets the request that originated this response */ - virtual inline const HttpRequest& GetOriginatingRequest() const { return *m_httpRequest; } + virtual inline const HttpRequest& GetOriginatingRequest() const { return *m_httpRequest; } /** - * Sets the request that originated this response - */ - virtual inline void SetOriginatingRequest(const std::shared_ptr<const HttpRequest>& httpRequest) { m_httpRequest = httpRequest; } + * Sets the request that originated this response + */ + virtual inline void SetOriginatingRequest(const std::shared_ptr<const HttpRequest>& httpRequest) { m_httpRequest = httpRequest; } /** * Get the headers from this response @@ -194,23 +194,23 @@ namespace Aws */ virtual void SetContentType(const Aws::String& contentType) { AddHeader("content-type", contentType); } - inline bool HasClientError() const { return m_hasClientError; } - inline void SetClientErrorType(Aws::Client::CoreErrors errorType) {m_hasClientError = true; m_clientErrorType = errorType;} - inline Aws::Client::CoreErrors GetClientErrorType() { return m_clientErrorType; } - - inline const Aws::String &GetClientErrorMessage() const { return m_clientErrorMessage; } - inline void SetClientErrorMessage(const Aws::String &error) { m_clientErrorMessage = error; } - + inline bool HasClientError() const { return m_hasClientError; } + inline void SetClientErrorType(Aws::Client::CoreErrors errorType) {m_hasClientError = true; m_clientErrorType = errorType;} + inline Aws::Client::CoreErrors GetClientErrorType() { return m_clientErrorType; } + + inline const Aws::String &GetClientErrorMessage() const { return m_clientErrorMessage; } + inline void SetClientErrorMessage(const Aws::String &error) { m_clientErrorMessage = error; } + private: HttpResponse(const HttpResponse&); HttpResponse& operator = (const HttpResponse&); - std::shared_ptr<const HttpRequest> m_httpRequest; + std::shared_ptr<const HttpRequest> m_httpRequest; HttpResponseCode m_responseCode; - // Error generated by http client, SDK or users, indicating non service error during http request - bool m_hasClientError; - Aws::Client::CoreErrors m_clientErrorType; - Aws::String m_clientErrorMessage; + // Error generated by http client, SDK or users, indicating non service error during http request + bool m_hasClientError; + Aws::Client::CoreErrors m_clientErrorType; + Aws::String m_clientErrorMessage; }; } // namespace Http diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h index b0d39cf933..b8c993294a 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -35,7 +35,7 @@ namespace Aws */ enum class TransferLibType { - DEFAULT_CLIENT = 0, + DEFAULT_CLIENT = 0, CURL_CLIENT, WIN_INET_CLIENT, WIN_HTTP_CLIENT diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h index d4b323f758..a0ec88ad16 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h index 890ea9afb6..d72e96b863 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -60,7 +60,7 @@ namespace Aws inline Scheme GetScheme() const { return m_scheme; } /** - * Sets scheme, if the port is incompatible with this scheme, the port will automatically be set as well. + * Sets scheme, if the port is incompatible with this scheme, the port will automatically be set as well. */ void SetScheme(Scheme value); @@ -114,7 +114,7 @@ namespace Aws Aws::String GetFormParameters() const; /** - * Canonicalizes the query string. + * Canonicalizes the query string. */ void CanonicalizeQueryString(); @@ -141,7 +141,7 @@ namespace Aws /** * URLEncodes the path portions of path (doesn't encode the "/" portion) - * Keeps the first and the last "/". + * Keeps the first and the last "/". */ static Aws::String URLEncodePath(const Aws::String& path); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h index b764fb18b3..c2745753eb 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -28,8 +28,8 @@ public: * Initializes an empty stack of CURL handles. If you are only making synchronous calls via your http client * then a small size is best. For async support, a good value would be 6 * number of Processors. * */ - CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true, - unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1); + CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true, + unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1); ~CurlHandleContainer(); /** @@ -42,29 +42,29 @@ public: */ void ReleaseCurlHandle(CURL* handle); - /** - * When the handle has bad DNS entries, problematic live connections, we need to destory the handle from pool. - */ - void DestroyCurlHandle(CURL* handle); - + /** + * When the handle has bad DNS entries, problematic live connections, we need to destory the handle from pool. + */ + void DestroyCurlHandle(CURL* handle); + private: CurlHandleContainer(const CurlHandleContainer&) = delete; const CurlHandleContainer& operator = (const CurlHandleContainer&) = delete; CurlHandleContainer(const CurlHandleContainer&&) = delete; const CurlHandleContainer& operator = (const CurlHandleContainer&&) = delete; - CURL* CreateCurlHandleInPool(); + CURL* CreateCurlHandleInPool(); bool CheckAndGrowPool(); void SetDefaultOptionsOnHandle(CURL* handle); Aws::Utils::ExclusiveOwnershipResourceManager<CURL*> m_handleContainer; unsigned m_maxPoolSize; - unsigned long m_httpRequestTimeout; + unsigned long m_httpRequestTimeout; unsigned long m_connectTimeout; - bool m_enableTcpKeepAlive; - unsigned long m_tcpKeepAliveIntervalMs; - unsigned long m_lowSpeedTime; - unsigned long m_lowSpeedLimit; + bool m_enableTcpKeepAlive; + unsigned long m_tcpKeepAliveIntervalMs; + unsigned long m_lowSpeedTime; + unsigned long m_lowSpeedLimit; unsigned m_poolSize; std::mutex m_containerLock; }; 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 2c4bf48dcc..31f96befd5 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -31,22 +31,22 @@ public: //Creates client, initializes curl handle if it hasn't been created already. CurlHttpClient(const Aws::Client::ClientConfiguration& clientConfig); - + //Makes request and receives response synchronously - std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request, - Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr, - Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const override; + std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request, + Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr, + Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const override; static void InitGlobalState(); static void CleanupGlobalState(); -protected: - /** - * Override any configuration on CURL handle for each request before sending. - * The usage is to have a subclass of CurlHttpClient and have your own implementation of this function to configure whatever you want on CURL handle. - */ - virtual void OverrideOptionsOnConnectionHandle(CURL*) const {} - +protected: + /** + * Override any configuration on CURL handle for each request before sending. + * The usage is to have a subclass of CurlHttpClient and have your own implementation of this function to configure whatever you want on CURL handle. + */ + virtual void OverrideOptionsOnConnectionHandle(CURL*) const {} + private: mutable CurlHandleContainer m_curlHandleContainer; bool m_isUsingProxy; @@ -54,11 +54,11 @@ private: Aws::String m_proxyPassword; Aws::String m_proxyScheme; Aws::String m_proxyHost; - Aws::String m_proxySSLCertPath; - Aws::String m_proxySSLCertType; - Aws::String m_proxySSLKeyPath; - Aws::String m_proxySSLKeyType; - Aws::String m_proxyKeyPasswd; + Aws::String m_proxySSLCertPath; + Aws::String m_proxySSLCertType; + Aws::String m_proxySSLKeyPath; + Aws::String m_proxySSLKeyType; + Aws::String m_proxyKeyPasswd; unsigned m_proxyPort; bool m_verifySSL; Aws::String m_caPath; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h index 5bdaedb769..c9c0016ef5 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h index 46cfdddb1b..309206f1f3 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -61,7 +61,7 @@ namespace Aws void AddHeader(const Aws::String&, const Aws::String&); private: - StandardHttpResponse(const StandardHttpResponse&); + StandardHttpResponse(const StandardHttpResponse&); Aws::Map<Aws::String, Aws::String> headerMap; Utils::Stream::ResponseStream bodyStream; 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 65f3ac4aa5..c58a1b70bf 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -9,19 +9,19 @@ #include <aws/core/utils/memory/AWSMemory.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/client/ClientConfiguration.h> -#include <aws/core/client/AWSErrorMarshaller.h> -#include <aws/core/auth/AWSCredentials.h> -#include <aws/core/AmazonWebServiceResult.h> -#include <aws/core/utils/DateTime.h> +#include <aws/core/client/AWSErrorMarshaller.h> +#include <aws/core/auth/AWSCredentials.h> +#include <aws/core/AmazonWebServiceResult.h> +#include <aws/core/utils/DateTime.h> #include <memory> -#include <mutex> +#include <mutex> namespace Aws { namespace Http { class HttpClient; - class HttpRequest; - enum class HttpResponseCode; + class HttpRequest; + enum class HttpResponseCode; } // namespace Http namespace Internal @@ -57,38 +57,38 @@ namespace Aws */ virtual Aws::String GetResource(const char* endpoint, const char* resourcePath, const char* authToken) const; - /** - * Connects to an HTTP endpoint to read the specified resource and returns the text contents. - * The resource URI = endpoint + resourcePath (e.g:http://domain/path/to/res) - * @param endpoint The HTTP resource to connect to. - * @param resourcePath A path appended to the endpoint to form the final URI. - * @param authToken An optional authorization token that will be passed as the value of the HTTP - * header 'Authorization'. - * @return The response from the HTTP endpoint as a string, together with the http response code. - */ - virtual AmazonWebServiceResult<Aws::String> GetResourceWithAWSWebServiceResult(const char *endpoint, const char *resourcePath, const char *authToken) const; - - /** - * Above Function: Aws::String GetResource(const char* endpoint, const char* resourcePath, const char* authToken) const; - * is limited to HTTP GET method and caller can't add wanted HTTP headers as well. - * This overload gives caller the flexibility to manipulate the request, as well returns the HttpResponseCode of the last attempt. - */ - virtual AmazonWebServiceResult<Aws::String> GetResourceWithAWSWebServiceResult(const std::shared_ptr<Http::HttpRequest> &httpRequest) const; - - /** - * Set an error marshaller so as to marshall error type from http response body if any. - * So that it can work with retry strategy to decide if a request should retry or not. - */ - void SetErrorMarshaller(Aws::UniquePtr<Client::AWSErrorMarshaller> errorMarshaller) { m_errorMarshaller = std::move(errorMarshaller); } - const Client::AWSErrorMarshaller* GetErrorMarshaller() const { return m_errorMarshaller.get(); } - + /** + * Connects to an HTTP endpoint to read the specified resource and returns the text contents. + * The resource URI = endpoint + resourcePath (e.g:http://domain/path/to/res) + * @param endpoint The HTTP resource to connect to. + * @param resourcePath A path appended to the endpoint to form the final URI. + * @param authToken An optional authorization token that will be passed as the value of the HTTP + * header 'Authorization'. + * @return The response from the HTTP endpoint as a string, together with the http response code. + */ + virtual AmazonWebServiceResult<Aws::String> GetResourceWithAWSWebServiceResult(const char *endpoint, const char *resourcePath, const char *authToken) const; + + /** + * Above Function: Aws::String GetResource(const char* endpoint, const char* resourcePath, const char* authToken) const; + * is limited to HTTP GET method and caller can't add wanted HTTP headers as well. + * This overload gives caller the flexibility to manipulate the request, as well returns the HttpResponseCode of the last attempt. + */ + virtual AmazonWebServiceResult<Aws::String> GetResourceWithAWSWebServiceResult(const std::shared_ptr<Http::HttpRequest> &httpRequest) const; + + /** + * Set an error marshaller so as to marshall error type from http response body if any. + * So that it can work with retry strategy to decide if a request should retry or not. + */ + void SetErrorMarshaller(Aws::UniquePtr<Client::AWSErrorMarshaller> errorMarshaller) { m_errorMarshaller = std::move(errorMarshaller); } + const Client::AWSErrorMarshaller* GetErrorMarshaller() const { return m_errorMarshaller.get(); } + protected: Aws::String m_logtag; private: std::shared_ptr<Client::RetryStrategy> m_retryStrategy; std::shared_ptr<Http::HttpClient> m_httpClient; - Aws::UniquePtr<Client::AWSErrorMarshaller> m_errorMarshaller; + Aws::UniquePtr<Client::AWSErrorMarshaller> m_errorMarshaller; }; /** @@ -125,12 +125,12 @@ namespace Aws virtual Aws::String GetDefaultCredentials() const; /** - * Connects to the Amazon EC2 Instance Metadata Service to retrieve the - * credential information (if any) in a more secure way. - */ - virtual Aws::String GetDefaultCredentialsSecurely() const; - - /** + * Connects to the Amazon EC2 Instance Metadata Service to retrieve the + * credential information (if any) in a more secure way. + */ + virtual Aws::String GetDefaultCredentialsSecurely() const; + + /** * connects to the Amazon EC2 Instance metadata Service to retrieve the region * the current EC2 instance is running in. */ @@ -138,18 +138,18 @@ namespace Aws private: Aws::String m_endpoint; - mutable std::recursive_mutex m_tokenMutex; - mutable Aws::String m_token; - mutable bool m_tokenRequired; - mutable Aws::String m_region; + mutable std::recursive_mutex m_tokenMutex; + mutable Aws::String m_token; + mutable bool m_tokenRequired; + mutable Aws::String m_region; }; - void AWS_CORE_API InitEC2MetadataClient(); - void AWS_CORE_API CleanupEC2MetadataClient(); - std::shared_ptr<EC2MetadataClient> AWS_CORE_API GetEC2MetadataClient(); - + void AWS_CORE_API InitEC2MetadataClient(); + void AWS_CORE_API CleanupEC2MetadataClient(); + std::shared_ptr<EC2MetadataClient> AWS_CORE_API GetEC2MetadataClient(); + /** - * Derived class to support retrieving of ECS Credentials + * Derived class to support retrieving of ECS Credentials */ class AWS_CORE_API ECSCredentialsClient : public AWSHttpResourceClient { @@ -183,43 +183,43 @@ namespace Aws Aws::String m_endpoint; Aws::String m_token; }; - - /** - * To support retrieving credentials from STS. - * Note that STS accepts request with protocol of queryxml. Calling GetResource() will trigger - * a query request using AWSHttpResourceClient under the hood. - */ - class AWS_CORE_API STSCredentialsClient : public AWSHttpResourceClient - { - public: - /** - * Initializes the provider to retrieve credentials from STS when it expires. - */ - STSCredentialsClient(const Client::ClientConfiguration& clientConfiguration); - - STSCredentialsClient& operator =(STSCredentialsClient& rhs) = delete; - STSCredentialsClient(const STSCredentialsClient& rhs) = delete; - STSCredentialsClient& operator =(STSCredentialsClient&& rhs) = delete; - STSCredentialsClient(const STSCredentialsClient&& rhs) = delete; - - // If you want to make an AssumeRoleWithWebIdentity call to sts. use these classes to pass data to and get info from STSCredentialsClient client. - // If you want to make an AssumeRole call to sts, define the request/result members class/struct like this. - struct STSAssumeRoleWithWebIdentityRequest - { - Aws::String roleSessionName; - Aws::String roleArn; - Aws::String webIdentityToken; - }; - - struct STSAssumeRoleWithWebIdentityResult - { - Aws::Auth::AWSCredentials creds; - }; - - STSAssumeRoleWithWebIdentityResult GetAssumeRoleWithWebIdentityCredentials(const STSAssumeRoleWithWebIdentityRequest& request); - - private: - Aws::String m_endpoint; - }; + + /** + * To support retrieving credentials from STS. + * Note that STS accepts request with protocol of queryxml. Calling GetResource() will trigger + * a query request using AWSHttpResourceClient under the hood. + */ + class AWS_CORE_API STSCredentialsClient : public AWSHttpResourceClient + { + public: + /** + * Initializes the provider to retrieve credentials from STS when it expires. + */ + STSCredentialsClient(const Client::ClientConfiguration& clientConfiguration); + + STSCredentialsClient& operator =(STSCredentialsClient& rhs) = delete; + STSCredentialsClient(const STSCredentialsClient& rhs) = delete; + STSCredentialsClient& operator =(STSCredentialsClient&& rhs) = delete; + STSCredentialsClient(const STSCredentialsClient&& rhs) = delete; + + // If you want to make an AssumeRoleWithWebIdentity call to sts. use these classes to pass data to and get info from STSCredentialsClient client. + // If you want to make an AssumeRole call to sts, define the request/result members class/struct like this. + struct STSAssumeRoleWithWebIdentityRequest + { + Aws::String roleSessionName; + Aws::String roleArn; + Aws::String webIdentityToken; + }; + + struct STSAssumeRoleWithWebIdentityResult + { + Aws::Auth::AWSCredentials creds; + }; + + STSAssumeRoleWithWebIdentityResult GetAssumeRoleWithWebIdentityCredentials(const STSAssumeRoleWithWebIdentityRequest& 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/monitoring/CoreMetrics.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h index 0522b0b553..575a6003e2 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -17,7 +17,7 @@ namespace Aws struct AWS_CORE_API CoreMetricsCollection { /** - * Metrics collected from underlying http client during execution of a request + * Metrics collected from underlying http client during execution of a request */ HttpClientMetricsCollection httpClientMetrics; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h index 53f3620fca..148a3a23c5 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/Core_EXPORTS.h> @@ -22,20 +22,20 @@ namespace Aws const static int DEFAULT_MONITORING_VERSION; const static char DEFAULT_CSM_CONFIG_ENABLED[]; const static char DEFAULT_CSM_CONFIG_CLIENT_ID[]; - const static char DEFAULT_CSM_CONFIG_HOST[]; + const static char DEFAULT_CSM_CONFIG_HOST[]; const static char DEFAULT_CSM_CONFIG_PORT[]; const static char DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED[]; const static char DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID[]; - const static char DEFAULT_CSM_ENVIRONMENT_VAR_HOST[]; + const static char DEFAULT_CSM_ENVIRONMENT_VAR_HOST[]; const static char DEFAULT_CSM_ENVIRONMENT_VAR_PORT[]; /** * @brief Construct a default monitoring instance * @param clientId, used to identify the application - * @param host, either the host name or the host ip address (could be ipv4 or ipv6). Note that "localhost" will be treated as host name and address look up will be performed. + * @param host, either the host name or the host ip address (could be ipv4 or ipv6). Note that "localhost" will be treated as host name and address look up will be performed. * @param port, used to send collected metric to a local agent listen on this port. */ - DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port); + DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port); void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request) const override; @@ -46,18 +46,18 @@ namespace Aws void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override; - - void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, + + void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override; - void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, + void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override; static inline int GetVersion() { return DEFAULT_MONITORING_VERSION; } private: - void CollectAndSendAttemptData(const Aws::String& serviceName, const Aws::String& requestName, - const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome, + void CollectAndSendAttemptData(const Aws::String& serviceName, const Aws::String& requestName, + const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const; Aws::Net::SimpleUDP m_udp; @@ -70,4 +70,4 @@ namespace Aws Aws::UniquePtr<MonitoringInterface> CreateMonitoringInstance() const override; }; } // namespace Monitoring -} // namespace Aws +} // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h index 872e5b61fe..2c2efa3ed5 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -17,54 +17,54 @@ namespace Aws */ enum class HttpClientMetricsType { - /* + /* * Requires a successful DNS lookup, contains the (IPv4 or IPv6 as appropriate) numeric address of the connection endpoint to which the attempt was sent. */ DestinationIp = 0, - /** - * Requires the SDK to recognize that an existing connection was reused to make the request, + /** + * Requires the SDK to recognize that an existing connection was reused to make the request, * contains the time interval (in milliseconds) between the construction of the http request and when a connection was successfully acquired from the connection pool. */ AcquireConnectionLatency, /** - * Requires the SDK to recognize whether or not an existing connection was used to make the request, + * Requires the SDK to recognize whether or not an existing connection was used to make the request, * contains 1 if an existing connection was used to perform the http request; contains 0 if a new connection was opened to perform the http request. */ - ConnectionReused, + ConnectionReused, - /** - * Requires the SDK to recognize that a new connection was established to make the request, - * contains the time interval (in milliseconds) between the construction of the http request and when a connection was fully established. - * If the SDK is able to estimate this time despite not having a perfectly accurate callback for the specific event, then it should. - * For example, if the http client includes user-level data write functions that are guaranteed to be called shortly after connection establishment, + /** + * Requires the SDK to recognize that a new connection was established to make the request, + * contains the time interval (in milliseconds) between the construction of the http request and when a connection was fully established. + * If the SDK is able to estimate this time despite not having a perfectly accurate callback for the specific event, then it should. + * For example, if the http client includes user-level data write functions that are guaranteed to be called shortly after connection establishment, * then the first call could be used as a reasonable time marker for ConnectLatency */ ConnectLatency, - /** - * Requires the SDK to be able to mark the point in time where the request starts transmission, - * contains the time interval (in milliseconds) between when the request begins transmission to the service and when a terminal error has occurred or the response has been parsed, + /** + * Requires the SDK to be able to mark the point in time where the request starts transmission, + * contains the time interval (in milliseconds) between when the request begins transmission to the service and when a terminal error has occurred or the response has been parsed, * excluding streaming payloads. Like ConnectLatency, if the SDK has access to an event that is a "close enough" marker in time, it should include this entry. * The request here is a http level request, not a service level API request. */ - RequestLatency, + RequestLatency, /** - * Requires the SDK to have access to how long it took to perform DNS lookup, if it took place, + * Requires the SDK to have access to how long it took to perform DNS lookup, if it took place, * contains the time (in milliseconds) it took to perform DNS lookup, during the Api Call attempt. */ DnsLatency, /** - * Requires the SDK to have access to how long it took to establish the underlying Tcp/Ip connection used for the request, + * Requires the SDK to have access to how long it took to establish the underlying Tcp/Ip connection used for the request, * contains the time (in milliseconds) it took to fully establish the TCP/IP connection used to make the request attempt. */ TcpLatency, /** - * Requires the SDK to have access to how long it took to perform the SSL handshake for a secure request, + * Requires the SDK to have access to how long it took to perform the SSL handshake for a secure request, * contains the time (in milliseconds) it took to perform a SSL handshake over the established TCP/IP connection. */ SslLatency, @@ -77,8 +77,8 @@ namespace Aws typedef Aws::Map<Aws::String, int64_t> HttpClientMetricsCollection; - AWS_CORE_API HttpClientMetricsType GetHttpClientMetricTypeByName(const Aws::String& name); + AWS_CORE_API HttpClientMetricsType GetHttpClientMetricTypeByName(const Aws::String& name); - AWS_CORE_API Aws::String GetHttpClientMetricNameByType(HttpClientMetricsType type); + AWS_CORE_API Aws::String GetHttpClientMetricNameByType(HttpClientMetricsType type); } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h index eeb66f921e..2d03efa712 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h index aa8835535e..ebe50722c7 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -24,19 +24,19 @@ namespace Aws virtual ~MonitoringInterface() = default; /** - * @brief This function lets you do preparation work when a http attempt(request) starts. It returns a pointer to an implementation defined context which will be - * passed down with the other facilities that completes the request's lifetime. This context can be used to track the lifetime of the request and record metrics + * @brief This function lets you do preparation work when a http attempt(request) starts. It returns a pointer to an implementation defined context which will be + * passed down with the other facilities that completes the request's lifetime. This context can be used to track the lifetime of the request and record metrics * specific to this particular request. You are responsible for deleteing the context during your OnFinish call. * @param serviceName, the service client who initiates this http attempt. like "s3", "ec2", etc. * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3. * @param request, the actual Http Request. * @return implementation depends memory address of context. - */ - virtual void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, + */ + virtual void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request) const = 0; /** - * @brief Once a Http attempt finished and received "Succeeded" response, this function will be called. + * @brief Once a Http attempt finished and received "Succeeded" response, this function will be called. * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc. * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3. * @param request, the actual Http Request. @@ -45,7 +45,7 @@ namespace Aws * @param context parameter pointed to the same place returned by OnRequestStarted() function. * @return void. */ - virtual void OnRequestSucceeded(const Aws::String& serviceName, + virtual void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0; @@ -59,7 +59,7 @@ namespace Aws * @param context parameter pointed to the same place returned by OnRequestStarted() function. * @return void. */ - virtual void OnRequestFailed(const Aws::String& serviceName, + virtual void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0; @@ -71,7 +71,7 @@ namespace Aws * @param context parameter pointed to the same place returned by OnRequestStarted() function. * @return void. */ - virtual void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, + virtual void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0; /** @@ -82,8 +82,8 @@ namespace Aws * @param context parameter pointed to the same place returned by OnRequestStarted() function. * @return void. */ - virtual void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, + virtual void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0; }; } // namespace Monitoring -} // namespace Aws +} // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h index 07cd3c1784..aaa5bca5d1 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -37,28 +37,28 @@ namespace Aws /** * Wrapper function of OnRequestRetry defined by all monitoring instances */ - void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, + void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts); /** * Wrapper function of OnFinish defined by all monitoring instances */ - void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, + void OnFinish(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts); typedef std::function<Aws::UniquePtr<MonitoringFactory>()> MonitoringFactoryCreateFunction; /** - * Init monitoring using supplied factories, monitoring can support multiple instances. + * Init monitoring using supplied factories, monitoring can support multiple instances. * We will try to (based on config resolution result) create a default client side monitoring listener instance defined in AWS SDK Core module. * and create other instances from these factories. * This function will be called during Aws::InitAPI call, argument is acquired from Aws::SDKOptions->MonitoringOptions */ - AWS_CORE_API void InitMonitoring(const std::vector<MonitoringFactoryCreateFunction>& monitoringFactoryCreateFunctions); + AWS_CORE_API void InitMonitoring(const std::vector<MonitoringFactoryCreateFunction>& monitoringFactoryCreateFunctions); /** * Clean up monitoring related global variables */ - AWS_CORE_API void CleanupMonitoring(); + AWS_CORE_API void CleanupMonitoring(); } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h index 67ccb7ccd9..00aca57e0a 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h index 2ea7f8baeb..2e96b509fb 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h @@ -1,12 +1,12 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * 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/utils/memory/stl/AWSString.h> +#include <aws/core/utils/memory/stl/AWSString.h> #include <cstdint> struct sockaddr; @@ -26,8 +26,8 @@ namespace Aws * @brief Constructor of SimpleUDP * @param addressFamily, AF_INET for IPV4 or AF_INET6 for IPV6 * @param sendBufSize, if nonzero, try set socket's send buffer size to this value. - * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. - * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. + * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. + * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. * Implementation should create and set the underlying udp socket. */ SimpleUDP(int addressFamily, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true); @@ -36,24 +36,24 @@ namespace Aws * @brief An easy constructor of an IPV4 or IPV6 SimpleUDP * @param addressFamily, either AF_INET for IPV4 or AF_INET6 for IPV6 * @param sendBufSize, if nonzero, try set socket's send buffer size to this value. - * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. - * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. + * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. + * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. * Implementation should create and set the underlying udp socket. */ SimpleUDP(bool IPV4 = true, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true); - /** - * @brief An easy constructor of SimpleUDP based on host and port - * @param host, the host that packets will be sent to, could be ipv4 or ipv6 address, or a hostname - * Note that "localhost" is not necessarily bind to 127.0.0.1, it could bind to ipv6 address ::1, or other type of ip addresses. If you pass localhost here, we will go through getaddrinfo procedure on Linux and Windows. - * @param port, the port number that the host listens on. - * @param sendBufSize, if nonzero, try set socket's send buffer size to this value. - * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. - * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. - * Implementation should create and set the underlying udp socket. - */ - SimpleUDP(const char* host, unsigned short port, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true); - + /** + * @brief An easy constructor of SimpleUDP based on host and port + * @param host, the host that packets will be sent to, could be ipv4 or ipv6 address, or a hostname + * Note that "localhost" is not necessarily bind to 127.0.0.1, it could bind to ipv6 address ::1, or other type of ip addresses. If you pass localhost here, we will go through getaddrinfo procedure on Linux and Windows. + * @param port, the port number that the host listens on. + * @param sendBufSize, if nonzero, try set socket's send buffer size to this value. + * @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value. + * @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket. + * Implementation should create and set the underlying udp socket. + */ + SimpleUDP(const char* host, unsigned short port, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true); + ~SimpleUDP(); /** @@ -65,19 +65,19 @@ namespace Aws int Connect(const sockaddr* address, size_t addressLength); /** - * @brief An easy way to connect to host - * @param hostIP, a valid ipv4 or ipv6 address. The address type should match the m_addressFamily type settled during construction. - * Otherwise the connection will fail. - * @param port, the port that host listens on. + * @brief An easy way to connect to host + * @param hostIP, a valid ipv4 or ipv6 address. The address type should match the m_addressFamily type settled during construction. + * Otherwise the connection will fail. + * @param port, the port that host listens on. + */ + int ConnectToHost(const char* hostIP, unsigned short port) const; + + /** + * @brief An easy way to connect to 127.0.0.1 or ::1 based on m_addressFamily */ - int ConnectToHost(const char* hostIP, unsigned short port) const; + int ConnectToLocalHost(unsigned short port) const; /** - * @brief An easy way to connect to 127.0.0.1 or ::1 based on m_addressFamily - */ - int ConnectToLocalHost(unsigned short port) const; - - /** * @brief Bind underlying udp socket to an address. * @param address, the server's address info. * @param addressLength, length of address, structure of address can vary. @@ -91,7 +91,7 @@ namespace Aws int BindToLocalHost(unsigned short port) const; /** - * @brief Send data to server without specifying address, only usable if hostIP and port are available. + * @brief Send data to server without specifying address, only usable if hostIP and port are available. * @param data, the data you want to send. * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior * @return 0 on success, -1 on error, check errno for detailed error information. @@ -139,7 +139,7 @@ namespace Aws int ReceiveDataFrom(sockaddr* address, size_t* addressLength, uint8_t* buffer, size_t bufferLen) const; /** - * Gets the AddressFamily used for the underlying socket. E.g. AF_INET, AF_INET6 etc. + * Gets the AddressFamily used for the underlying socket. E.g. AF_INET, AF_INET6 etc. */ inline int GetAddressFamily() const { return m_addressFamily; } @@ -154,10 +154,10 @@ namespace Aws void SetUnderlyingSocket(int socket) { m_socket = socket; } int m_addressFamily; // if not connected, you can't perform SendData, if connected, SendDataTo will call SendData - mutable bool m_connected; + mutable bool m_connected; int m_socket; - unsigned short m_port; - Aws::String m_hostIP; + unsigned short m_port; + Aws::String m_hostIP; }; } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h index b74ab425f8..b012a49d50 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #ifdef __ANDROID__ diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h index 5acaab93db..f522bf3a22 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h index f80424d2b5..5eeacd2fbd 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/Core_EXPORTS.h> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h index aa865d4526..e9aa3ea1f0 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h index 4d9639edbf..e1cae5262e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #include <aws/core/Core_EXPORTS.h> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h index 8b16af34b8..d1533dd19f 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h index b497991ce5..ecf802db66 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ARN.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ARN.h index 37f7d65785..7df956022d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ARN.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ARN.h @@ -1,58 +1,58 @@ -/** - * 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/utils/memory/stl/AWSString.h> - -namespace Aws -{ - namespace Utils - { - /** - * ARN (Amazon Resource Name) is used to identify an unique resource on AWS. - * A full qualified ARN has two forms: - * 1. arn:partition:service:region:account-id:resource-type:resource-id:qualifier - * 2. arn:partition:service:region:account-id:resource-type/resource-id/qualifier - * Different services have different resource definition, here we treat anything - * after "[account-id]:" as resource. Service should have their own resource parser. - */ - class AWS_CORE_API ARN - { - public: - ARN(const Aws::String& arnString); - /** - * return if the ARN is valid after construction. - */ - explicit operator bool() const { return m_valid; } - - /** - * Get the originating arn string. - */ - const Aws::String& GetARNString() const { return m_arnString; } - - const Aws::String& GetPartition() const { return m_partition; } - - const Aws::String& GetService() const { return m_service; } - - const Aws::String& GetRegion() const { return m_region; } - - const Aws::String& GetAccountId() const { return m_accountId; } - - const Aws::String& GetResource() const { return m_resource; } - - private: - Aws::String m_arnString; - Aws::String m_partition; - Aws::String m_service; - Aws::String m_region; - Aws::String m_accountId; - Aws::String m_resource; - - bool m_valid; - }; - } -}
\ No newline at end of file +/** + * 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/utils/memory/stl/AWSString.h> + +namespace Aws +{ + namespace Utils + { + /** + * ARN (Amazon Resource Name) is used to identify an unique resource on AWS. + * A full qualified ARN has two forms: + * 1. arn:partition:service:region:account-id:resource-type:resource-id:qualifier + * 2. arn:partition:service:region:account-id:resource-type/resource-id/qualifier + * Different services have different resource definition, here we treat anything + * after "[account-id]:" as resource. Service should have their own resource parser. + */ + class AWS_CORE_API ARN + { + public: + ARN(const Aws::String& arnString); + /** + * return if the ARN is valid after construction. + */ + explicit operator bool() const { return m_valid; } + + /** + * Get the originating arn string. + */ + const Aws::String& GetARNString() const { return m_arnString; } + + const Aws::String& GetPartition() const { return m_partition; } + + const Aws::String& GetService() const { return m_service; } + + const Aws::String& GetRegion() const { return m_region; } + + const Aws::String& GetAccountId() const { return m_accountId; } + + const Aws::String& GetResource() const { return m_resource; } + + private: + Aws::String m_arnString; + Aws::String m_partition; + Aws::String m_service; + Aws::String m_region; + Aws::String m_accountId; + Aws::String m_resource; + + bool m_valid; + }; + } +}
\ No newline at end of file diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h index c96cdb1193..2b5bbc566d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h index 0fed07c0f5..7472a386c0 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h index 917fff348f..a410279011 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -17,7 +17,7 @@ namespace Aws { RFC822, //for http headers ISO_8601, //for query and xml payloads - ISO_8601_BASIC, // for retry headers and signers + ISO_8601_BASIC, // for retry headers and signers AutoDetect }; @@ -49,7 +49,7 @@ namespace Aws }; /** - * Wrapper for all the weird crap we need to do with timestamps. + * Wrapper for all the weird crap we need to do with timestamps. */ class AWS_CORE_API DateTime { @@ -60,12 +60,12 @@ namespace Aws DateTime(); /** - * Initializes time point to any other arbitrary timepoint + * Initializes time point to any other arbitrary timepoint */ DateTime(const std::chrono::system_clock::time_point& timepointToAssign); /** - * Initializes time point to millis Since epoch + * Initializes time point to millis Since epoch */ DateTime(int64_t millisSinceEpoch); @@ -93,7 +93,7 @@ namespace Aws DateTime operator+(const std::chrono::milliseconds& a) const; DateTime operator-(const std::chrono::milliseconds& a) const; - + /** * Assign from seconds.millis since epoch. */ @@ -225,17 +225,17 @@ namespace Aws static double ComputeCurrentTimestampInAmazonFormat(); /** - * Calculates the current time in GMT with millisecond precision using the format - * "Year-month-day hours:minutes:seconds.milliseconds" - */ - static Aws::String CalculateGmtTimeWithMsPrecision(); - - /** + * Calculates the current time in GMT with millisecond precision using the format + * "Year-month-day hours:minutes:seconds.milliseconds" + */ + static Aws::String CalculateGmtTimeWithMsPrecision(); + + /** * Compute the difference between two timestamps. */ static std::chrono::milliseconds Diff(const DateTime& a, const DateTime& b); - std::chrono::milliseconds operator - (const DateTime& other) const; + std::chrono::milliseconds operator - (const DateTime& other) const; private: std::chrono::system_clock::time_point m_time; bool m_valid; @@ -243,7 +243,7 @@ namespace Aws void ConvertTimestampStringToTimePoint(const char* timestamp, DateFormat format); tm GetTimeStruct(bool localTime) const; tm ConvertTimestampToLocalTimeStruct() const; - tm ConvertTimestampToGmtStruct() const; + tm ConvertTimestampToGmtStruct() const; }; } // namespace Utils diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h index 9449cf5b26..0302e2bd36 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h index be6d4a3b2b..d62ff4c094 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/memory/stl/AWSStreamFwd.h> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h index 80679fcf18..f42475c8e4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once 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 27f5d6d3a9..48c04daf59 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h index 51b9aea8b2..70e9e4be26 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h @@ -1,13 +1,13 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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 <cassert> +#include <cassert> #include <utility> namespace Aws @@ -28,19 +28,19 @@ namespace Aws Outcome() : result(), error(), success(false) { - } + } Outcome(const R& r) : result(r), error(), success(true) { - } + } Outcome(const E& e) : result(), error(e), success(false) { - } + } Outcome(R&& r) : result(std::forward<R>(r)), error(), success(true) { - } + } Outcome(E&& e) : result(), error(std::forward<E>(e)), success(false) { - } + } Outcome(const Outcome& o) : result(o.result), error(o.error), @@ -48,52 +48,52 @@ namespace Aws { } - template<typename RT, typename ET> - friend class Outcome; - -#if defined (__cplusplus) && __cplusplus > 201103L - template< bool B, class T = void > - using enable_if_t = std::enable_if_t<B, T>; -#else - template< bool B, class T = void > - using enable_if_t = typename std::enable_if<B,T>::type; -#endif - - // Move both result and error from other type of outcome - template<typename RT, typename ET, enable_if_t<std::is_convertible<RT, R>::value && - std::is_convertible<ET, E>::value, int> = 0> - Outcome(Outcome<RT, ET>&& o) : - result(std::move(o.result)), - error(std::move(o.error)), - success(o.success) - { - } - - // Move result from other type of outcome - template<typename RT, typename ET, enable_if_t<std::is_convertible<RT, R>::value && - !std::is_convertible<ET, E>::value, int> = 0> - Outcome(Outcome<RT, ET>&& o) : - result(std::move(o.result)), - success(o.success) - { - assert(o.success); - } - - // Move error from other type of outcome - template<typename RT, typename ET, enable_if_t<!std::is_convertible<RT, R>::value && - std::is_convertible<ET, E>::value, int> = 0> - Outcome(Outcome<RT, ET>&& o) : - error(std::move(o.error)), - success(o.success) - { - assert(!o.success); - } - - template<typename ET, enable_if_t<std::is_convertible<ET, E>::value, int> = 0> - Outcome(ET&& e) : error(std::forward<ET>(e)), success(false) - { - } - + template<typename RT, typename ET> + friend class Outcome; + +#if defined (__cplusplus) && __cplusplus > 201103L + template< bool B, class T = void > + using enable_if_t = std::enable_if_t<B, T>; +#else + template< bool B, class T = void > + using enable_if_t = typename std::enable_if<B,T>::type; +#endif + + // Move both result and error from other type of outcome + template<typename RT, typename ET, enable_if_t<std::is_convertible<RT, R>::value && + std::is_convertible<ET, E>::value, int> = 0> + Outcome(Outcome<RT, ET>&& o) : + result(std::move(o.result)), + error(std::move(o.error)), + success(o.success) + { + } + + // Move result from other type of outcome + template<typename RT, typename ET, enable_if_t<std::is_convertible<RT, R>::value && + !std::is_convertible<ET, E>::value, int> = 0> + Outcome(Outcome<RT, ET>&& o) : + result(std::move(o.result)), + success(o.success) + { + assert(o.success); + } + + // Move error from other type of outcome + template<typename RT, typename ET, enable_if_t<!std::is_convertible<RT, R>::value && + std::is_convertible<ET, E>::value, int> = 0> + Outcome(Outcome<RT, ET>&& o) : + error(std::move(o.error)), + success(o.success) + { + assert(!o.success); + } + + template<typename ET, enable_if_t<std::is_convertible<ET, E>::value, int> = 0> + Outcome(ET&& e) : error(std::forward<ET>(e)), success(false) + { + } + Outcome& operator=(const Outcome& o) { if (this != &o) @@ -149,12 +149,12 @@ namespace Aws return error; } - template<typename T> - inline T GetError() - { - return error.template GetModeledError<T>(); - } - + template<typename T> + inline T GetError() + { + return error.template GetModeledError<T>(); + } + inline bool IsSuccess() const { return this->success; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h index 83b94c370b..517f65d0fa 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/utils/memory/stl/AWSVector.h> @@ -18,8 +18,8 @@ namespace Aws * Generic resource manager with Acquire/Release semantics. Acquire will block waiting on a an available resource. Release will * cause one blocked acquisition to unblock. * - * You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to - * clean up the resource if needed. + * You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to + * clean up the resource if needed. * After calling ShutdownAndWait(), you must not call Acquire any more. */ template< typename RESOURCE_TYPE> @@ -27,7 +27,7 @@ namespace Aws { public: ExclusiveOwnershipResourceManager() : m_shutdown(false) {} - + /** * Returns a resource with exclusive ownership. You must call Release on the resource when you are finished or other * threads will block waiting to acquire it. @@ -39,7 +39,7 @@ namespace Aws std::unique_lock<std::mutex> locker(m_queueLock); while(!m_shutdown.load() && m_resources.size() == 0) { - m_semaphore.wait(locker, [&](){ return m_shutdown.load() || m_resources.size() > 0; }); + m_semaphore.wait(locker, [&](){ return m_shutdown.load() || m_resources.size() > 0; }); } assert(!m_shutdown.load()); @@ -86,12 +86,12 @@ namespace Aws } /** - * Waits for all acquired resources to be released, then empties the queue. + * Waits for all acquired resources to be released, then empties the queue. * You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to * clean up the resource if needed. * After calling ShutdownAndWait(), you must not call Acquire any more. * - * @params resourceCount the number of resources you've added to the resource manager. + * @params resourceCount the number of resources you've added to the resource manager. * @return the previously managed resources that are now available for cleanup. */ Aws::Vector<RESOURCE_TYPE> ShutdownAndWait(size_t resourceCount) @@ -100,7 +100,7 @@ namespace Aws std::unique_lock<std::mutex> locker(m_queueLock); m_shutdown = true; - //wait for all acquired resources to be released. + //wait for all acquired resources to be released. while (m_resources.size() < resourceCount) { m_semaphore.wait(locker, [&]() { return m_resources.size() == resourceCount; }); @@ -108,7 +108,7 @@ namespace Aws resources = m_resources; m_resources.clear(); - + return resources; } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h index e3854c7b94..312342b86a 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -67,18 +67,18 @@ namespace Aws */ static Aws::String URLDecode(const char* safe); - enum class SplitOptions - { - /** - * By default, removes all the empty entries in the vector returned by Split() - */ - NOT_SET, - /** - * Includes empty entries in the vector returned by Split() - */ - INCLUDE_EMPTY_ENTRIES - }; - + enum class SplitOptions + { + /** + * By default, removes all the empty entries in the vector returned by Split() + */ + NOT_SET, + /** + * Includes empty entries in the vector returned by Split() + */ + INCLUDE_EMPTY_ENTRIES + }; + /** * @brief Splits a string on a delimiter (empty items are excluded). * @param toSplit, the original string to split @@ -87,14 +87,14 @@ namespace Aws static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn); /** - * @brief Splits a string on a delimiter. - * @param toSplit, the original string to split - * @param splitOn, the delemiter you want to use. - * @param option, if INCLUDE_EMPTY_ENTRIES, includes empty entries in the result, otherwise removes empty entries. - */ - static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, SplitOptions option); - - /** + * @brief Splits a string on a delimiter. + * @param toSplit, the original string to split + * @param splitOn, the delemiter you want to use. + * @param option, if INCLUDE_EMPTY_ENTRIES, includes empty entries in the result, otherwise removes empty entries. + */ + static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, SplitOptions option); + + /** * @brief Splits a string on a delimiter (empty items are excluded). * @param toSplit, the original string to split * @param splitOn, the delemiter you want to use. @@ -102,14 +102,14 @@ namespace Aws */ static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts); - /** - * @brief Splits a string on a delimiter. - * @param toSplit, the original string to split - * @param splitOn, the delemiter you want to use. - * @param numOfTargetParts, how many target parts you want to get, if it is 0, as many as possible. - * @param option, if INCLUDE_EMPTY_ENTRIES, includes empty entries in the result, otherwise removes empty entries. - */ - static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts, SplitOptions option); + /** + * @brief Splits a string on a delimiter. + * @param toSplit, the original string to split + * @param splitOn, the delemiter you want to use. + * @param numOfTargetParts, how many target parts you want to get, if it is 0, as many as possible. + * @param option, if INCLUDE_EMPTY_ENTRIES, includes empty entries in the result, otherwise removes empty entries. + */ + static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts, SplitOptions option); /** * Splits a string on new line characters. @@ -146,7 +146,7 @@ namespace Aws static long ConvertToInt32(const char* source); - /** + /** * convert to bool */ static bool ConvertToBool(const char* source); @@ -172,7 +172,7 @@ namespace Aws /** * not all platforms (Android) have std::to_string - */ + */ template< typename T > static Aws::String to_string(T value) { @@ -188,32 +188,32 @@ namespace Aws { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); } - - /** - * Convert an unsigned integer to its hex string in upper case. - */ - template<typename T, class = typename std::enable_if<std::is_unsigned<T>::value>::type> - static Aws::String ToHexString(T value) - { - if (value == 0) - { - return "0"; - } - - Aws::String s; - s.reserve(sizeof(value) * 2); - T r = value; - while (r > 0) - { - s += "0123456789ABCDEF"[r & 0xf]; - r >>= 4; - } - - std::reverse(s.begin(), s.end()); - return s; - } + + /** + * Convert an unsigned integer to its hex string in upper case. + */ + template<typename T, class = typename std::enable_if<std::is_unsigned<T>::value>::type> + static Aws::String ToHexString(T value) + { + if (value == 0) + { + return "0"; + } + + Aws::String s; + s.reserve(sizeof(value) * 2); + T r = value; + while (r > 0) + { + s += "0123456789ABCDEF"[r & 0xf]; + r >>= 4; + } + + std::reverse(s.begin(), s.end()); + return s; + } }; } // namespace Utils -} // namespace Aws
\ No newline at end of file +} // namespace Aws
\ No newline at end of file diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h index cdcd38eb87..e6320d14ef 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h index 8f3dc220d0..d1bb74467d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h index 935436e038..454d20c262 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h index c7710a041e..fb31628b0e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -55,7 +55,7 @@ namespace Aws SymmetricCipher(CryptoBuffer&& key, CryptoBuffer&& initializationVector, CryptoBuffer&& tag = CryptoBuffer(0)) : m_key(std::move(key)), m_initializationVector(std::move(initializationVector)), - m_tag(std::move(tag)), + m_tag(std::move(tag)), m_failure(false) { } @@ -100,7 +100,7 @@ namespace Aws virtual operator bool() const { return Good(); } /** - * Encrypt a buffer of data. Part of the contract for this interface is that intention that + * Encrypt a buffer of data. Part of the contract for this interface is that intention that * a user call this function multiple times for a large stream. As such, multiple calls to this function * on the same instance should produce valid sequential output for an encrypted stream. */ @@ -149,10 +149,10 @@ namespace Aws /** * Generates a non-deterministic random symmetric key. Default (and minimum bar for security) is 256 bits. */ - static CryptoBuffer GenerateKey(size_t keyLengthBytes = SYMMETRIC_KEY_LENGTH); + static CryptoBuffer GenerateKey(size_t keyLengthBytes = SYMMETRIC_KEY_LENGTH); protected: - + SymmetricCipher() : m_failure(false) {} CryptoBuffer m_key; @@ -176,18 +176,18 @@ namespace Aws /** * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details. */ - virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer*) const - { - return CreateImplementation(key); - } + virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer*) const + { + return CreateImplementation(key); + } + /** + * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details. + */ + virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)) const = 0; /** * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details. */ - virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)) const = 0; - /** - * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details. - */ - virtual std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)) const = 0; + virtual std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)) const = 0; /** * Only called once per factory, your chance to make static library calls for setup. @@ -203,4 +203,4 @@ namespace Aws }; } } -} +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h index d4458804fa..ea99798853 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/Aws.h> @@ -31,7 +31,7 @@ namespace Aws ContentCryptoMaterial(ContentCryptoScheme contentCryptoScheme); /* - Initialize with content encryption key (cek) and content crypto scheme. + Initialize with content encryption key (cek) and content crypto scheme. */ ContentCryptoMaterial(const Aws::Utils::CryptoBuffer& cek, ContentCryptoScheme contentCryptoScheme); @@ -163,77 +163,77 @@ namespace Aws m_contentCryptoScheme = contentCryptoScheme; } - /** - * Sets the underlying AAD for GCM if needed. - */ - inline void SetGCMAAD(const Aws::Utils::CryptoBuffer& aad) - { - m_gcmAAD = aad; - } - /** - * Gets the underlying aad for GCM if needed. - */ - inline const Aws::Utils::CryptoBuffer& GetGCMAAD() const - { - return m_gcmAAD; - } - - /** - * Sets the underlying tag for decrypting CEK if it's GCM encrypted. - */ - inline void SetCEKGCMTag(const Aws::Utils::CryptoBuffer& tag) - { - m_cekGCMTag = tag; - } - /** - * Gets the underlying aad for GCM if needed. - */ - inline const Aws::Utils::CryptoBuffer& GetCEKGCMTag() const - { - return m_cekGCMTag; - } - - /** - * Sets the underlying initialization vector for CEK if it's GCM encrypted. - */ - inline void SetCekIV(const Aws::Utils::CryptoBuffer& iv) - { - m_cekIV = iv; - } - /** - * Gets the underlying CEK initialization vector. - */ - inline const Aws::Utils::CryptoBuffer& GetCekIV() const - { - return m_cekIV; - } - - /** - * Sets the underlying final CEK - */ - inline void SetFinalCEK(const Aws::Utils::CryptoBuffer& finalCEK) - { - m_finalCEK = finalCEK; - } - /** - * Gets the underlying final CEK. - */ - inline const Aws::Utils::CryptoBuffer& GetFinalCEK() const - { - return m_finalCEK; - } - + /** + * Sets the underlying AAD for GCM if needed. + */ + inline void SetGCMAAD(const Aws::Utils::CryptoBuffer& aad) + { + m_gcmAAD = aad; + } + /** + * Gets the underlying aad for GCM if needed. + */ + inline const Aws::Utils::CryptoBuffer& GetGCMAAD() const + { + return m_gcmAAD; + } + + /** + * Sets the underlying tag for decrypting CEK if it's GCM encrypted. + */ + inline void SetCEKGCMTag(const Aws::Utils::CryptoBuffer& tag) + { + m_cekGCMTag = tag; + } + /** + * Gets the underlying aad for GCM if needed. + */ + inline const Aws::Utils::CryptoBuffer& GetCEKGCMTag() const + { + return m_cekGCMTag; + } + + /** + * Sets the underlying initialization vector for CEK if it's GCM encrypted. + */ + inline void SetCekIV(const Aws::Utils::CryptoBuffer& iv) + { + m_cekIV = iv; + } + /** + * Gets the underlying CEK initialization vector. + */ + inline const Aws::Utils::CryptoBuffer& GetCekIV() const + { + return m_cekIV; + } + + /** + * Sets the underlying final CEK + */ + inline void SetFinalCEK(const Aws::Utils::CryptoBuffer& finalCEK) + { + m_finalCEK = finalCEK; + } + /** + * Gets the underlying final CEK. + */ + inline const Aws::Utils::CryptoBuffer& GetFinalCEK() const + { + return m_finalCEK; + } + private: Aws::Utils::CryptoBuffer m_contentEncryptionKey; Aws::Utils::CryptoBuffer m_encryptedContentEncryptionKey; - /* if using AES_GCM key wrap algorithm, then final CEK is iv + encrypted_key + tag - * otherwise it's the same as m_encryptedContentEncryptionKey - */ - Aws::Utils::CryptoBuffer m_finalCEK; + /* if using AES_GCM key wrap algorithm, then final CEK is iv + encrypted_key + tag + * otherwise it's the same as m_encryptedContentEncryptionKey + */ + Aws::Utils::CryptoBuffer m_finalCEK; Aws::Utils::CryptoBuffer m_iv; - Aws::Utils::CryptoBuffer m_cekIV; - Aws::Utils::CryptoBuffer m_gcmAAD; - Aws::Utils::CryptoBuffer m_cekGCMTag; + Aws::Utils::CryptoBuffer m_cekIV; + Aws::Utils::CryptoBuffer m_gcmAAD; + Aws::Utils::CryptoBuffer m_cekGCMTag; size_t m_cryptoTagLength; Aws::Map<Aws::String, Aws::String> m_materialsDescription; KeyWrapAlgorithm m_keyWrapAlgorithm; @@ -241,4 +241,4 @@ namespace Aws }; } } -} +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h index 2a6ca767d0..605ad4e375 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/memory/stl/AWSString.h> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h index cf4bf249f4..1270c6b427 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/utils/crypto/Cipher.h> @@ -57,7 +57,7 @@ namespace Aws /** * stream to src from * cipher to encrypt or decrypt the src stream with - * mode to use cipher in. Encryption or Decryption + * mode to use cipher in. Encryption or Decryption * buffersize, the size of the src buffers to read at a time. Defaults to 1kb */ SymmetricCryptoBufSrc(Aws::IStream& stream, SymmetricCipher& cipher, CipherMode cipherMode, size_t bufferSize = DEFAULT_BUF_SIZE); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h index 19802bc687..048d44392e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/utils/crypto/CryptoBuf.h> @@ -20,7 +20,7 @@ namespace Aws * A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory. * Or you could send a plain text file through an iostream and have it encrypted when the stream is read. * - * This stream is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point. + * This stream is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point. * So seeking should be avoided if at all possible. * * Or it can be used in the opposite direction where the stream is a sink and all input to the stream will be encrypted or decrypted and then sent to the diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h index 1a274edde6..0fbc77c6b4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/Core_EXPORTS.h> @@ -20,8 +20,8 @@ namespace Aws enum class CryptoErrors { ENCRYPT_CONTENT_ENCRYPTION_KEY_FAILED, - DECRYPT_CONTENT_ENCRYPTION_KEY_FAILED, - GENERATE_CONTENT_ENCRYPTION_KEY_FAILED + DECRYPT_CONTENT_ENCRYPTION_KEY_FAILED, + GENERATE_CONTENT_ENCRYPTION_KEY_FAILED }; typedef Outcome<Aws::NoResult, Aws::Client::AWSError<CryptoErrors>> CryptoOutcome; 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 2bbb199c95..b4c17b2a96 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -80,25 +80,25 @@ namespace Aws AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(CryptoBuffer&& key, CryptoBuffer&& iv); /** - * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV. + * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV. */ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key); /** - * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV and aad. - */ - AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer* aad); - /** - * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag. If you are using this + * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV and aad. + */ + AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer* aad); + /** + * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag. If you are using this * cipher to decrypt an encrypted payload, you must set the tag here. */ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, - const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)); + const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)); /** - * Create AES in GCM mode off of a 256 bit key, a 16 byte secure random IV, and an optional 16 byte Tag, as well an optional add. If you are using this + * Create AES in GCM mode off of a 256 bit key, a 16 byte secure random IV, and an optional 16 byte Tag, as well an optional add. If you are using this * cipher to decrypt an encrypted payload, you must set the tag here. */ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, - CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)); + CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)); /** * Create AES in Key Wrap mode off of a 256 bit key. */ diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h index 2f47f33ddc..450997c736 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ /* * Interface for Sha256 encryptor and hmac diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h index bc06dea8b9..8ebbe009fc 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h index 965c72c3cf..46b46d8095 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h index f3378ec9a2..0715f64740 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * 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/utils/memory/stl/AWSString.h> @@ -14,10 +14,10 @@ namespace Aws { enum class KeyWrapAlgorithm { - KMS, // Deprecated - KMS_CONTEXT, - AES_KEY_WRAP, // Deprecated - AES_GCM, + KMS, // Deprecated + KMS_CONTEXT, + AES_KEY_WRAP, // Deprecated + AES_GCM, NONE }; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h index 3823fda240..59304a4a88 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ /* * Interface for Sha256 encryptor and hmac @@ -40,7 +40,7 @@ namespace Aws { public: /** - * Initializes platform crypto libs for md5 + * Initializes platform crypto libs for md5 */ MD5(); virtual ~MD5(); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h index feb4f1dafe..7f48dc008d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <type_traits> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h index adca76bcb7..441752b0a6 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ /* * Interface for Sha256 encryptor and hmac diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h index f5f36aa4ef..d035b99da5 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ /* * Interface for Sha256 encryptor and hmac 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 9f044a95ee..e3f37edda9 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 @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once #include <aws/core/utils/crypto/Hash.h> @@ -37,7 +37,7 @@ namespace Aws /** * OpenSSL implementation for SecureRandomBytes. - * Incidentally, this implementation is thread safe, though it is not + * Incidentally, this implementation is thread safe, though it is not * on other platforms. You should treat an instance of SecureRandomBytes * as needed to be memory fenced if you will be using accross multiple threads */ @@ -151,7 +151,7 @@ namespace Aws /** * Decrypt a buffer of data. Part of the contract for this interface is that intention that - * a user call this function multiple times for a large stream. As such, multiple calls to this function + * a user call this function multiple times for a large stream. As such, multiple calls to this function * on the same instance should produce valid sequential output from an encrypted stream. */ CryptoBuffer DecryptBuffer(const CryptoBuffer& encryptedData) override; @@ -166,16 +166,16 @@ namespace Aws protected: virtual size_t GetBlockSizeBytes() const = 0; virtual size_t GetKeyLengthBits() const = 0; - bool CheckKeyAndIVLength(size_t expectedKeyLength, size_t expectedIVLength); + bool CheckKeyAndIVLength(size_t expectedKeyLength, size_t expectedIVLength); EVP_CIPHER_CTX* m_encryptor_ctx; EVP_CIPHER_CTX* m_decryptor_ctx; private: void Init(); void Cleanup(); - - /* openssl has bug finalize decryption of an empty string */ - bool m_emptyPlaintext; + + /* openssl has bug finalize decryption of an empty string */ + bool m_emptyPlaintext; }; /** @@ -205,8 +205,8 @@ namespace Aws AES_CBC_Cipher_OpenSSL(AES_CBC_Cipher_OpenSSL&& toMove) = default; - void Reset() override; - + void Reset() override; + protected: size_t GetBlockSizeBytes() const override; @@ -247,8 +247,8 @@ namespace Aws AES_CTR_Cipher_OpenSSL(AES_CTR_Cipher_OpenSSL&& toMove) = default; - void Reset() override; - + void Reset() override; + protected: size_t GetBlockSizeBytes() const override; @@ -268,30 +268,30 @@ namespace Aws { public: /** - * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV. + * Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV. */ AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key); /** - * Create AES in GCM mode off of a 256 bit key and AAD. Auto Generates a 12 byte IV in the format - */ - AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer* aad); - - /** - * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). - * Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. - * If you are using this cipher to decrypt an encrypted payload, you must set the tag here. + * Create AES in GCM mode off of a 256 bit key and AAD. Auto Generates a 12 byte IV in the format + */ + AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer* aad); + + /** + * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). + * Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. + * If you are using this cipher to decrypt an encrypted payload, you must set the tag here. */ AES_GCM_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector, - CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)); + CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)); /** - * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). - * Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. - * If you are using this cipher to decrypt an encrypted payload, you must set the tag here. + * Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD). + * Note that tag could be acquired from encrypt mode and should only be set for decrypt mode. + * If you are using this cipher to decrypt an encrypted payload, you must set the tag here. */ AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector, - const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)); + const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)); AES_GCM_Cipher_OpenSSL(const AES_GCM_Cipher_OpenSSL& other) = delete; @@ -306,8 +306,8 @@ namespace Aws */ CryptoBuffer FinalizeEncryption() override; - void Reset() override; - + void Reset() override; + protected: size_t GetBlockSizeBytes() const override; @@ -318,7 +318,7 @@ namespace Aws private: void InitCipher(); - CryptoBuffer m_aad; + CryptoBuffer m_aad; static size_t BlockSizeBytes; static size_t IVLengthBytes; static size_t KeyLengthBits; @@ -350,8 +350,8 @@ namespace Aws CryptoBuffer DecryptBuffer(const CryptoBuffer&) override; CryptoBuffer FinalizeDecryption() override; - void Reset() override; - + void Reset() override; + protected: inline size_t GetBlockSizeBytes() const override { return BlockSizeBytes; } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventDecoderStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventDecoderStream.h index b60554ff26..81a8f92eb9 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventDecoderStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventDecoderStream.h @@ -1,43 +1,43 @@ -/** - * 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/utils/event/EventStreamBuf.h> -#include <aws/core/utils/memory/stl/AWSStreamFwd.h> - -namespace Aws -{ - namespace Utils - { - namespace Event - { - extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; - - /** - * A buffered I/O stream that binary-decodes the bits written to it according to the AWS event-stream spec. - * The decoding process will result in invoking callbacks on the handler assigned to the decoder parameter. - */ - class AWS_CORE_API EventDecoderStream : public Aws::IOStream - { - public: - /** - * Creates a stream for decoding events sent by the service. - * @param decoder decodes the stream from server side, so as to invoke related callback functions. - * @param eventStreamBufLength The length of the underlying buffer. - */ - EventDecoderStream(EventStreamDecoder& decoder, size_t bufferSize = DEFAULT_BUF_SIZE); - - private: - EventDecoderStream(const EventDecoderStream&) = delete; - EventDecoderStream(EventDecoderStream&&) = delete; - EventDecoderStream& operator=(const EventDecoderStream&) = delete; - EventDecoderStream& operator=(EventDecoderStream&&) = delete; - - EventStreamBuf m_eventStreamBuf; - }; - } - } -} +/** + * 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/utils/event/EventStreamBuf.h> +#include <aws/core/utils/memory/stl/AWSStreamFwd.h> + +namespace Aws +{ + namespace Utils + { + namespace Event + { + extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; + + /** + * A buffered I/O stream that binary-decodes the bits written to it according to the AWS event-stream spec. + * The decoding process will result in invoking callbacks on the handler assigned to the decoder parameter. + */ + class AWS_CORE_API EventDecoderStream : public Aws::IOStream + { + public: + /** + * Creates a stream for decoding events sent by the service. + * @param decoder decodes the stream from server side, so as to invoke related callback functions. + * @param eventStreamBufLength The length of the underlying buffer. + */ + EventDecoderStream(EventStreamDecoder& decoder, size_t bufferSize = DEFAULT_BUF_SIZE); + + private: + EventDecoderStream(const EventDecoderStream&) = delete; + EventDecoderStream(EventDecoderStream&&) = delete; + EventDecoderStream& operator=(const EventDecoderStream&) = delete; + EventDecoderStream& operator=(EventDecoderStream&&) = delete; + + EventStreamBuf m_eventStreamBuf; + }; + } + } +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventEncoderStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventEncoderStream.h index 0879a907c2..19cf2a5874 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventEncoderStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventEncoderStream.h @@ -1,69 +1,69 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include <aws/core/Core_EXPORTS.h> -#include <aws/core/utils/stream/ConcurrentStreamBuf.h> -#include <aws/core/utils/event/EventMessage.h> -#include <aws/core/utils/memory/stl/AWSStreamFwd.h> -#include <aws/core/utils/event/EventStreamEncoder.h> - -namespace Aws -{ - namespace Client - { - class AWSAuthSigner; - } - - namespace Utils - { - namespace Event - { - extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; - - /** - * A buffered I/O stream that binary-encodes the bits written to it according to the AWS event-stream spec. - */ - class AWS_CORE_API EventEncoderStream : public Aws::IOStream - { - public: - - /** - * Creates a stream for encoding events sent by the client. - * @param bufferSize The length of the underlying buffer. - */ - explicit EventEncoderStream(size_t bufferSize = DEFAULT_BUF_SIZE); - - /** - * Sets the signature seed used by event-stream events. - * Every event uses its previous event's signature to calculate its own signature. - * Setting this value affects the signature calculation of the first event. - */ - void SetSignatureSeed(const Aws::String& seed) { m_encoder.SetSignatureSeed(seed); } - - /** - * Writes an event-stream message to the underlying buffer. - */ - EventEncoderStream& WriteEvent(const Aws::Utils::Event::Message& msg); - - /** - * Sets the signer implementation used for every event. - */ - void SetSigner(Aws::Client::AWSAuthSigner* signer) { m_encoder.SetSigner(signer); } - - /** - * Allows a stream writer to communicate the end of the stream to a stream reader. - * - * Any writes to the stream after this call are not guaranteed to be read by another concurrent - * read thread. - */ - void Close() { m_streambuf.SetEof(); setstate(eofbit); } - - private: - Stream::ConcurrentStreamBuf m_streambuf; - EventStreamEncoder m_encoder; - }; - } - } -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include <aws/core/Core_EXPORTS.h> +#include <aws/core/utils/stream/ConcurrentStreamBuf.h> +#include <aws/core/utils/event/EventMessage.h> +#include <aws/core/utils/memory/stl/AWSStreamFwd.h> +#include <aws/core/utils/event/EventStreamEncoder.h> + +namespace Aws +{ + namespace Client + { + class AWSAuthSigner; + } + + namespace Utils + { + namespace Event + { + extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; + + /** + * A buffered I/O stream that binary-encodes the bits written to it according to the AWS event-stream spec. + */ + class AWS_CORE_API EventEncoderStream : public Aws::IOStream + { + public: + + /** + * Creates a stream for encoding events sent by the client. + * @param bufferSize The length of the underlying buffer. + */ + explicit EventEncoderStream(size_t bufferSize = DEFAULT_BUF_SIZE); + + /** + * Sets the signature seed used by event-stream events. + * Every event uses its previous event's signature to calculate its own signature. + * Setting this value affects the signature calculation of the first event. + */ + void SetSignatureSeed(const Aws::String& seed) { m_encoder.SetSignatureSeed(seed); } + + /** + * Writes an event-stream message to the underlying buffer. + */ + EventEncoderStream& WriteEvent(const Aws::Utils::Event::Message& msg); + + /** + * Sets the signer implementation used for every event. + */ + void SetSigner(Aws::Client::AWSAuthSigner* signer) { m_encoder.SetSigner(signer); } + + /** + * Allows a stream writer to communicate the end of the stream to a stream reader. + * + * Any writes to the stream after this call are not guaranteed to be read by another concurrent + * read thread. + */ + void Close() { m_streambuf.SetEof(); setstate(eofbit); } + + private: + Stream::ConcurrentStreamBuf m_streambuf; + EventStreamEncoder m_encoder; + }; + } + } +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventHeader.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventHeader.h index e8a638ec29..c60dda0435 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventHeader.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventHeader.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventMessage.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventMessage.h index df0c47c43d..4540fbe79c 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventMessage.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventMessage.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -19,7 +19,7 @@ namespace Aws extern AWS_CORE_API const char MESSAGE_TYPE_HEADER[]; extern AWS_CORE_API const char ERROR_CODE_HEADER[]; extern AWS_CORE_API const char ERROR_MESSAGE_HEADER[]; - extern AWS_CORE_API const char EXCEPTION_TYPE_HEADER[]; + extern AWS_CORE_API const char EXCEPTION_TYPE_HEADER[]; /** * A typical message in event stream consists of two parts: Prelude and Data, as well as the prelude CRC and message CRC. @@ -33,25 +33,25 @@ namespace Aws { UNKNOWN, EVENT, - REQUEST_LEVEL_ERROR, - REQUEST_LEVEL_EXCEPTION + REQUEST_LEVEL_ERROR, + REQUEST_LEVEL_EXCEPTION + }; + + enum class ContentType + { + UNKNOWN, + APPLICATION_OCTET_STREAM, + APPLICATION_JSON, + TEXT_PLAIN }; - enum class ContentType - { - UNKNOWN, - APPLICATION_OCTET_STREAM, - APPLICATION_JSON, - TEXT_PLAIN - }; - static MessageType GetMessageTypeForName(const Aws::String& name); static Aws::String GetNameForMessageType(MessageType value); - static ContentType GetContentTypeForName(const Aws::String& name); - static Aws::String GetNameForContentType(ContentType value); - - + static ContentType GetContentTypeForName(const Aws::String& name); + static Aws::String GetNameForContentType(ContentType value); + + /** * Clean up the message, including the metadata, headers and payload received. */ @@ -94,9 +94,9 @@ namespace Aws /** * Set event payload. */ - void WriteEventPayload(const unsigned char* data, size_t length); + void WriteEventPayload(const unsigned char* data, size_t length); void WriteEventPayload(const Aws::Vector<unsigned char>& bits); - void WriteEventPayload(const Aws::String& bits); + void WriteEventPayload(const Aws::String& bits); /** * Get the byte array of the payload with transferring ownership. */ diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStream.h index d4b551500b..daa9cbf57d 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStream.h @@ -1,8 +1,8 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once -#include <aws/core/utils/event/EventDecoderStream.h> -#include <aws/core/utils/event/EventEncoderStream.h> +#include <aws/core/utils/event/EventDecoderStream.h> +#include <aws/core/utils/event/EventEncoderStream.h> diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamBuf.h index 61244dcd63..ad5c440323 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamBuf.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamBuf.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -15,7 +15,7 @@ namespace Aws { namespace Event { - extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; + extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE; /** * Derived from std::streambuf, used as the underlying buffer for EventStream. @@ -26,7 +26,7 @@ namespace Aws public: /** * @param decoder decodes the stream from server side, so as to invoke related callback functions. - * @param bufferSize The length of buffer, will be 1024 bytes by default. + * @param bufferSize The length of buffer, will be 1024 bytes by default. */ EventStreamBuf(EventStreamDecoder& decoder, size_t bufferLength = DEFAULT_BUF_SIZE); virtual ~EventStreamBuf(); diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamDecoder.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamDecoder.h index 794e30afb6..8f737e7bc7 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamDecoder.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamDecoder.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -25,7 +25,7 @@ namespace Aws /** * Whether or not the decoder is in good state. Return false if the decoder encounters errors. */ - inline explicit operator bool() const { return *m_eventStreamHandler; } + inline explicit operator bool() const { return *m_eventStreamHandler; } /** * A wrapper of aws_event_stream_streaming_decoder_pump in aws-c-event-stream. @@ -99,7 +99,7 @@ namespace Aws /** * The underlying decoder defined in aws-c-event-stream. - * The decoder will invoke callback functions when the streaming messages received. + * The decoder will invoke callback functions when the streaming messages received. */ aws_event_stream_streaming_decoder m_decoder; EventStreamHandler* m_eventStreamHandler; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h index 98cbef34ab..3cd06a9df2 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamErrors.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamErrors.h index 9a0901840f..d85e4fdd1f 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamErrors.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamErrors.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamHandler.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamHandler.h index 90ea82f43b..257bfd8288 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamHandler.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamHandler.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -53,10 +53,10 @@ namespace Aws m_internalError = EventStreamErrors::EVENT_STREAM_NO_ERROR; m_headersBytesReceived = 0; m_payloadBytesReceived = 0; - + m_message.Reset(); } - + /** * Set internal Event Stream Errors, which is associated with errors in aws-c-event-stream library. */ @@ -144,4 +144,4 @@ namespace Aws }; } } -} +} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h index f64b47249e..657ee6eff4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h index ef4df49727..be572ad23b 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h index c55bc2316c..b7fb714ed6 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -30,11 +30,11 @@ namespace Aws virtual ~ConsoleLogSystem() {} - /** - * Flushes buffered messages to stdout. - */ - void Flush() override; - + /** + * Flushes buffered messages to stdout. + */ + void Flush() override; + protected: virtual void ProcessFormattedStatement(Aws::String&& statement) override; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h index 8a3d02c4f3..dbeed83cb1 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -43,16 +43,16 @@ namespace Aws * on construction. */ DefaultLogSystem(LogLevel logLevel, const Aws::String& filenamePrefix); - + virtual ~DefaultLogSystem(); /** - * Flushes buffered messages to the file system. - * This method is thread-safe. - */ - void Flush() override; - - /** + * Flushes buffered messages to the file system. + * This method is thread-safe. + */ + void Flush() override; + + /** * Structure containing semaphores, queue etc... */ struct LogSynchronizationData @@ -63,7 +63,7 @@ namespace Aws std::mutex m_logQueueMutex; std::condition_variable m_queueSignal; Aws::Vector<Aws::String> m_queuedLogMessages; - bool m_stopLogging; + bool m_stopLogging; private: LogSynchronizationData(const LogSynchronizationData& rhs) = delete; diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h index bd862cb1f3..6157c45528 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h index bc0cc46c6f..ff1dd36c0e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h index 7ce4c2df6d..b400340de4 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -27,7 +27,7 @@ #define AWS_LOG_INFO(tag, ...) #define AWS_LOG_DEBUG(tag, ...) #define AWS_LOG_TRACE(tag, ...) - #define AWS_LOG_FLUSH() + #define AWS_LOG_FLUSH() #define AWS_LOGSTREAM(level, tag, streamExpression) #define AWS_LOGSTREAM_FATAL(tag, streamExpression) @@ -36,19 +36,19 @@ #define AWS_LOGSTREAM_INFO(tag, streamExpression) #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) #define AWS_LOGSTREAM_TRACE(tag, streamExpression) - #define AWS_LOGSTREAM_FLUSH() + #define AWS_LOGSTREAM_FLUSH() #else - #define AWS_LOG_FLUSH() \ - { \ - Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \ - if ( logSystem ) \ - { \ - logSystem->Flush(); \ - } \ - } - + #define AWS_LOG_FLUSH() \ + { \ + Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \ + if ( logSystem ) \ + { \ + logSystem->Flush(); \ + } \ + } + #define AWS_LOG(level, tag, ...) \ { \ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \ @@ -189,6 +189,6 @@ } \ } - #define AWS_LOGSTREAM_FLUSH() AWS_LOG_FLUSH() - + #define AWS_LOGSTREAM_FLUSH() AWS_LOG_FLUSH() + #endif // DISABLE_AWS_LOGGING diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h index 5d06c83670..642d1c3022 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -40,10 +40,10 @@ namespace Aws * Writes the stream to the output stream. */ virtual void LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) = 0; - /** - * Writes any buffered messages to the underlying device if the logger supports buffering. - */ - virtual void Flush() = 0; + /** + * Writes any buffered messages to the underlying device if the logger supports buffering. + */ + virtual void Flush() = 0; }; } // namespace Logging diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h index 41a5990cbd..5b1221917a 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -14,8 +14,8 @@ #include <algorithm> #include <type_traits> -struct aws_allocator; - +struct aws_allocator; + namespace Aws { namespace Utils @@ -52,8 +52,8 @@ namespace Aws */ AWS_CORE_API void Free(void* memoryPtr); - AWS_CORE_API aws_allocator* get_aws_allocator(); - + AWS_CORE_API aws_allocator* get_aws_allocator(); + /** * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code * use these functions instead or Aws::MakeShared diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h index 31c0b5ac77..0a8341ff86 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -16,7 +16,7 @@ namespace Aws namespace Memory { /** - * Central interface for memory management customizations. To create a custom memory manager, implement this interface and then + * Central interface for memory management customizations. To create a custom memory manager, implement this interface and then * call InitializeAWSMemorySystem(). */ class AWS_CORE_API MemorySystemInterface @@ -34,11 +34,11 @@ namespace Aws virtual void End() = 0; /** - * Allocate your memory inside this method. blocksize and alignment are exactly the same as the std::allocator interfaces. + * Allocate your memory inside this method. blocksize and alignment are exactly the same as the std::allocator interfaces. * The allocationTag parameter is for memory tracking; you don't have to handle it. */ virtual void* AllocateMemory(std::size_t blockSize, std::size_t alignment, const char *allocationTag = nullptr) = 0; - + /** * Free the memory pointed to by memoryPtr. */ diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h index 65ad0b5311..932408b761 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h index 5e3a04dfb7..ed63b8e939 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h index fd94929f6b..49341325a8 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h index 3127276eef..66dc98bb8f 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h index 2778e782ca..d45b245ad0 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h index 2704bd89fb..6aee204f39 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h index c1bb539962..7a3f561244 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h index 052b89fabc..335346a31b 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h index c98263c58f..3cd013e3f8 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -27,9 +27,9 @@ The problem: (2) The optimization that this enables is completely broken if using shared libraries and there is no way to opt out of using it. An optimization that uses a comparison to a static memory address is death for shared libraries. -Supposing you have a shared library B that depends on another shared library A. There are a variety of innocuous scenarios where you end up crashing -in the std::basic_string destructor because it's attempting to free a static memory address (&std::string::_Rep_Base::_S_empty_rep_storage -- you'll need to temporarily -flip the struct to "public:" in order to take this address from your code). +Supposing you have a shared library B that depends on another shared library A. There are a variety of innocuous scenarios where you end up crashing +in the std::basic_string destructor because it's attempting to free a static memory address (&std::string::_Rep_Base::_S_empty_rep_storage -- you'll need to temporarily +flip the struct to "public:" in order to take this address from your code). If you take the address of this location, you will get two different answers depending on whether you query it in library A or library B (oddly enough, if you look the symbol itself up, it only shows up as public weak in libgnustl_shared.so). When the string destructor is run from the context of library B, the _Rep::_M_dispose function will end up attempting to free @@ -38,7 +38,7 @@ an address that is static memory (from library A). Lessons (with the empty string optimization forced on you): (1) You can't move std::strings across shared libraries (as a part of another class, Outcome in our case) - (2) If you default initialize a std::string member variable, you can't have a mismatched constructor/destructor pair such that one is in a cpp file and the other + (2) If you default initialize a std::string member variable, you can't have a mismatched constructor/destructor pair such that one is in a cpp file and the other is missing/implicit or defined in the header file Solutions: @@ -48,7 +48,7 @@ Use libc++ rather than gnustl For those who must use gnustl, we have provided a working solution by cobbling together a set of hacks: We prevent the empty string optimization from ever being run on our strings by: - (1) Make Aws::Allocator always fail equality checks with itself; this check is part of the empty string optimization in several std::basic_string constructors + (1) Make Aws::Allocator always fail equality checks with itself; this check is part of the empty string optimization in several std::basic_string constructors (2) All other cases are prevented by turning Aws::String into a subclass whose default constructor and move operations go to baseclass versions which will not perform the empty string optimization @@ -76,7 +76,7 @@ class String : public AndroidBasicString String(AndroidBasicString&& rhs) : Base(rhs) {} // DO NOT CALL std::move, let this go to the const ref constructor String(const char* str) : Base(str) {} String(const char* str_begin, const char* str_end) : Base(str_begin, str_end) {} - String(const AndroidBasicString& str, size_type pos, size_type count) : Base(str, pos, count) {} + String(const AndroidBasicString& str, size_type pos, size_type count) : Base(str, pos, count) {} String(const String& str, size_type pos, size_type count) : Base(str, pos, count) {} String(const char* str, size_type count) : Base(str, count) {} String(size_type count, char c) : Base(count, c) {} diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h index 0112062894..a5e6f4ae48 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h index 504865c11d..d9f67825c7 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h index 66e73b8eb9..45c4d0a448 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once @@ -43,7 +43,7 @@ class AWS_CORE_API SimpleStringStream : public std::iostream Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); } Aws::String str() const { return m_streamBuffer.str(); } - void str(const Aws::String& value); + void str(const Aws::String& value); private: @@ -79,7 +79,7 @@ class AWS_CORE_API SimpleIStringStream : public std::istream Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); } Aws::String str() const { return m_streamBuffer.str(); } - void str(const Aws::String& value); + void str(const Aws::String& value); private: @@ -115,7 +115,7 @@ class AWS_CORE_API SimpleOStringStream : public std::ostream Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); } Aws::String str() const { return m_streamBuffer.str(); } - void str(const Aws::String& value); + void str(const Aws::String& value); private: diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h index f066cc3640..974dbefb02 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h @@ -1,205 +1,205 @@ -/** - * 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/utils/ratelimiter/RateLimiterInterface.h> - -#include <algorithm> -#include <mutex> -#include <thread> -#include <functional> - -namespace Aws -{ - namespace Utils - { - namespace RateLimits - { - /** - * High precision rate limiter. If you need to limit your bandwidth by a budget, this is very likely the implementation you want. - */ - template<typename CLOCK = std::chrono::high_resolution_clock, typename DUR = std::chrono::seconds, bool RENORMALIZE_RATE_CHANGES = true> - class DefaultRateLimiter : public RateLimiterInterface - { - public: - using Base = RateLimiterInterface; - - using InternalTimePointType = std::chrono::time_point<CLOCK>; - using ElapsedTimeFunctionType = std::function< InternalTimePointType() >; - - /** - * Initializes state, starts counts, does some basic validation. - */ - DefaultRateLimiter(int64_t maxRate, ElapsedTimeFunctionType elapsedTimeFunction = CLOCK::now) : - m_elapsedTimeFunction(elapsedTimeFunction), - m_maxRate(0), - m_accumulatorLock(), - m_accumulator(0), - m_accumulatorFraction(0), - m_accumulatorUpdated(), - m_replenishNumerator(0), - m_replenishDenominator(0), - m_delayNumerator(0), - m_delayDenominator(0) - { - // verify we're not going to divide by zero due to goofy type parameterization - static_assert(DUR::period::num > 0, "Rate duration must have positive numerator"); - static_assert(DUR::period::den > 0, "Rate duration must have positive denominator"); - static_assert(CLOCK::duration::period::num > 0, "RateLimiter clock duration must have positive numerator"); - static_assert(CLOCK::duration::period::den > 0, "RateLimiter clock duration must have positive denominator"); - - DefaultRateLimiter::SetRate(maxRate, true); - } - - virtual ~DefaultRateLimiter() = default; - - /** - * Calculates time in milliseconds that should be delayed before letting anymore data through. - */ - virtual DelayType ApplyCost(int64_t cost) override - { - std::lock_guard<std::recursive_mutex> lock(m_accumulatorLock); - - auto now = m_elapsedTimeFunction(); - auto elapsedTime = (now - m_accumulatorUpdated).count(); - - // replenish the accumulator based on how much time has passed - auto temp = elapsedTime * m_replenishNumerator + m_accumulatorFraction; - m_accumulator += temp / m_replenishDenominator; - m_accumulatorFraction = temp % m_replenishDenominator; - - // the accumulator is capped based on the maximum rate - m_accumulator = (std::min)(m_accumulator, m_maxRate); - if (m_accumulator == m_maxRate) - { - m_accumulatorFraction = 0; - } - - // if the accumulator is still negative, then we'll have to wait - DelayType delay(0); - if (m_accumulator < 0) - { - delay = DelayType(-m_accumulator * m_delayDenominator / m_delayNumerator); - } - - // apply the cost to the accumulator after the delay has been calculated; the next call will end up paying for our cost - m_accumulator -= cost; - m_accumulatorUpdated = now; - - return delay; - } - - /** - * Same as ApplyCost() but then goes ahead and sleeps the current thread. - */ - virtual void ApplyAndPayForCost(int64_t cost) override - { - auto costInMilliseconds = ApplyCost(cost); - if(costInMilliseconds.count() > 0) - { - std::this_thread::sleep_for(costInMilliseconds); - } - } - - /** - * Update the bandwidth rate to allow. - */ - virtual void SetRate(int64_t rate, bool resetAccumulator = false) override - { - std::lock_guard<std::recursive_mutex> lock(m_accumulatorLock); - - // rate must always be positive - rate = (std::max)(static_cast<int64_t>(1), rate); - - if (resetAccumulator) - { - m_accumulator = rate; - m_accumulatorFraction = 0; - m_accumulatorUpdated = m_elapsedTimeFunction(); - } - else - { - // sync the accumulator to current time - ApplyCost(0); // this call is why we need a recursive mutex - - if (ShouldRenormalizeAccumulatorOnRateChange()) - { - // now renormalize the accumulator and its fractional part against the new rate - // the idea here is we want to preserve the desired wait based on the previous rate - // - // As an example: - // Say we had a rate of 100/s and our accumulator was -500 (ie the next ApplyCost would incur a 5 second delay) - // If we change the rate to 1000/s and want to preserve that delay, we need to scale the accumulator to -5000 - m_accumulator = m_accumulator * rate / m_maxRate; - m_accumulatorFraction = m_accumulatorFraction * rate / m_maxRate; - } - } - - m_maxRate = rate; - - // Helper constants that represent the amount replenished per CLOCK time period; use the gcd to reduce them in order to try and minimize the chance of integer overflow - m_replenishNumerator = m_maxRate * DUR::period::den * CLOCK::duration::period::num; - m_replenishDenominator = DUR::period::num * CLOCK::duration::period::den; - auto gcd = ComputeGCD(m_replenishNumerator, m_replenishDenominator); - m_replenishNumerator /= gcd; - m_replenishDenominator /= gcd; - - // Helper constants that represent the delay per unit of costAccumulator; use the gcd to reduce them in order to try and minimize the chance of integer overflow - m_delayNumerator = m_maxRate * DelayType::period::num * DUR::period::den; - m_delayDenominator = DelayType::period::den * DUR::period::num; - gcd = ComputeGCD(m_delayNumerator, m_delayDenominator); - m_delayNumerator /= gcd; - m_delayDenominator /= gcd; - } - - private: - - int64_t ComputeGCD(int64_t num1, int64_t num2) const - { - // Euclid's - while (num2 != 0) - { - int64_t rem = num1 % num2; - num1 = num2; - num2 = rem; - } - - return num1; - } - - bool ShouldRenormalizeAccumulatorOnRateChange() const { return RENORMALIZE_RATE_CHANGES; } - - /// Function that returns the current time - ElapsedTimeFunctionType m_elapsedTimeFunction; - - /// The rate we want to limit to - int64_t m_maxRate; - - /// We need to pretty much lock everything while either setting the rate or applying a cost - std::recursive_mutex m_accumulatorLock; - - /// Tracks how much "rate" we currently have to give; if this drops below zero then we start having to wait in order to perform operations and maintain the rate - /// Replenishes over time based on m_maxRate - int64_t m_accumulator; - - /// Updates can occur at any time, leading to a fractional accumulation; represents the fraction (m_accumulatorFraction / m_replenishDenominator) - int64_t m_accumulatorFraction; - - /// Last time point the accumulator was updated - InternalTimePointType m_accumulatorUpdated; - - /// Some helper constants that represents fixed (per m_maxRate) ratios used in the delay and replenishment calculations - int64_t m_replenishNumerator; - int64_t m_replenishDenominator; - int64_t m_delayNumerator; - int64_t m_delayDenominator; - }; - - } // namespace RateLimits - } // namespace Utils -} // namespace Aws +/** + * 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/utils/ratelimiter/RateLimiterInterface.h> + +#include <algorithm> +#include <mutex> +#include <thread> +#include <functional> + +namespace Aws +{ + namespace Utils + { + namespace RateLimits + { + /** + * High precision rate limiter. If you need to limit your bandwidth by a budget, this is very likely the implementation you want. + */ + template<typename CLOCK = std::chrono::high_resolution_clock, typename DUR = std::chrono::seconds, bool RENORMALIZE_RATE_CHANGES = true> + class DefaultRateLimiter : public RateLimiterInterface + { + public: + using Base = RateLimiterInterface; + + using InternalTimePointType = std::chrono::time_point<CLOCK>; + using ElapsedTimeFunctionType = std::function< InternalTimePointType() >; + + /** + * Initializes state, starts counts, does some basic validation. + */ + DefaultRateLimiter(int64_t maxRate, ElapsedTimeFunctionType elapsedTimeFunction = CLOCK::now) : + m_elapsedTimeFunction(elapsedTimeFunction), + m_maxRate(0), + m_accumulatorLock(), + m_accumulator(0), + m_accumulatorFraction(0), + m_accumulatorUpdated(), + m_replenishNumerator(0), + m_replenishDenominator(0), + m_delayNumerator(0), + m_delayDenominator(0) + { + // verify we're not going to divide by zero due to goofy type parameterization + static_assert(DUR::period::num > 0, "Rate duration must have positive numerator"); + static_assert(DUR::period::den > 0, "Rate duration must have positive denominator"); + static_assert(CLOCK::duration::period::num > 0, "RateLimiter clock duration must have positive numerator"); + static_assert(CLOCK::duration::period::den > 0, "RateLimiter clock duration must have positive denominator"); + + DefaultRateLimiter::SetRate(maxRate, true); + } + + virtual ~DefaultRateLimiter() = default; + + /** + * Calculates time in milliseconds that should be delayed before letting anymore data through. + */ + virtual DelayType ApplyCost(int64_t cost) override + { + std::lock_guard<std::recursive_mutex> lock(m_accumulatorLock); + + auto now = m_elapsedTimeFunction(); + auto elapsedTime = (now - m_accumulatorUpdated).count(); + + // replenish the accumulator based on how much time has passed + auto temp = elapsedTime * m_replenishNumerator + m_accumulatorFraction; + m_accumulator += temp / m_replenishDenominator; + m_accumulatorFraction = temp % m_replenishDenominator; + + // the accumulator is capped based on the maximum rate + m_accumulator = (std::min)(m_accumulator, m_maxRate); + if (m_accumulator == m_maxRate) + { + m_accumulatorFraction = 0; + } + + // if the accumulator is still negative, then we'll have to wait + DelayType delay(0); + if (m_accumulator < 0) + { + delay = DelayType(-m_accumulator * m_delayDenominator / m_delayNumerator); + } + + // apply the cost to the accumulator after the delay has been calculated; the next call will end up paying for our cost + m_accumulator -= cost; + m_accumulatorUpdated = now; + + return delay; + } + + /** + * Same as ApplyCost() but then goes ahead and sleeps the current thread. + */ + virtual void ApplyAndPayForCost(int64_t cost) override + { + auto costInMilliseconds = ApplyCost(cost); + if(costInMilliseconds.count() > 0) + { + std::this_thread::sleep_for(costInMilliseconds); + } + } + + /** + * Update the bandwidth rate to allow. + */ + virtual void SetRate(int64_t rate, bool resetAccumulator = false) override + { + std::lock_guard<std::recursive_mutex> lock(m_accumulatorLock); + + // rate must always be positive + rate = (std::max)(static_cast<int64_t>(1), rate); + + if (resetAccumulator) + { + m_accumulator = rate; + m_accumulatorFraction = 0; + m_accumulatorUpdated = m_elapsedTimeFunction(); + } + else + { + // sync the accumulator to current time + ApplyCost(0); // this call is why we need a recursive mutex + + if (ShouldRenormalizeAccumulatorOnRateChange()) + { + // now renormalize the accumulator and its fractional part against the new rate + // the idea here is we want to preserve the desired wait based on the previous rate + // + // As an example: + // Say we had a rate of 100/s and our accumulator was -500 (ie the next ApplyCost would incur a 5 second delay) + // If we change the rate to 1000/s and want to preserve that delay, we need to scale the accumulator to -5000 + m_accumulator = m_accumulator * rate / m_maxRate; + m_accumulatorFraction = m_accumulatorFraction * rate / m_maxRate; + } + } + + m_maxRate = rate; + + // Helper constants that represent the amount replenished per CLOCK time period; use the gcd to reduce them in order to try and minimize the chance of integer overflow + m_replenishNumerator = m_maxRate * DUR::period::den * CLOCK::duration::period::num; + m_replenishDenominator = DUR::period::num * CLOCK::duration::period::den; + auto gcd = ComputeGCD(m_replenishNumerator, m_replenishDenominator); + m_replenishNumerator /= gcd; + m_replenishDenominator /= gcd; + + // Helper constants that represent the delay per unit of costAccumulator; use the gcd to reduce them in order to try and minimize the chance of integer overflow + m_delayNumerator = m_maxRate * DelayType::period::num * DUR::period::den; + m_delayDenominator = DelayType::period::den * DUR::period::num; + gcd = ComputeGCD(m_delayNumerator, m_delayDenominator); + m_delayNumerator /= gcd; + m_delayDenominator /= gcd; + } + + private: + + int64_t ComputeGCD(int64_t num1, int64_t num2) const + { + // Euclid's + while (num2 != 0) + { + int64_t rem = num1 % num2; + num1 = num2; + num2 = rem; + } + + return num1; + } + + bool ShouldRenormalizeAccumulatorOnRateChange() const { return RENORMALIZE_RATE_CHANGES; } + + /// Function that returns the current time + ElapsedTimeFunctionType m_elapsedTimeFunction; + + /// The rate we want to limit to + int64_t m_maxRate; + + /// We need to pretty much lock everything while either setting the rate or applying a cost + std::recursive_mutex m_accumulatorLock; + + /// Tracks how much "rate" we currently have to give; if this drops below zero then we start having to wait in order to perform operations and maintain the rate + /// Replenishes over time based on m_maxRate + int64_t m_accumulator; + + /// Updates can occur at any time, leading to a fractional accumulation; represents the fraction (m_accumulatorFraction / m_replenishDenominator) + int64_t m_accumulatorFraction; + + /// Last time point the accumulator was updated + InternalTimePointType m_accumulatorUpdated; + + /// Some helper constants that represents fixed (per m_maxRate) ratios used in the delay and replenishment calculations + int64_t m_replenishNumerator; + int64_t m_replenishDenominator; + int64_t m_delayNumerator; + int64_t m_delayDenominator; + }; + + } // namespace RateLimits + } // namespace Utils +} // namespace Aws diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h index 6015f9b49c..578c9ed844 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ConcurrentStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ConcurrentStreamBuf.h index d882636d93..9ef7d9763e 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ConcurrentStreamBuf.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ConcurrentStreamBuf.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h index ca601d75e4..ad9dc2a929 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h @@ -1,8 +1,8 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -29,7 +29,7 @@ namespace Aws * @param lengthToRead length in bytes to actually use in the buffer (e.g. you have a 1kb buffer, but only want the stream * to see 500 b of it. */ - PreallocatedStreamBuf(unsigned char* buffer, uint64_t lengthToRead); + PreallocatedStreamBuf(unsigned char* buffer, uint64_t lengthToRead); PreallocatedStreamBuf(const PreallocatedStreamBuf&) = delete; PreallocatedStreamBuf& operator=(const PreallocatedStreamBuf&) = delete; @@ -49,7 +49,7 @@ namespace Aws private: unsigned char* m_underlyingBuffer; - const uint64_t m_lengthToRead; + const uint64_t m_lengthToRead; }; } } diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h index 5b20017712..e82e6448cd 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h index 2c55732d06..ef12c60ba3 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h @@ -1,8 +1,8 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h index 5ab072f967..36975af513 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h index 290254066a..5d757dcecb 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h index 30b8cd7201..bad50532dd 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h @@ -1,6 +1,6 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h index 478cea1fa3..79326b3a15 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h index 1fbb0b8838..d1ca79ffab 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h @@ -1,7 +1,7 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ #pragma once @@ -150,7 +150,7 @@ namespace Aws /** * Container for Xml Document as a whole. All nodes have a reference to their parent document. Any changes - * you make to the nodes will be reflected here. + * you make to the nodes will be reflected here. */ class AWS_CORE_API XmlDocument { @@ -158,12 +158,12 @@ namespace Aws /** * move document memory */ - XmlDocument(const XmlDocument& other); - XmlDocument(XmlDocument&& doc); + XmlDocument(const XmlDocument& other); + XmlDocument(XmlDocument&& doc); + + XmlDocument& operator=(const XmlDocument& other); + XmlDocument& operator=(XmlDocument&& other); - XmlDocument& operator=(const XmlDocument& other); - XmlDocument& operator=(XmlDocument&& other); - ~XmlDocument(); /** @@ -180,7 +180,7 @@ namespace Aws */ bool WasParseSuccessful() const; /** - * Returns the error message if the call to CreateFromXml* failed. + * Returns the error message if the call to CreateFromXml* failed. */ Aws::String GetErrorMessage() const; /** @@ -198,7 +198,7 @@ namespace Aws private: XmlDocument(); - void InitDoc(); + void InitDoc(); Aws::External::tinyxml2::XMLDocument* m_doc; @@ -207,8 +207,8 @@ namespace Aws //allow outcome call the default constructor to handle it's error case. friend class Aws::Utils::Outcome<Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>, Aws::Client::AWSError<Aws::Client::CoreErrors>>; friend class Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>; - template<typename T> - friend class Client::AWSError; + template<typename T> + friend class Client::AWSError; friend class Client::AWSXMLClient; }; |