aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
downloadydb-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')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h20
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h18
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h84
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h18
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h146
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h44
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h70
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h174
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentials.h170
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h66
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h102
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h190
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h236
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h66
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h184
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h20
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h178
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h68
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h200
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h4
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h48
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h112
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h50
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h14
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h34
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h40
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h180
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h28
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h44
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h26
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h70
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ARN.h116
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h34
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h124
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h118
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h146
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h26
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h66
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventDecoderStream.h86
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventEncoderStream.h138
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventHeader.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventMessage.h40
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStream.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamBuf.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamDecoder.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamEncoder.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamErrors.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/event/EventStreamHandler.h12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h18
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h34
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h14
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h18
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h410
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ConcurrentStreamBuf.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h28
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonSerializableWebServiceRequest.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonStreamingWebServiceRequest.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonWebServiceRequest.cpp16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp28
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Globals.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Region.cpp72
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Version.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSigner.cpp80
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSignerProvider.cpp42
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProvider.cpp240
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProviderChain.cpp20
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/STSCredentialsProvider.cpp326
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp718
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp116
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AsyncCallerContext.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp242
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/CoreErrors.cpp48
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/DefaultRetryStrategy.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/RetryStrategy.cpp204
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/SpecifiedRetryableErrorsRetryStrategy.cpp56
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/config/AWSProfileConfigLoader.cpp430
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp108
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/tinyxml2/tinyxml2.cpp34
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClient.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp46
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpRequest.cpp52
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpTypes.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/Scheme.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/URI.cpp72
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp108
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp508
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp916
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/DefaultMonitoring.cpp160
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/HttpClientMetrics.cpp22
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/Net.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/SimpleUDP.cpp250
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp48
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/OSVersionInfo.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Security.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Time.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/ARN.cpp92
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Array.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DateTimeCommon.cpp870
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Directory.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/EnumParseOverflowContainer.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/FileSystemUtils.cpp6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/GetTheLights.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/StringUtils.cpp98
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/TempFile.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/UUID.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/base64/Base64.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Cipher.cpp24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoMaterial.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoScheme.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoBuf.cpp34
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoStream.cpp10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/EncryptionMaterials.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/KeyWrapAlgorithm.cpp38
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/MD5.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256HMAC.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/factory/Factories.cpp368
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp344
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventDecoderStream.cpp44
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventEncoderStream.cpp56
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventHeader.cpp6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventMessage.cpp122
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamBuf.cpp10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamDecoder.cpp14
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamEncoder.cpp36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamErrors.cpp6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp94
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/AWSLogging.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/ConsoleLogSystem.cpp18
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/DefaultLogSystem.cpp24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/FormattedLogSystem.cpp12
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/LogLevel.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/AWSMemory.cpp72
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp16
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ConcurrentStreamBuf.cpp36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/PreallocatedStreamBuf.cpp14
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ResponseStream.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Executor.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ReaderWriterLock.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Semaphore.cpp6
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ThreadTask.cpp8
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp188
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/ya.make46
225 files changed, 6459 insertions, 6459 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;
};
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonSerializableWebServiceRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonSerializableWebServiceRequest.cpp
index 92dc1c849b..0c401b01b2 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonSerializableWebServiceRequest.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonSerializableWebServiceRequest.cpp
@@ -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/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonStreamingWebServiceRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonStreamingWebServiceRequest.cpp
index 8826268b92..92e61c7ad4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonStreamingWebServiceRequest.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonStreamingWebServiceRequest.cpp
@@ -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/AmazonStreamingWebServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonWebServiceRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonWebServiceRequest.cpp
index db77a1daed..a6b0406683 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonWebServiceRequest.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/AmazonWebServiceRequest.cpp
@@ -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/AmazonWebServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
@@ -11,10 +11,10 @@ using namespace Aws;
AmazonWebServiceRequest::AmazonWebServiceRequest() :
m_responseStreamFactory(Aws::Utils::Stream::DefaultResponseStreamFactoryMethod),
m_onDataReceived(nullptr),
- m_onDataSent(nullptr),
- m_continueRequest(nullptr),
- m_onRequestSigned(nullptr),
- m_requestRetryHandler(nullptr)
+ m_onDataSent(nullptr),
+ m_continueRequest(nullptr),
+ m_onRequestSigned(nullptr),
+ m_requestRetryHandler(nullptr)
{
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
index 4baea9fae7..1eaa477fca 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
@@ -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/Version.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/Aws.h>
@@ -12,8 +12,8 @@
#include <aws/core/external/cjson/cJSON.h>
#include <aws/core/monitoring/MonitoringManager.h>
#include <aws/core/net/Net.h>
-#include <aws/core/config/AWSProfileConfigLoader.h>
-#include <aws/core/internal/AWSHttpResourceClient.h>
+#include <aws/core/config/AWSProfileConfigLoader.h>
+#include <aws/core/internal/AWSHttpResourceClient.h>
namespace Aws
{
@@ -43,9 +43,9 @@ namespace Aws
AWS_LOGSTREAM_INFO(ALLOCATION_TAG, "Initiate AWS SDK for C++ with Version:" << Aws::String(Aws::Version::GetVersionString()));
}
- Aws::Config::InitConfigAndCredentialsCacheManager();
-
- if (options.cryptoOptions.aes_CBCFactory_create_fn)
+ Aws::Config::InitConfigAndCredentialsCacheManager();
+
+ if (options.cryptoOptions.aes_CBCFactory_create_fn)
{
Aws::Utils::Crypto::SetAES_CBCFactory(options.cryptoOptions.aes_CBCFactory_create_fn());
}
@@ -102,26 +102,26 @@ namespace Aws
hooks.free_fn = Aws::Free;
cJSON_InitHooks(&hooks);
Aws::Net::InitNetwork();
- Aws::Internal::InitEC2MetadataClient();
+ Aws::Internal::InitEC2MetadataClient();
Aws::Monitoring::InitMonitoring(options.monitoringOptions.customizedMonitoringFactory_create_fn);
}
void ShutdownAPI(const SDKOptions& options)
{
Aws::Monitoring::CleanupMonitoring();
- Aws::Internal::CleanupEC2MetadataClient();
+ Aws::Internal::CleanupEC2MetadataClient();
Aws::Net::CleanupNetwork();
Aws::CleanupEnumOverflowContainer();
Aws::Http::CleanupHttp();
Aws::Utils::Crypto::CleanupCrypto();
- Aws::Config::CleanupConfigAndCredentialsCacheManager();
-
+ Aws::Config::CleanupConfigAndCredentialsCacheManager();
+
if(options.loggingOptions.logLevel != Aws::Utils::Logging::LogLevel::Off)
{
Aws::Utils::Logging::ShutdownAWSLogging();
}
-
+
Aws::Client::CoreErrorsMapper::CleanupCoreErrorsMapper();
#ifdef USE_AWS_MEMORY_MANAGEMENT
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Globals.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Globals.cpp
index 46b5a7b410..55f2ee9220 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Globals.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Globals.cpp
@@ -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/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
#include <aws/core/utils/memory/AWSMemory.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Region.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Region.cpp
index ae35d48e13..4b18bf2a2a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Region.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Region.cpp
@@ -1,36 +1,36 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/Region.h>
-namespace Aws
-{
- namespace Region
- {
- Aws::String ComputeSignerRegion(const Aws::String& region)
- {
- if (region == Aws::Region::AWS_GLOBAL)
- {
- return Aws::Region::US_EAST_1;
- }
- else if (region == "s3-external-1")
- {
- return Aws::Region::US_EAST_1;
- }
- else if (region.size() >= 5 && region.compare(0, 5, "fips-") == 0)
- {
- return region.substr(5);
- }
- else if (region.size() >= 5 && region.compare(region.size() - 5, 5, "-fips") == 0)
- {
- return region.substr(0, region.size() - 5);
- }
- else
- {
- return region;
- }
- }
- }
-} \ No newline at end of file
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/Region.h>
+namespace Aws
+{
+ namespace Region
+ {
+ Aws::String ComputeSignerRegion(const Aws::String& region)
+ {
+ if (region == Aws::Region::AWS_GLOBAL)
+ {
+ return Aws::Region::US_EAST_1;
+ }
+ else if (region == "s3-external-1")
+ {
+ return Aws::Region::US_EAST_1;
+ }
+ else if (region.size() >= 5 && region.compare(0, 5, "fips-") == 0)
+ {
+ return region.substr(5);
+ }
+ else if (region.size() >= 5 && region.compare(region.size() - 5, 5, "-fips") == 0)
+ {
+ return region.substr(0, region.size() - 5);
+ }
+ else
+ {
+ return region;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Version.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Version.cpp
index fa8dda381a..35291906b7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Version.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Version.cpp
@@ -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/Version.h>
#include <aws/core/VersionConfig.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSigner.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSigner.cpp
index 410c446958..de4826fa5b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSigner.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSigner.cpp
@@ -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/auth/AWSAuthSigner.h>
@@ -94,7 +94,7 @@ static Aws::String CanonicalizeRequestSigningString(HttpRequest& request, bool u
signingStringStream << NEWLINE << uriCpy.GetPath() << NEWLINE;
}
- if (request.GetQueryString().find('=') != std::string::npos)
+ if (request.GetQueryString().find('=') != std::string::npos)
{
signingStringStream << request.GetQueryString().substr(1) << NEWLINE;
}
@@ -138,7 +138,7 @@ static Http::HeaderValueCollection CanonicalizeHeaders(Http::HeaderValueCollecti
);
headerValue.erase(new_end, headerValue.end());
- canonicalHeaders[trimmedHeaderName] = headerValue;
+ canonicalHeaders[trimmedHeaderName] = headerValue;
}
return canonicalHeaders;
@@ -157,12 +157,12 @@ AWSAuthV4Signer::AWSAuthV4Signer(const std::shared_ptr<Auth::AWSCredentialsProvi
m_urlEscapePath(urlEscapePath)
{
//go ahead and warm up the signing cache.
- ComputeHash(credentialsProvider->GetAWSCredentials().GetAWSSecretKey(), DateTime::CalculateGmtTimestampAsString(SIMPLE_DATE_FORMAT_STR), region, m_serviceName);
+ ComputeHash(credentialsProvider->GetAWSCredentials().GetAWSSecretKey(), DateTime::CalculateGmtTimestampAsString(SIMPLE_DATE_FORMAT_STR), region, m_serviceName);
}
AWSAuthV4Signer::~AWSAuthV4Signer()
{
- // empty destructor in .cpp file to keep from needing the implementation of (AWSCredentialsProvider, Sha256, Sha256HMAC) in the header file
+ // empty destructor in .cpp file to keep from needing the implementation of (AWSCredentialsProvider, Sha256, Sha256HMAC) in the header file
}
@@ -171,7 +171,7 @@ bool AWSAuthV4Signer::ShouldSignHeader(const Aws::String& header) const
return m_unsignedHeaders.find(Aws::Utils::StringUtils::ToLower(header.c_str())) == m_unsignedHeaders.cend();
}
-bool AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const
+bool AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const
{
AWSCredentials credentials = m_credentialsProvider->GetAWSCredentials();
@@ -222,7 +222,7 @@ bool AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* r
//calculate date header to use in internal signature (this also goes into date header).
DateTime now = GetSigningTimestamp();
- Aws::String dateHeaderValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
+ Aws::String dateHeaderValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
request.SetHeaderValue(AWS_DATE_HEADER, dateHeaderValue);
Aws::StringStream headersStream;
@@ -272,24 +272,24 @@ bool AWSAuthV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* r
}
auto sha256Digest = hashResult.GetResult();
- Aws::String canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
+ Aws::String canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
Aws::String simpleDate = now.ToGmtString(SIMPLE_DATE_FORMAT_STR);
- Aws::String signingRegion = region ? region : m_region;
- Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
- Aws::String stringToSign = GenerateStringToSign(dateHeaderValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
- auto finalSignature = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
+ Aws::String signingRegion = region ? region : m_region;
+ Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
+ Aws::String stringToSign = GenerateStringToSign(dateHeaderValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
+ auto finalSignature = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
Aws::StringStream ss;
ss << AWS_HMAC_SHA256 << " " << CREDENTIAL << EQ << credentials.GetAWSAccessKeyId() << "/" << simpleDate
- << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST << ", " << SIGNED_HEADERS << EQ
+ << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST << ", " << SIGNED_HEADERS << EQ
<< signedHeadersValue << ", " << SIGNATURE << EQ << finalSignature;
auto awsAuthString = ss.str();
AWS_LOGSTREAM_DEBUG(v4LogTag, "Signing request with: " << awsAuthString);
request.SetAwsAuthorization(awsAuthString);
request.SetSigningAccessKey(credentials.GetAWSAccessKeyId());
- request.SetSigningRegion(signingRegion);
+ request.SetSigningRegion(signingRegion);
return true;
}
@@ -324,7 +324,7 @@ bool AWSAuthV4Signer::PresignRequest(Aws::Http::HttpRequest& request, const char
//calculate date header to use in internal signature (this also goes into date header).
DateTime now = GetSigningTimestamp();
- Aws::String dateQueryValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
+ Aws::String dateQueryValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
request.AddQueryStringParameter(Http::AWS_DATE_HEADER, dateQueryValue);
Aws::StringStream headersStream;
@@ -353,18 +353,18 @@ bool AWSAuthV4Signer::PresignRequest(Aws::Http::HttpRequest& request, const char
AWS_LOGSTREAM_DEBUG(v4LogTag, "Signed Headers value: " << signedHeadersValue);
Aws::StringStream ss;
- Aws::String signingRegion = region ? region : m_region;
- Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
+ Aws::String signingRegion = region ? region : m_region;
+ Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
Aws::String simpleDate = now.ToGmtString(SIMPLE_DATE_FORMAT_STR);
ss << credentials.GetAWSAccessKeyId() << "/" << simpleDate
- << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST;
+ << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST;
request.AddQueryStringParameter(X_AMZ_ALGORITHM, AWS_HMAC_SHA256);
request.AddQueryStringParameter(X_AMZ_CREDENTIAL, ss.str());
ss.str("");
request.SetSigningAccessKey(credentials.GetAWSAccessKeyId());
- request.SetSigningRegion(signingRegion);
+ request.SetSigningRegion(signingRegion);
//generate generalized canonicalized request string.
Aws::String canonicalRequestString = CanonicalizeRequestSigningString(request, m_urlEscapePath);
@@ -374,7 +374,7 @@ bool AWSAuthV4Signer::PresignRequest(Aws::Http::HttpRequest& request, const char
canonicalRequestString.append(NEWLINE);
canonicalRequestString.append(signedHeadersValue);
canonicalRequestString.append(NEWLINE);
- if (ServiceRequireUnsignedPayload(signingServiceName))
+ if (ServiceRequireUnsignedPayload(signingServiceName))
{
canonicalRequestString.append(UNSIGNED_PAYLOAD);
}
@@ -394,16 +394,16 @@ bool AWSAuthV4Signer::PresignRequest(Aws::Http::HttpRequest& request, const char
}
auto sha256Digest = hashResult.GetResult();
- auto canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
+ auto canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
- auto stringToSign = GenerateStringToSign(dateQueryValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
- auto finalSigningHash = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
+ auto stringToSign = GenerateStringToSign(dateQueryValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
+ auto finalSigningHash = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
if (finalSigningHash.empty())
{
return false;
}
- //add that the signature to the query string
+ //add that the signature to the query string
request.AddQueryStringParameter(X_AMZ_SIGNATURE, finalSigningHash);
return true;
@@ -544,7 +544,7 @@ AWSAuthEventStreamV4Signer::AWSAuthEventStreamV4Signer(const std::shared_ptr<Aut
m_unsignedHeaders.emplace_back(USER_AGENT_HEADER);
}
-bool AWSAuthEventStreamV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool /* signBody */) const
+bool AWSAuthEventStreamV4Signer::SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool /* signBody */) const
{
AWSCredentials credentials = m_credentialsProvider->GetAWSCredentials();
@@ -563,7 +563,7 @@ bool AWSAuthEventStreamV4Signer::SignRequest(Aws::Http::HttpRequest& request, co
//calculate date header to use in internal signature (this also goes into date header).
DateTime now = GetSigningTimestamp();
- Aws::String dateHeaderValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
+ Aws::String dateHeaderValue = now.ToGmtString(DateFormat::ISO_8601_BASIC);
request.SetHeaderValue(AWS_DATE_HEADER, dateHeaderValue);
Aws::StringStream headersStream;
@@ -613,24 +613,24 @@ bool AWSAuthEventStreamV4Signer::SignRequest(Aws::Http::HttpRequest& request, co
}
auto sha256Digest = hashResult.GetResult();
- Aws::String canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
+ Aws::String canonicalRequestHash = HashingUtils::HexEncode(sha256Digest);
Aws::String simpleDate = now.ToGmtString(SIMPLE_DATE_FORMAT_STR);
- Aws::String signingRegion = region ? region : m_region;
- Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
- Aws::String stringToSign = GenerateStringToSign(dateHeaderValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
- auto finalSignature = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
+ Aws::String signingRegion = region ? region : m_region;
+ Aws::String signingServiceName = serviceName ? serviceName : m_serviceName;
+ Aws::String stringToSign = GenerateStringToSign(dateHeaderValue, simpleDate, canonicalRequestHash, signingRegion, signingServiceName);
+ auto finalSignature = GenerateSignature(credentials, stringToSign, simpleDate, signingRegion, signingServiceName);
Aws::StringStream ss;
ss << AWS_HMAC_SHA256 << " " << CREDENTIAL << EQ << credentials.GetAWSAccessKeyId() << "/" << simpleDate
- << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST << ", " << SIGNED_HEADERS << EQ
+ << "/" << signingRegion << "/" << signingServiceName << "/" << AWS4_REQUEST << ", " << SIGNED_HEADERS << EQ
<< signedHeadersValue << ", " << SIGNATURE << EQ << HashingUtils::HexEncode(finalSignature);
auto awsAuthString = ss.str();
AWS_LOGSTREAM_DEBUG(v4StreamingLogTag, "Signing request with: " << awsAuthString);
request.SetAwsAuthorization(awsAuthString);
request.SetSigningAccessKey(credentials.GetAWSAccessKeyId());
- request.SetSigningRegion(signingRegion);
+ request.SetSigningRegion(signingRegion);
return true;
}
@@ -653,7 +653,7 @@ bool AWSAuthEventStreamV4Signer::SignEventMessage(Event::Message& message, Aws::
stringToSign << EVENT_STREAM_PAYLOAD << NEWLINE;
const DateTime now = GetSigningTimestamp();
const auto simpleDate = now.ToGmtString(SIMPLE_DATE_FORMAT_STR);
- stringToSign << now.ToGmtString(DateFormat::ISO_8601_BASIC) << NEWLINE
+ stringToSign << now.ToGmtString(DateFormat::ISO_8601_BASIC) << NEWLINE
<< simpleDate << "/" << m_region << "/"
<< m_serviceName << "/aws4_request" << NEWLINE << priorSignature << NEWLINE;
@@ -698,7 +698,7 @@ bool AWSAuthEventStreamV4Signer::SignEventMessage(Event::Message& message, Aws::
AWS_LOGSTREAM_DEBUG(v4StreamingLogTag, "Payload hash - " << HashingUtils::HexEncode(payloadHash));
}
- Utils::ByteBuffer finalSignatureDigest = GenerateSignature(m_credentialsProvider->GetAWSCredentials(), stringToSign.str(), simpleDate, m_region, m_serviceName);
+ Utils::ByteBuffer finalSignatureDigest = GenerateSignature(m_credentialsProvider->GetAWSCredentials(), stringToSign.str(), simpleDate, m_region, m_serviceName);
const auto finalSignature = HashingUtils::HexEncode(finalSignatureDigest);
AWS_LOGSTREAM_DEBUG(v4StreamingLogTag, "Final computed signing hash: " << finalSignature);
priorSignature = finalSignature;
@@ -716,7 +716,7 @@ bool AWSAuthEventStreamV4Signer::ShouldSignHeader(const Aws::String& header) con
}
Utils::ByteBuffer AWSAuthEventStreamV4Signer::GenerateSignature(const AWSCredentials& credentials, const Aws::String& stringToSign,
- const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const
+ const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const
{
Utils::Threading::ReaderLockGuard guard(m_derivedKeyLock);
const auto& secretKey = credentials.GetAWSSecretKey();
@@ -728,7 +728,7 @@ Utils::ByteBuffer AWSAuthEventStreamV4Signer::GenerateSignature(const AWSCredent
{
m_currentSecretKey = secretKey;
m_currentDateStr = simpleDate;
- m_derivedKey = ComputeHash(m_currentSecretKey, m_currentDateStr, region, serviceName);
+ m_derivedKey = ComputeHash(m_currentSecretKey, m_currentDateStr, region, serviceName);
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSignerProvider.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSignerProvider.cpp
index a981bc3536..31fd6c006b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSignerProvider.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSAuthSignerProvider.cpp
@@ -1,26 +1,26 @@
-/**
- * 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/utils/logging/LogMacros.h>
#include <aws/core/auth/AWSAuthSignerProvider.h>
#include <aws/core/auth/AWSAuthSigner.h>
-#include <aws/core/auth/AWSCredentialsProvider.h>
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
+#include <aws/core/auth/AWSCredentialsProvider.h>
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
const char CLASS_TAG[] = "AuthSignerProvider";
using namespace Aws::Auth;
-
-DefaultAuthSignerProvider::DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
- const Aws::String& serviceName, const Aws::String& region)
-{
- m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region));
- m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthEventStreamV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region));
- m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSNullSigner>(CLASS_TAG));
-}
-
+
+DefaultAuthSignerProvider::DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
+ const Aws::String& serviceName, const Aws::String& region)
+{
+ m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region));
+ m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSAuthEventStreamV4Signer>(CLASS_TAG, credentialsProvider, serviceName.c_str(), region));
+ m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSNullSigner>(CLASS_TAG));
+}
+
DefaultAuthSignerProvider::DefaultAuthSignerProvider(const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer)
{
m_signers.emplace_back(Aws::MakeShared<Aws::Client::AWSNullSigner>(CLASS_TAG));
@@ -43,9 +43,9 @@ std::shared_ptr<Aws::Client::AWSAuthSigner> DefaultAuthSignerProvider::GetSigner
assert(false);
return nullptr;
}
-
-void DefaultAuthSignerProvider::AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer)
-{
- assert(signer);
- m_signers.emplace_back(signer);
-}
+
+void DefaultAuthSignerProvider::AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer)
+{
+ assert(signer);
+ m_signers.emplace_back(signer);
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProvider.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProvider.cpp
index b4b4cae940..31e28b996f 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProvider.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProvider.cpp
@@ -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/auth/AWSCredentialsProvider.h>
@@ -14,9 +14,9 @@
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/FileSystemUtils.h>
-#include <aws/core/client/AWSError.h>
-#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/xml/XmlSerializer.h>
+#include <aws/core/client/AWSError.h>
+#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/xml/XmlSerializer.h>
#include <cstdlib>
#include <fstream>
#include <string.h>
@@ -28,8 +28,8 @@ using namespace Aws::Utils::Logging;
using namespace Aws::Auth;
using namespace Aws::Internal;
using namespace Aws::FileSystem;
-using namespace Aws::Utils::Xml;
-using namespace Aws::Client;
+using namespace Aws::Utils::Xml;
+using namespace Aws::Client;
using Aws::Utils::Threading::ReaderLockGuard;
using Aws::Utils::Threading::WriterLockGuard;
@@ -41,11 +41,11 @@ static const char AWS_PROFILE_ENV_VAR[] = "AWS_PROFILE";
static const char AWS_PROFILE_DEFAULT_ENV_VAR[] = "AWS_DEFAULT_PROFILE";
static const char AWS_CREDENTIALS_FILE[] = "AWS_SHARED_CREDENTIALS_FILE";
-extern const char AWS_CONFIG_FILE[] = "AWS_CONFIG_FILE";
+extern const char AWS_CONFIG_FILE[] = "AWS_CONFIG_FILE";
-extern const char PROFILE_DIRECTORY[] = ".aws";
+extern const char PROFILE_DIRECTORY[] = ".aws";
static const char DEFAULT_CREDENTIALS_FILE[] = "credentials";
-extern const char DEFAULT_CONFIG_FILE[] = "config";
+extern const char DEFAULT_CONFIG_FILE[] = "config";
static const int EXPIRATION_GRACE_PERIOD = 5 * 1000;
@@ -71,7 +71,7 @@ static const char* ENVIRONMENT_LOG_TAG = "EnvironmentAWSCredentialsProvider";
AWSCredentials EnvironmentAWSCredentialsProvider::GetAWSCredentials()
{
auto accessKey = Aws::Environment::GetEnv(ACCESS_KEY_ENV_VAR);
- AWSCredentials credentials;
+ AWSCredentials credentials;
if (!accessKey.empty())
{
@@ -107,41 +107,41 @@ Aws::String Aws::Auth::GetConfigProfileFilename()
}
else
{
- return Aws::FileSystem::GetHomeDirectory() + PROFILE_DIRECTORY + PATH_DELIM + DEFAULT_CONFIG_FILE;
+ return Aws::FileSystem::GetHomeDirectory() + PROFILE_DIRECTORY + PATH_DELIM + DEFAULT_CONFIG_FILE;
+ }
+}
+
+Aws::String Aws::Auth::GetConfigProfileName()
+{
+ auto profileFromVar = Aws::Environment::GetEnv(AWS_PROFILE_DEFAULT_ENV_VAR);
+ if (profileFromVar.empty())
+ {
+ profileFromVar = Aws::Environment::GetEnv(AWS_PROFILE_ENV_VAR);
+ }
+
+ if (profileFromVar.empty())
+ {
+ return Aws::String(DEFAULT_PROFILE);
+ }
+ else
+ {
+ return profileFromVar;
}
}
-Aws::String Aws::Auth::GetConfigProfileName()
-{
- auto profileFromVar = Aws::Environment::GetEnv(AWS_PROFILE_DEFAULT_ENV_VAR);
- if (profileFromVar.empty())
- {
- profileFromVar = Aws::Environment::GetEnv(AWS_PROFILE_ENV_VAR);
- }
-
- if (profileFromVar.empty())
- {
- return Aws::String(DEFAULT_PROFILE);
- }
- else
- {
- return profileFromVar;
- }
-}
-
static const char* PROFILE_LOG_TAG = "ProfileConfigFileAWSCredentialsProvider";
Aws::String ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename()
{
auto credentialsFileNameFromVar = Aws::Environment::GetEnv(AWS_CREDENTIALS_FILE);
- if (credentialsFileNameFromVar.empty())
+ if (credentialsFileNameFromVar.empty())
{
- return Aws::FileSystem::GetHomeDirectory() + PROFILE_DIRECTORY + PATH_DELIM + DEFAULT_CREDENTIALS_FILE;
+ return Aws::FileSystem::GetHomeDirectory() + PROFILE_DIRECTORY + PATH_DELIM + DEFAULT_CREDENTIALS_FILE;
}
else
{
- return credentialsFileNameFromVar;
+ return credentialsFileNameFromVar;
}
}
@@ -160,9 +160,9 @@ Aws::String ProfileConfigFileAWSCredentialsProvider::GetProfileDirectory()
}
ProfileConfigFileAWSCredentialsProvider::ProfileConfigFileAWSCredentialsProvider(long refreshRateMs) :
- m_profileToUse(Aws::Auth::GetConfigProfileName()),
- m_credentialsFileLoader(GetCredentialsProfileFilename()),
- m_loadFrequencyMs(refreshRateMs)
+ m_profileToUse(Aws::Auth::GetConfigProfileName()),
+ m_credentialsFileLoader(GetCredentialsProfileFilename()),
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(PROFILE_LOG_TAG, "Setting provider to read credentials from " << GetCredentialsProfileFilename() << " for credentials file"
<< " and " << GetConfigProfileFilename() << " for the config file "
@@ -170,9 +170,9 @@ ProfileConfigFileAWSCredentialsProvider::ProfileConfigFileAWSCredentialsProvider
}
ProfileConfigFileAWSCredentialsProvider::ProfileConfigFileAWSCredentialsProvider(const char* profile, long refreshRateMs) :
- m_profileToUse(profile),
- m_credentialsFileLoader(GetCredentialsProfileFilename()),
- m_loadFrequencyMs(refreshRateMs)
+ m_profileToUse(profile),
+ m_credentialsFileLoader(GetCredentialsProfileFilename()),
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(PROFILE_LOG_TAG, "Setting provider to read credentials from " << GetCredentialsProfileFilename() << " for credentials file"
<< " and " << GetConfigProfileFilename() << " for the config file "
@@ -196,7 +196,7 @@ AWSCredentials ProfileConfigFileAWSCredentialsProvider::GetAWSCredentials()
void ProfileConfigFileAWSCredentialsProvider::Reload()
{
- m_credentialsFileLoader.Load();
+ m_credentialsFileLoader.Load();
AWSCredentialsProvider::Reload();
}
@@ -220,16 +220,16 @@ void ProfileConfigFileAWSCredentialsProvider::RefreshIfExpired()
static const char* INSTANCE_LOG_TAG = "InstanceProfileCredentialsProvider";
InstanceProfileCredentialsProvider::InstanceProfileCredentialsProvider(long refreshRateMs) :
- m_ec2MetadataConfigLoader(Aws::MakeShared<Aws::Config::EC2InstanceProfileConfigLoader>(INSTANCE_LOG_TAG)),
- m_loadFrequencyMs(refreshRateMs)
+ m_ec2MetadataConfigLoader(Aws::MakeShared<Aws::Config::EC2InstanceProfileConfigLoader>(INSTANCE_LOG_TAG)),
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(INSTANCE_LOG_TAG, "Creating Instance with default EC2MetadataClient and refresh rate " << refreshRateMs);
}
-InstanceProfileCredentialsProvider::InstanceProfileCredentialsProvider(const std::shared_ptr<Aws::Config::EC2InstanceProfileConfigLoader>& loader, long refreshRateMs) :
- m_ec2MetadataConfigLoader(loader),
- m_loadFrequencyMs(refreshRateMs)
+InstanceProfileCredentialsProvider::InstanceProfileCredentialsProvider(const std::shared_ptr<Aws::Config::EC2InstanceProfileConfigLoader>& loader, long refreshRateMs) :
+ m_ec2MetadataConfigLoader(loader),
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(INSTANCE_LOG_TAG, "Creating Instance with injected EC2MetadataClient and refresh rate " << refreshRateMs);
}
@@ -268,7 +268,7 @@ void InstanceProfileCredentialsProvider::RefreshIfExpired()
guard.UpgradeToWriterLock();
if (!IsTimeToRefresh(m_loadFrequencyMs)) // double-checked lock to avoid refreshing twice
{
- return;
+ return;
}
Reload();
}
@@ -277,14 +277,14 @@ static const char TASK_ROLE_LOG_TAG[] = "TaskRoleCredentialsProvider";
TaskRoleCredentialsProvider::TaskRoleCredentialsProvider(const char* URI, long refreshRateMs) :
m_ecsCredentialsClient(Aws::MakeShared<Aws::Internal::ECSCredentialsClient>(TASK_ROLE_LOG_TAG, URI)),
- m_loadFrequencyMs(refreshRateMs)
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(TASK_ROLE_LOG_TAG, "Creating TaskRole with default ECSCredentialsClient and refresh rate " << refreshRateMs);
}
TaskRoleCredentialsProvider::TaskRoleCredentialsProvider(const char* endpoint, const char* token, long refreshRateMs) :
- m_ecsCredentialsClient(Aws::MakeShared<Aws::Internal::ECSCredentialsClient>(TASK_ROLE_LOG_TAG, ""/*resourcePath*/, endpoint, token)),
- m_loadFrequencyMs(refreshRateMs)
+ m_ecsCredentialsClient(Aws::MakeShared<Aws::Internal::ECSCredentialsClient>(TASK_ROLE_LOG_TAG, ""/*resourcePath*/, endpoint, token)),
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(TASK_ROLE_LOG_TAG, "Creating TaskRole with default ECSCredentialsClient and refresh rate " << refreshRateMs);
}
@@ -292,7 +292,7 @@ TaskRoleCredentialsProvider::TaskRoleCredentialsProvider(const char* endpoint, c
TaskRoleCredentialsProvider::TaskRoleCredentialsProvider(
const std::shared_ptr<Aws::Internal::ECSCredentialsClient>& client, long refreshRateMs) :
m_ecsCredentialsClient(client),
- m_loadFrequencyMs(refreshRateMs)
+ m_loadFrequencyMs(refreshRateMs)
{
AWS_LOGSTREAM_INFO(TASK_ROLE_LOG_TAG, "Creating TaskRole with default ECSCredentialsClient and refresh rate " << refreshRateMs);
}
@@ -306,7 +306,7 @@ AWSCredentials TaskRoleCredentialsProvider::GetAWSCredentials()
bool TaskRoleCredentialsProvider::ExpiresSoon() const
{
- return ((m_credentials.GetExpiration() - Aws::Utils::DateTime::Now()).count() < EXPIRATION_GRACE_PERIOD);
+ return ((m_credentials.GetExpiration() - Aws::Utils::DateTime::Now()).count() < EXPIRATION_GRACE_PERIOD);
}
void TaskRoleCredentialsProvider::Reload()
@@ -317,9 +317,9 @@ void TaskRoleCredentialsProvider::Reload()
if (credentialsStr.empty()) return;
Json::JsonValue credentialsDoc(credentialsStr);
- if (!credentialsDoc.WasParseSuccessful())
+ if (!credentialsDoc.WasParseSuccessful())
{
- AWS_LOGSTREAM_ERROR(TASK_ROLE_LOG_TAG, "Failed to parse output from ECSCredentialService.");
+ AWS_LOGSTREAM_ERROR(TASK_ROLE_LOG_TAG, "Failed to parse output from ECSCredentialService.");
return;
}
@@ -333,7 +333,7 @@ void TaskRoleCredentialsProvider::Reload()
m_credentials.SetAWSAccessKeyId(accessKey);
m_credentials.SetAWSSecretKey(secretKey);
m_credentials.SetSessionToken(token);
- m_credentials.SetExpiration(Aws::Utils::DateTime(credentialsView.GetString("Expiration"), DateFormat::ISO_8601));
+ m_credentials.SetExpiration(Aws::Utils::DateTime(credentialsView.GetString("Expiration"), DateFormat::ISO_8601));
AWSCredentialsProvider::Reload();
}
@@ -341,14 +341,14 @@ void TaskRoleCredentialsProvider::RefreshIfExpired()
{
AWS_LOGSTREAM_DEBUG(TASK_ROLE_LOG_TAG, "Checking if latest credential pull has expired.");
ReaderLockGuard guard(m_reloadLock);
- if (!m_credentials.IsEmpty() && !IsTimeToRefresh(m_loadFrequencyMs) && !ExpiresSoon())
+ if (!m_credentials.IsEmpty() && !IsTimeToRefresh(m_loadFrequencyMs) && !ExpiresSoon())
{
return;
}
guard.UpgradeToWriterLock();
- if (!m_credentials.IsEmpty() && !IsTimeToRefresh(m_loadFrequencyMs) && !ExpiresSoon())
+ if (!m_credentials.IsEmpty() && !IsTimeToRefresh(m_loadFrequencyMs) && !ExpiresSoon())
{
return;
}
@@ -358,13 +358,13 @@ void TaskRoleCredentialsProvider::RefreshIfExpired()
static const char PROCESS_LOG_TAG[] = "ProcessCredentialsProvider";
ProcessCredentialsProvider::ProcessCredentialsProvider() :
- m_profileToUse(Aws::Auth::GetConfigProfileName())
+ m_profileToUse(Aws::Auth::GetConfigProfileName())
{
AWS_LOGSTREAM_INFO(PROCESS_LOG_TAG, "Setting process credentials provider to read config from " << m_profileToUse);
}
ProcessCredentialsProvider::ProcessCredentialsProvider(const Aws::String& profile) :
- m_profileToUse(profile)
+ m_profileToUse(profile)
{
AWS_LOGSTREAM_INFO(PROCESS_LOG_TAG, "Setting process credentials provider to read config from " << m_profileToUse);
}
@@ -379,88 +379,88 @@ AWSCredentials ProcessCredentialsProvider::GetAWSCredentials()
void ProcessCredentialsProvider::Reload()
{
- auto profile = Aws::Config::GetCachedConfigProfile(m_profileToUse);
- const Aws::String &command = profile.GetCredentialProcess();
- if (command.empty())
+ auto profile = Aws::Config::GetCachedConfigProfile(m_profileToUse);
+ const Aws::String &command = profile.GetCredentialProcess();
+ if (command.empty())
{
AWS_LOGSTREAM_ERROR(PROCESS_LOG_TAG, "Failed to find credential process's profile: " << m_profileToUse);
return;
}
- m_credentials = GetCredentialsFromProcess(command);
-}
-
-void ProcessCredentialsProvider::RefreshIfExpired()
-{
- ReaderLockGuard guard(m_reloadLock);
- if (!m_credentials.IsExpiredOrEmpty())
- {
- return;
- }
-
- guard.UpgradeToWriterLock();
- if (!m_credentials.IsExpiredOrEmpty()) // double-checked lock to avoid refreshing twice
- {
- return;
- }
-
- Reload();
-}
-
-AWSCredentials Aws::Auth::GetCredentialsFromProcess(const Aws::String& process)
-{
- Aws::String command = process;
+ m_credentials = GetCredentialsFromProcess(command);
+}
+
+void ProcessCredentialsProvider::RefreshIfExpired()
+{
+ ReaderLockGuard guard(m_reloadLock);
+ if (!m_credentials.IsExpiredOrEmpty())
+ {
+ return;
+ }
+
+ guard.UpgradeToWriterLock();
+ if (!m_credentials.IsExpiredOrEmpty()) // double-checked lock to avoid refreshing twice
+ {
+ return;
+ }
+
+ Reload();
+}
+
+AWSCredentials Aws::Auth::GetCredentialsFromProcess(const Aws::String& process)
+{
+ Aws::String command = process;
command.append(" 2>&1"); // redirect stderr to stdout
Aws::String result = Aws::Utils::StringUtils::Trim(Aws::OSVersionInfo::GetSysCommandOutput(command.c_str()).c_str());
Json::JsonValue credentialsDoc(result);
- if (!credentialsDoc.WasParseSuccessful())
+ if (!credentialsDoc.WasParseSuccessful())
{
- AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Failed to load credential from running: " << command << " Error: " << result);
- return {};
+ AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Failed to load credential from running: " << command << " Error: " << result);
+ return {};
}
Aws::Utils::Json::JsonView credentialsView(credentialsDoc);
if (!credentialsView.KeyExists("Version") || credentialsView.GetInteger("Version") != 1)
{
- AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Encountered an unsupported process credentials payload version:" << credentialsView.GetInteger("Version"));
- return {};
+ AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Encountered an unsupported process credentials payload version:" << credentialsView.GetInteger("Version"));
+ return {};
}
- AWSCredentials credentials;
+ AWSCredentials credentials;
Aws::String accessKey, secretKey, token, expire;
- if (credentialsView.KeyExists("AccessKeyId"))
- {
- credentials.SetAWSAccessKeyId(credentialsView.GetString("AccessKeyId"));
- }
+ if (credentialsView.KeyExists("AccessKeyId"))
+ {
+ credentials.SetAWSAccessKeyId(credentialsView.GetString("AccessKeyId"));
+ }
- if (credentialsView.KeyExists("SecretAccessKey"))
- {
- credentials.SetAWSSecretKey(credentialsView.GetString("SecretAccessKey"));
- }
+ if (credentialsView.KeyExists("SecretAccessKey"))
+ {
+ credentials.SetAWSSecretKey(credentialsView.GetString("SecretAccessKey"));
+ }
- if (credentialsView.KeyExists("SessionToken"))
+ if (credentialsView.KeyExists("SessionToken"))
{
- credentials.SetSessionToken(credentialsView.GetString("SessionToken"));
+ credentials.SetSessionToken(credentialsView.GetString("SessionToken"));
}
- if (credentialsView.KeyExists("Expiration"))
+ if (credentialsView.KeyExists("Expiration"))
{
- const auto expiration = Aws::Utils::DateTime(credentialsView.GetString("Expiration"), DateFormat::ISO_8601);
- if (expiration.WasParseSuccessful())
- {
- credentials.SetExpiration(expiration);
- }
- else
- {
- AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Failed to parse credential's expiration value as an ISO 8601 Date. Credentials will be marked expired.");
- credentials.SetExpiration(Aws::Utils::DateTime::Now());
- }
+ const auto expiration = Aws::Utils::DateTime(credentialsView.GetString("Expiration"), DateFormat::ISO_8601);
+ if (expiration.WasParseSuccessful())
+ {
+ credentials.SetExpiration(expiration);
+ }
+ else
+ {
+ AWS_LOGSTREAM_ERROR(PROFILE_LOG_TAG, "Failed to parse credential's expiration value as an ISO 8601 Date. Credentials will be marked expired.");
+ credentials.SetExpiration(Aws::Utils::DateTime::Now());
+ }
+ }
+ else
+ {
+ credentials.SetExpiration((std::chrono::time_point<std::chrono::system_clock>::max)());
}
- else
- {
- credentials.SetExpiration((std::chrono::time_point<std::chrono::system_clock>::max)());
- }
- AWS_LOGSTREAM_DEBUG(PROFILE_LOG_TAG, "Successfully pulled credentials from process credential with AccessKey: " << accessKey << ", Expiration:" << credentialsView.GetString("Expiration"));
- return credentials;
+ AWS_LOGSTREAM_DEBUG(PROFILE_LOG_TAG, "Successfully pulled credentials from process credential with AccessKey: " << accessKey << ", Expiration:" << credentialsView.GetString("Expiration"));
+ return credentials;
}
-
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProviderChain.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProviderChain.cpp
index 999928c8f6..373136d96a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProviderChain.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/AWSCredentialsProviderChain.cpp
@@ -1,10 +1,10 @@
-/**
- * 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/auth/AWSCredentialsProviderChain.h>
-#include <aws/core/auth/STSCredentialsProvider.h>
+#include <aws/core/auth/STSCredentialsProvider.h>
#include <aws/core/platform/Environment.h>
#include <aws/core/utils/memory/AWSMemory.h>
#include <aws/core/utils/StringUtils.h>
@@ -20,7 +20,7 @@ static const char DefaultCredentialsProviderChainTag[] = "DefaultAWSCredentialsP
AWSCredentials AWSCredentialsProviderChain::GetAWSCredentials()
{
- for (auto&& credentialsProvider : m_providerChain)
+ for (auto&& credentialsProvider : m_providerChain)
{
AWSCredentials credentials = credentialsProvider->GetAWSCredentials();
if (!credentials.GetAWSAccessKeyId().empty() && !credentials.GetAWSSecretKey().empty())
@@ -29,16 +29,16 @@ AWSCredentials AWSCredentialsProviderChain::GetAWSCredentials()
}
}
- return AWSCredentials();
+ return AWSCredentials();
}
DefaultAWSCredentialsProviderChain::DefaultAWSCredentialsProviderChain() : AWSCredentialsProviderChain()
{
AddProvider(Aws::MakeShared<EnvironmentAWSCredentialsProvider>(DefaultCredentialsProviderChainTag));
AddProvider(Aws::MakeShared<ProfileConfigFileAWSCredentialsProvider>(DefaultCredentialsProviderChainTag));
- AddProvider(Aws::MakeShared<ProcessCredentialsProvider>(DefaultCredentialsProviderChainTag));
- AddProvider(Aws::MakeShared<STSAssumeRoleWebIdentityCredentialsProvider>(DefaultCredentialsProviderChainTag));
-
+ AddProvider(Aws::MakeShared<ProcessCredentialsProvider>(DefaultCredentialsProviderChainTag));
+ AddProvider(Aws::MakeShared<STSAssumeRoleWebIdentityCredentialsProvider>(DefaultCredentialsProviderChainTag));
+
//ECS TaskRole Credentials only available when ENVIRONMENT VARIABLE is set
const auto relativeUri = Aws::Environment::GetEnv(AWS_ECS_CONTAINER_CREDENTIALS_RELATIVE_URI);
AWS_LOGSTREAM_DEBUG(DefaultCredentialsProviderChainTag, "The environment variable value " << AWS_ECS_CONTAINER_CREDENTIALS_RELATIVE_URI
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/STSCredentialsProvider.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/STSCredentialsProvider.cpp
index c8d2bb98e8..3f48c9e0c7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/STSCredentialsProvider.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/auth/STSCredentialsProvider.cpp
@@ -1,163 +1,163 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-
-
-#include <aws/core/auth/STSCredentialsProvider.h>
-#include <aws/core/config/AWSProfileConfigLoader.h>
-#include <aws/core/platform/Environment.h>
-#include <aws/core/platform/FileSystem.h>
-#include <aws/core/utils/logging/LogMacros.h>
-#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/FileSystemUtils.h>
-#include <aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h>
-#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/UUID.h>
-#include <cstdlib>
-#include <fstream>
-#include <string.h>
-#include <climits>
-
-
-using namespace Aws::Utils;
-using namespace Aws::Utils::Logging;
-using namespace Aws::Auth;
-using namespace Aws::Internal;
-using namespace Aws::FileSystem;
-using namespace Aws::Client;
-using Aws::Utils::Threading::ReaderLockGuard;
-using Aws::Utils::Threading::WriterLockGuard;
-
-static const char STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG[] = "STSAssumeRoleWithWebIdentityCredentialsProvider";
-STSAssumeRoleWebIdentityCredentialsProvider::STSAssumeRoleWebIdentityCredentialsProvider() :
- m_initialized(false)
-{
- // check environment variables
- Aws::String tmpRegion = Aws::Environment::GetEnv("AWS_DEFAULT_REGION");
- m_roleArn = Aws::Environment::GetEnv("AWS_ROLE_ARN");
- m_tokenFile = Aws::Environment::GetEnv("AWS_WEB_IDENTITY_TOKEN_FILE");
- m_sessionName = Aws::Environment::GetEnv("AWS_ROLE_SESSION_NAME");
-
- // check profile_config if either m_roleArn or m_tokenFile is not loaded from environment variable
- // region source is not enforced, but we need it to construct sts endpoint, if we can't find from environment, we should check if it's set in config file.
- if (m_roleArn.empty() || m_tokenFile.empty() || tmpRegion.empty())
- {
- auto profile = Aws::Config::GetCachedConfigProfile(Aws::Auth::GetConfigProfileName());
- if (tmpRegion.empty())
- {
- tmpRegion = profile.GetRegion();
- }
- // If either of these two were not found from environment, use whatever found for all three in config file
- if (m_roleArn.empty() || m_tokenFile.empty())
- {
- m_roleArn = profile.GetRoleArn();
- m_tokenFile = profile.GetValue("web_identity_token_file");
- m_sessionName = profile.GetValue("role_session_name");
- }
- }
-
- if (m_tokenFile.empty())
- {
- AWS_LOGSTREAM_WARN(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Token file must be specified to use STS AssumeRole web identity creds provider.");
- return; // No need to do further constructing
- }
- else
- {
- AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved token_file from profile_config or environment variable to be " << m_tokenFile);
- }
-
- if (m_roleArn.empty())
- {
- AWS_LOGSTREAM_WARN(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "RoleArn must be specified to use STS AssumeRole web identity creds provider.");
- return; // No need to do further constructing
- }
- else
- {
- AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved role_arn from profile_config or environment variable to be " << m_roleArn);
- }
-
- if (tmpRegion.empty())
- {
- tmpRegion = Aws::Region::US_EAST_1;
- }
- else
- {
- AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved region from profile_config or environment variable to be " << tmpRegion);
- }
-
- if (m_sessionName.empty())
- {
- m_sessionName = Aws::Utils::UUID::RandomUUID();
- }
- else
- {
- AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved session_name from profile_config or environment variable to be " << m_sessionName);
- }
-
- Aws::Client::ClientConfiguration config;
- config.scheme = Aws::Http::Scheme::HTTPS;
- config.region = tmpRegion;
-
- Aws::Vector<Aws::String> retryableErrors;
- retryableErrors.push_back("IDPCommunicationError");
- retryableErrors.push_back("InvalidIdentityToken");
-
- config.retryStrategy = Aws::MakeShared<SpecifiedRetryableErrorsRetryStrategy>(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, retryableErrors, 3/*maxRetries*/);
-
- m_client = Aws::MakeUnique<Aws::Internal::STSCredentialsClient>(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, config);
- m_initialized = true;
- AWS_LOGSTREAM_INFO(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Creating STS AssumeRole with web identity creds provider.");
-}
-
-AWSCredentials STSAssumeRoleWebIdentityCredentialsProvider::GetAWSCredentials()
-{
- // A valid client means required information like role arn and token file were constructed correctly.
- // We can use this provider to load creds, otherwise, we can just return empty creds.
- if (!m_initialized)
- {
- return Aws::Auth::AWSCredentials();
- }
- RefreshIfExpired();
- ReaderLockGuard guard(m_reloadLock);
- return m_credentials;
-}
-
-void STSAssumeRoleWebIdentityCredentialsProvider::Reload()
-{
- AWS_LOGSTREAM_INFO(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Credentials have expired, attempting to renew from STS.");
-
- Aws::IFStream tokenFile(m_tokenFile.c_str());
- if(tokenFile)
- {
- Aws::String token((std::istreambuf_iterator<char>(tokenFile)), std::istreambuf_iterator<char>());
- m_token = token;
- }
- else
- {
- AWS_LOGSTREAM_ERROR(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Can't open token file: " << m_tokenFile);
- return;
- }
- STSCredentialsClient::STSAssumeRoleWithWebIdentityRequest request {m_sessionName, m_roleArn, m_token};
-
- auto result = m_client->GetAssumeRoleWithWebIdentityCredentials(request);
- AWS_LOGSTREAM_TRACE(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Successfully retrieved credentials with AWS_ACCESS_KEY: " << result.creds.GetAWSAccessKeyId());
- m_credentials = result.creds;
-}
-
-void STSAssumeRoleWebIdentityCredentialsProvider::RefreshIfExpired()
-{
- ReaderLockGuard guard(m_reloadLock);
- if (!m_credentials.IsExpiredOrEmpty())
- {
- return;
- }
-
- guard.UpgradeToWriterLock();
- if (!m_credentials.IsExpiredOrEmpty()) // double-checked lock to avoid refreshing twice
- {
- return;
- }
-
- Reload();
-}
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+
+#include <aws/core/auth/STSCredentialsProvider.h>
+#include <aws/core/config/AWSProfileConfigLoader.h>
+#include <aws/core/platform/Environment.h>
+#include <aws/core/platform/FileSystem.h>
+#include <aws/core/utils/logging/LogMacros.h>
+#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/FileSystemUtils.h>
+#include <aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h>
+#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/UUID.h>
+#include <cstdlib>
+#include <fstream>
+#include <string.h>
+#include <climits>
+
+
+using namespace Aws::Utils;
+using namespace Aws::Utils::Logging;
+using namespace Aws::Auth;
+using namespace Aws::Internal;
+using namespace Aws::FileSystem;
+using namespace Aws::Client;
+using Aws::Utils::Threading::ReaderLockGuard;
+using Aws::Utils::Threading::WriterLockGuard;
+
+static const char STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG[] = "STSAssumeRoleWithWebIdentityCredentialsProvider";
+STSAssumeRoleWebIdentityCredentialsProvider::STSAssumeRoleWebIdentityCredentialsProvider() :
+ m_initialized(false)
+{
+ // check environment variables
+ Aws::String tmpRegion = Aws::Environment::GetEnv("AWS_DEFAULT_REGION");
+ m_roleArn = Aws::Environment::GetEnv("AWS_ROLE_ARN");
+ m_tokenFile = Aws::Environment::GetEnv("AWS_WEB_IDENTITY_TOKEN_FILE");
+ m_sessionName = Aws::Environment::GetEnv("AWS_ROLE_SESSION_NAME");
+
+ // check profile_config if either m_roleArn or m_tokenFile is not loaded from environment variable
+ // region source is not enforced, but we need it to construct sts endpoint, if we can't find from environment, we should check if it's set in config file.
+ if (m_roleArn.empty() || m_tokenFile.empty() || tmpRegion.empty())
+ {
+ auto profile = Aws::Config::GetCachedConfigProfile(Aws::Auth::GetConfigProfileName());
+ if (tmpRegion.empty())
+ {
+ tmpRegion = profile.GetRegion();
+ }
+ // If either of these two were not found from environment, use whatever found for all three in config file
+ if (m_roleArn.empty() || m_tokenFile.empty())
+ {
+ m_roleArn = profile.GetRoleArn();
+ m_tokenFile = profile.GetValue("web_identity_token_file");
+ m_sessionName = profile.GetValue("role_session_name");
+ }
+ }
+
+ if (m_tokenFile.empty())
+ {
+ AWS_LOGSTREAM_WARN(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Token file must be specified to use STS AssumeRole web identity creds provider.");
+ return; // No need to do further constructing
+ }
+ else
+ {
+ AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved token_file from profile_config or environment variable to be " << m_tokenFile);
+ }
+
+ if (m_roleArn.empty())
+ {
+ AWS_LOGSTREAM_WARN(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "RoleArn must be specified to use STS AssumeRole web identity creds provider.");
+ return; // No need to do further constructing
+ }
+ else
+ {
+ AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved role_arn from profile_config or environment variable to be " << m_roleArn);
+ }
+
+ if (tmpRegion.empty())
+ {
+ tmpRegion = Aws::Region::US_EAST_1;
+ }
+ else
+ {
+ AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved region from profile_config or environment variable to be " << tmpRegion);
+ }
+
+ if (m_sessionName.empty())
+ {
+ m_sessionName = Aws::Utils::UUID::RandomUUID();
+ }
+ else
+ {
+ AWS_LOGSTREAM_DEBUG(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Resolved session_name from profile_config or environment variable to be " << m_sessionName);
+ }
+
+ Aws::Client::ClientConfiguration config;
+ config.scheme = Aws::Http::Scheme::HTTPS;
+ config.region = tmpRegion;
+
+ Aws::Vector<Aws::String> retryableErrors;
+ retryableErrors.push_back("IDPCommunicationError");
+ retryableErrors.push_back("InvalidIdentityToken");
+
+ config.retryStrategy = Aws::MakeShared<SpecifiedRetryableErrorsRetryStrategy>(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, retryableErrors, 3/*maxRetries*/);
+
+ m_client = Aws::MakeUnique<Aws::Internal::STSCredentialsClient>(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, config);
+ m_initialized = true;
+ AWS_LOGSTREAM_INFO(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Creating STS AssumeRole with web identity creds provider.");
+}
+
+AWSCredentials STSAssumeRoleWebIdentityCredentialsProvider::GetAWSCredentials()
+{
+ // A valid client means required information like role arn and token file were constructed correctly.
+ // We can use this provider to load creds, otherwise, we can just return empty creds.
+ if (!m_initialized)
+ {
+ return Aws::Auth::AWSCredentials();
+ }
+ RefreshIfExpired();
+ ReaderLockGuard guard(m_reloadLock);
+ return m_credentials;
+}
+
+void STSAssumeRoleWebIdentityCredentialsProvider::Reload()
+{
+ AWS_LOGSTREAM_INFO(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Credentials have expired, attempting to renew from STS.");
+
+ Aws::IFStream tokenFile(m_tokenFile.c_str());
+ if(tokenFile)
+ {
+ Aws::String token((std::istreambuf_iterator<char>(tokenFile)), std::istreambuf_iterator<char>());
+ m_token = token;
+ }
+ else
+ {
+ AWS_LOGSTREAM_ERROR(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Can't open token file: " << m_tokenFile);
+ return;
+ }
+ STSCredentialsClient::STSAssumeRoleWithWebIdentityRequest request {m_sessionName, m_roleArn, m_token};
+
+ auto result = m_client->GetAssumeRoleWithWebIdentityCredentials(request);
+ AWS_LOGSTREAM_TRACE(STS_ASSUME_ROLE_WEB_IDENTITY_LOG_TAG, "Successfully retrieved credentials with AWS_ACCESS_KEY: " << result.creds.GetAWSAccessKeyId());
+ m_credentials = result.creds;
+}
+
+void STSAssumeRoleWebIdentityCredentialsProvider::RefreshIfExpired()
+{
+ ReaderLockGuard guard(m_reloadLock);
+ if (!m_credentials.IsExpiredOrEmpty())
+ {
+ return;
+ }
+
+ guard.UpgradeToWriterLock();
+ if (!m_credentials.IsExpiredOrEmpty()) // double-checked lock to avoid refreshing twice
+ {
+ return;
+ }
+
+ Reload();
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp
index 8fa8421b49..e1ff064840 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp
@@ -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.
*/
#include <aws/core/client/AWSClient.h>
@@ -16,7 +16,7 @@
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/standard/StandardHttpResponse.h>
-#include <aws/core/http/URI.h>
+#include <aws/core/http/URI.h>
#include <aws/core/utils/stream/ResponseStream.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/Outcome.h>
@@ -29,13 +29,13 @@
#include <aws/core/utils/crypto/MD5.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/crypto/Factories.h>
-#include <aws/core/utils/event/EventStream.h>
-#include <aws/core/utils/UUID.h>
+#include <aws/core/utils/event/EventStream.h>
+#include <aws/core/utils/UUID.h>
#include <aws/core/monitoring/MonitoringManager.h>
-#include <aws/core/Region.h>
-#include <aws/core/utils/DNS.h>
-#include <aws/core/Version.h>
-#include <aws/core/platform/OSVersionInfo.h>
+#include <aws/core/Region.h>
+#include <aws/core/utils/DNS.h>
+#include <aws/core/Version.h>
+#include <aws/core/platform/OSVersionInfo.h>
#include <cstring>
#include <cassert>
@@ -52,7 +52,7 @@ static const int SUCCESS_RESPONSE_MAX = 299;
static const char AWS_CLIENT_LOG_TAG[] = "AWSClient";
//4 Minutes
-static const std::chrono::milliseconds TIME_DIFF_MAX = std::chrono::minutes(4);
+static const std::chrono::milliseconds TIME_DIFF_MAX = std::chrono::minutes(4);
//-4 Minutes
static const std::chrono::milliseconds TIME_DIFF_MIN = std::chrono::minutes(-4);
@@ -67,36 +67,36 @@ static CoreErrors GuessBodylessErrorType(Aws::Http::HttpResponseCode responseCod
return CoreErrors::RESOURCE_NOT_FOUND;
default:
return CoreErrors::UNKNOWN;
- }
+ }
}
-struct RequestInfo
-{
- Aws::Utils::DateTime ttl;
- long attempt;
- long maxAttempts;
-
- operator String()
- {
- Aws::StringStream ss;
- if (ttl.WasParseSuccessful() && ttl != DateTime())
- {
- assert(attempt > 1);
- ss << "ttl=" << ttl.ToGmtString(DateFormat::ISO_8601_BASIC) << "; ";
- }
- ss << "attempt=" << attempt;
- if (maxAttempts > 0)
- {
- ss << "; max=" << maxAttempts;
- }
- return ss.str();
- }
-};
-
+struct RequestInfo
+{
+ Aws::Utils::DateTime ttl;
+ long attempt;
+ long maxAttempts;
+
+ operator String()
+ {
+ Aws::StringStream ss;
+ if (ttl.WasParseSuccessful() && ttl != DateTime())
+ {
+ assert(attempt > 1);
+ ss << "ttl=" << ttl.ToGmtString(DateFormat::ISO_8601_BASIC) << "; ";
+ }
+ ss << "attempt=" << attempt;
+ if (maxAttempts > 0)
+ {
+ ss << "; max=" << maxAttempts;
+ }
+ return ss.str();
+ }
+};
+
AWSClient::AWSClient(const Aws::Client::ClientConfiguration& configuration,
const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller) :
- m_region(configuration.region),
+ m_region(configuration.region),
m_httpClient(CreateHttpClient(configuration)),
m_signerProvider(Aws::MakeUnique<Aws::Auth::DefaultAuthSignerProvider>(AWS_CLIENT_LOG_TAG, signer)),
m_errorMarshaller(errorMarshaller),
@@ -104,18 +104,18 @@ AWSClient::AWSClient(const Aws::Client::ClientConfiguration& configuration,
m_writeRateLimiter(configuration.writeRateLimiter),
m_readRateLimiter(configuration.readRateLimiter),
m_userAgent(configuration.userAgent),
- m_customizedUserAgent(!m_userAgent.empty()),
+ m_customizedUserAgent(!m_userAgent.empty()),
m_hash(Aws::Utils::Crypto::CreateMD5Implementation()),
- m_requestTimeoutMs(configuration.requestTimeoutMs),
+ m_requestTimeoutMs(configuration.requestTimeoutMs),
m_enableClockSkewAdjustment(configuration.enableClockSkewAdjustment)
{
- SetServiceClientName("AWSBaseClient");
+ SetServiceClientName("AWSBaseClient");
}
AWSClient::AWSClient(const Aws::Client::ClientConfiguration& configuration,
const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller) :
- m_region(configuration.region),
+ m_region(configuration.region),
m_httpClient(CreateHttpClient(configuration)),
m_signerProvider(signerProvider),
m_errorMarshaller(errorMarshaller),
@@ -123,33 +123,33 @@ AWSClient::AWSClient(const Aws::Client::ClientConfiguration& configuration,
m_writeRateLimiter(configuration.writeRateLimiter),
m_readRateLimiter(configuration.readRateLimiter),
m_userAgent(configuration.userAgent),
- m_customizedUserAgent(!m_userAgent.empty()),
+ m_customizedUserAgent(!m_userAgent.empty()),
m_hash(Aws::Utils::Crypto::CreateMD5Implementation()),
- m_requestTimeoutMs(configuration.requestTimeoutMs),
+ m_requestTimeoutMs(configuration.requestTimeoutMs),
m_enableClockSkewAdjustment(configuration.enableClockSkewAdjustment)
{
- SetServiceClientName("AWSBaseClient");
+ SetServiceClientName("AWSBaseClient");
+}
+
+void AWSClient::SetServiceClientName(const Aws::String& name)
+{
+ m_serviceName = name;
+ if (!m_customizedUserAgent)
+ {
+ Aws::StringStream ss;
+ ss << "aws-sdk-cpp/" << Version::GetVersionString() << "/" << m_serviceName << "/" << Aws::OSVersionInfo::ComputeOSVersionString()
+ << " " << Version::GetCompilerVersionString();
+ m_userAgent = ss.str();
+ }
}
-void AWSClient::SetServiceClientName(const Aws::String& name)
-{
- m_serviceName = name;
- if (!m_customizedUserAgent)
- {
- Aws::StringStream ss;
- ss << "aws-sdk-cpp/" << Version::GetVersionString() << "/" << m_serviceName << "/" << Aws::OSVersionInfo::ComputeOSVersionString()
- << " " << Version::GetCompilerVersionString();
- m_userAgent = ss.str();
- }
+void AWSClient::DisableRequestProcessing()
+{
+ m_httpClient->DisableRequestProcessing();
}
-void AWSClient::DisableRequestProcessing()
-{
- m_httpClient->DisableRequestProcessing();
-}
-
-void AWSClient::EnableRequestProcessing()
-{
+void AWSClient::EnableRequestProcessing()
+{
m_httpClient->EnableRequestProcessing();
}
@@ -159,34 +159,34 @@ Aws::Client::AWSAuthSigner* AWSClient::GetSignerByName(const char* name) const
return signer ? signer.get() : nullptr;
}
-static DateTime GetServerTimeFromError(const AWSError<CoreErrors> error)
-{
- const Http::HeaderValueCollection& headers = error.GetResponseHeaders();
- auto awsDateHeaderIter = headers.find(StringUtils::ToLower(Http::AWS_DATE_HEADER));
- auto dateHeaderIter = headers.find(StringUtils::ToLower(Http::DATE_HEADER));
- if (awsDateHeaderIter != headers.end())
- {
- return DateTime(awsDateHeaderIter->second.c_str(), DateFormat::AutoDetect);
- }
- else if (dateHeaderIter != headers.end())
- {
- return DateTime(dateHeaderIter->second.c_str(), DateFormat::AutoDetect);
- }
- else
- {
- return DateTime();
- }
-}
-
+static DateTime GetServerTimeFromError(const AWSError<CoreErrors> error)
+{
+ const Http::HeaderValueCollection& headers = error.GetResponseHeaders();
+ auto awsDateHeaderIter = headers.find(StringUtils::ToLower(Http::AWS_DATE_HEADER));
+ auto dateHeaderIter = headers.find(StringUtils::ToLower(Http::DATE_HEADER));
+ if (awsDateHeaderIter != headers.end())
+ {
+ return DateTime(awsDateHeaderIter->second.c_str(), DateFormat::AutoDetect);
+ }
+ else if (dateHeaderIter != headers.end())
+ {
+ return DateTime(dateHeaderIter->second.c_str(), DateFormat::AutoDetect);
+ }
+ else
+ {
+ return DateTime();
+ }
+}
+
bool AWSClient::AdjustClockSkew(HttpResponseOutcome& outcome, const char* signerName) const
{
if (m_enableClockSkewAdjustment)
{
auto signer = GetSignerByName(signerName);
- //detect clock skew and try to correct.
+ //detect clock skew and try to correct.
AWS_LOGSTREAM_WARN(AWS_CLIENT_LOG_TAG, "If the signature check failed. This could be because of a time skew. Attempting to adjust the signer.");
- DateTime serverTime = GetServerTimeFromError(outcome.GetError());
+ DateTime serverTime = GetServerTimeFromError(outcome.GetError());
const auto signingTimestamp = signer->GetSigningTimestamp();
if (!serverTime.WasParseSuccessful() || serverTime == DateTime())
{
@@ -202,11 +202,11 @@ bool AWSClient::AdjustClockSkew(HttpResponseOutcome& outcome, const char* signer
diff = DateTime::Diff(serverTime, DateTime::Now());
AWS_LOGSTREAM_INFO(AWS_CLIENT_LOG_TAG, "Computed time difference as " << diff.count() << " milliseconds. Adjusting signer with the skew.");
signer->SetClockSkew(diff);
- AWSError<CoreErrors> newError(
+ AWSError<CoreErrors> newError(
outcome.GetError().GetErrorType(), outcome.GetError().GetExceptionName(), outcome.GetError().GetMessage(), true);
newError.SetResponseHeaders(outcome.GetError().GetResponseHeaders());
newError.SetResponseCode(outcome.GetError().GetResponseCode());
- outcome = std::move(newError);
+ outcome = std::move(newError);
return true;
}
}
@@ -216,43 +216,43 @@ bool AWSClient::AdjustClockSkew(HttpResponseOutcome& outcome, const char* signer
HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
HttpMethod method,
- const char* signerName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* signerName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- if (!Aws::Utils::IsValidHost(uri.GetAuthority()))
- {
- return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false/*retryable*/));
- }
+ if (!Aws::Utils::IsValidHost(uri.GetAuthority()))
+ {
+ return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false/*retryable*/));
+ }
std::shared_ptr<HttpRequest> httpRequest(CreateHttpRequest(uri, method, request.GetResponseStreamFactory()));
HttpResponseOutcome outcome;
- AWSError<CoreErrors> lastError;
+ AWSError<CoreErrors> lastError;
Aws::Monitoring::CoreMetricsCollection coreMetrics;
auto contexts = Aws::Monitoring::OnRequestStarted(this->GetServiceClientName(), request.GetServiceRequestName(), httpRequest);
- const char* signerRegion = signerRegionOverride;
- Aws::String regionFromResponse;
-
- Aws::String invocationId = UUID::RandomUUID();
- RequestInfo requestInfo;
- requestInfo.attempt = 1;
- requestInfo.maxAttempts = 0;
- httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
- httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
-
+ const char* signerRegion = signerRegionOverride;
+ Aws::String regionFromResponse;
+
+ Aws::String invocationId = UUID::RandomUUID();
+ RequestInfo requestInfo;
+ requestInfo.attempt = 1;
+ requestInfo.maxAttempts = 0;
+ httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
+ httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
+
for (long retries = 0;; retries++)
{
- m_retryStrategy->GetSendToken();
- httpRequest->SetEventStreamRequest(request.IsEventStreamRequest());
-
- outcome = AttemptOneRequest(httpRequest, request, signerName, signerRegion, signerServiceNameOverride);
- if (retries == 0)
- {
- m_retryStrategy->RequestBookkeeping(outcome);
- }
- else
- {
- m_retryStrategy->RequestBookkeeping(outcome, lastError);
- }
+ m_retryStrategy->GetSendToken();
+ httpRequest->SetEventStreamRequest(request.IsEventStreamRequest());
+
+ outcome = AttemptOneRequest(httpRequest, request, signerName, signerRegion, signerServiceNameOverride);
+ if (retries == 0)
+ {
+ m_retryStrategy->RequestBookkeeping(outcome);
+ }
+ else
+ {
+ m_retryStrategy->RequestBookkeeping(outcome, lastError);
+ }
coreMetrics.httpClientMetrics = httpRequest->GetRequestMetrics();
if (outcome.IsSuccess())
{
@@ -260,11 +260,11 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
AWS_LOGSTREAM_TRACE(AWS_CLIENT_LOG_TAG, "Request successful returning.");
break;
}
- lastError = outcome.GetError();
+ lastError = outcome.GetError();
+
+ DateTime serverTime = GetServerTimeFromError(outcome.GetError());
+ auto clockSkew = DateTime::Diff(serverTime, DateTime::Now());
- DateTime serverTime = GetServerTimeFromError(outcome.GetError());
- auto clockSkew = DateTime::Diff(serverTime, DateTime::Now());
-
Aws::Monitoring::OnRequestFailed(this->GetServiceClientName(), request.GetServiceRequestName(), httpRequest, outcome, coreMetrics, contexts);
if (!m_httpClient->IsRequestProcessingEnabled())
@@ -273,28 +273,28 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
break;
}
- // Adjust region
- bool retryWithCorrectRegion = false;
- HttpResponseCode httpResponseCode = outcome.GetError().GetResponseCode();
- if (httpResponseCode == HttpResponseCode::MOVED_PERMANENTLY || // 301
- httpResponseCode == HttpResponseCode::TEMPORARY_REDIRECT || // 307
- httpResponseCode == HttpResponseCode::BAD_REQUEST || // 400
- httpResponseCode == HttpResponseCode::FORBIDDEN) // 403
- {
- regionFromResponse = GetErrorMarshaller()->ExtractRegion(outcome.GetError());
- if (m_region == Aws::Region::AWS_GLOBAL && !regionFromResponse.empty() && regionFromResponse != signerRegion)
- {
- signerRegion = regionFromResponse.c_str();
- retryWithCorrectRegion = true;
- }
- }
-
+ // Adjust region
+ bool retryWithCorrectRegion = false;
+ HttpResponseCode httpResponseCode = outcome.GetError().GetResponseCode();
+ if (httpResponseCode == HttpResponseCode::MOVED_PERMANENTLY || // 301
+ httpResponseCode == HttpResponseCode::TEMPORARY_REDIRECT || // 307
+ httpResponseCode == HttpResponseCode::BAD_REQUEST || // 400
+ httpResponseCode == HttpResponseCode::FORBIDDEN) // 403
+ {
+ regionFromResponse = GetErrorMarshaller()->ExtractRegion(outcome.GetError());
+ if (m_region == Aws::Region::AWS_GLOBAL && !regionFromResponse.empty() && regionFromResponse != signerRegion)
+ {
+ signerRegion = regionFromResponse.c_str();
+ retryWithCorrectRegion = true;
+ }
+ }
+
long sleepMillis = m_retryStrategy->CalculateDelayBeforeNextRetry(outcome.GetError(), retries);
//AdjustClockSkew returns true means clock skew was the problem and skew was adjusted, false otherwise.
- //sleep if clock skew and region was NOT the problem. AdjustClockSkew may update error inside outcome.
- bool shouldSleep = !AdjustClockSkew(outcome, signerName) && !retryWithCorrectRegion;
+ //sleep if clock skew and region was NOT the problem. AdjustClockSkew may update error inside outcome.
+ bool shouldSleep = !AdjustClockSkew(outcome, signerName) && !retryWithCorrectRegion;
- if (!retryWithCorrectRegion && !m_retryStrategy->ShouldRetry(outcome.GetError(), retries))
+ if (!retryWithCorrectRegion && !m_retryStrategy->ShouldRetry(outcome.GetError(), retries))
{
break;
}
@@ -315,68 +315,68 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
{
m_httpClient->RetryRequestSleep(std::chrono::milliseconds(sleepMillis));
}
-
- Aws::Http::URI newUri = uri;
- Aws::String newEndpoint = GetErrorMarshaller()->ExtractEndpoint(outcome.GetError());
- if (!newEndpoint.empty())
- {
- newUri.SetAuthority(newEndpoint);
- }
- httpRequest = CreateHttpRequest(newUri, method, request.GetResponseStreamFactory());
-
- httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
- if (serverTime.WasParseSuccessful() && serverTime != DateTime())
- {
- requestInfo.ttl = DateTime::Now() + clockSkew + std::chrono::milliseconds(m_requestTimeoutMs);
- }
- requestInfo.attempt ++;
- requestInfo.maxAttempts = m_retryStrategy->GetMaxAttempts();
- httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
+
+ Aws::Http::URI newUri = uri;
+ Aws::String newEndpoint = GetErrorMarshaller()->ExtractEndpoint(outcome.GetError());
+ if (!newEndpoint.empty())
+ {
+ newUri.SetAuthority(newEndpoint);
+ }
+ httpRequest = CreateHttpRequest(newUri, method, request.GetResponseStreamFactory());
+
+ httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
+ if (serverTime.WasParseSuccessful() && serverTime != DateTime())
+ {
+ requestInfo.ttl = DateTime::Now() + clockSkew + std::chrono::milliseconds(m_requestTimeoutMs);
+ }
+ requestInfo.attempt ++;
+ requestInfo.maxAttempts = m_retryStrategy->GetMaxAttempts();
+ httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
Aws::Monitoring::OnRequestRetry(this->GetServiceClientName(), request.GetServiceRequestName(), httpRequest, contexts);
}
Aws::Monitoring::OnFinish(this->GetServiceClientName(), request.GetServiceRequestName(), httpRequest, contexts);
return outcome;
}
-HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
- HttpMethod method,
- const char* signerName,
- const char* requestName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
+ HttpMethod method,
+ const char* signerName,
+ const char* requestName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- if (!Aws::Utils::IsValidHost(uri.GetAuthority()))
- {
- return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false/*retryable*/));
- }
-
+ if (!Aws::Utils::IsValidHost(uri.GetAuthority()))
+ {
+ return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false/*retryable*/));
+ }
+
std::shared_ptr<HttpRequest> httpRequest(CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
HttpResponseOutcome outcome;
- AWSError<CoreErrors> lastError;
+ AWSError<CoreErrors> lastError;
Aws::Monitoring::CoreMetricsCollection coreMetrics;
auto contexts = Aws::Monitoring::OnRequestStarted(this->GetServiceClientName(), requestName, httpRequest);
- const char* signerRegion = signerRegionOverride;
- Aws::String regionFromResponse;
-
- Aws::String invocationId = UUID::RandomUUID();
- RequestInfo requestInfo;
- requestInfo.attempt = 1;
- requestInfo.maxAttempts = 0;
- httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
- httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
-
+ const char* signerRegion = signerRegionOverride;
+ Aws::String regionFromResponse;
+
+ Aws::String invocationId = UUID::RandomUUID();
+ RequestInfo requestInfo;
+ requestInfo.attempt = 1;
+ requestInfo.maxAttempts = 0;
+ httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
+ httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
+
for (long retries = 0;; retries++)
{
- m_retryStrategy->GetSendToken();
- outcome = AttemptOneRequest(httpRequest, signerName, requestName, signerRegion, signerServiceNameOverride);
- if (retries == 0)
- {
- m_retryStrategy->RequestBookkeeping(outcome);
- }
- else
- {
- m_retryStrategy->RequestBookkeeping(outcome, lastError);
- }
+ m_retryStrategy->GetSendToken();
+ outcome = AttemptOneRequest(httpRequest, signerName, requestName, signerRegion, signerServiceNameOverride);
+ if (retries == 0)
+ {
+ m_retryStrategy->RequestBookkeeping(outcome);
+ }
+ else
+ {
+ m_retryStrategy->RequestBookkeeping(outcome, lastError);
+ }
coreMetrics.httpClientMetrics = httpRequest->GetRequestMetrics();
if (outcome.IsSuccess())
{
@@ -384,11 +384,11 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
AWS_LOGSTREAM_TRACE(AWS_CLIENT_LOG_TAG, "Request successful returning.");
break;
}
- lastError = outcome.GetError();
+ lastError = outcome.GetError();
+
+ DateTime serverTime = GetServerTimeFromError(outcome.GetError());
+ auto clockSkew = DateTime::Diff(serverTime, DateTime::Now());
- DateTime serverTime = GetServerTimeFromError(outcome.GetError());
- auto clockSkew = DateTime::Diff(serverTime, DateTime::Now());
-
Aws::Monitoring::OnRequestFailed(this->GetServiceClientName(), requestName, httpRequest, outcome, coreMetrics, contexts);
if (!m_httpClient->IsRequestProcessingEnabled())
@@ -397,28 +397,28 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
break;
}
- // Adjust region
- bool retryWithCorrectRegion = false;
- HttpResponseCode httpResponseCode = outcome.GetError().GetResponseCode();
- if (httpResponseCode == HttpResponseCode::MOVED_PERMANENTLY || // 301
- httpResponseCode == HttpResponseCode::TEMPORARY_REDIRECT || // 307
- httpResponseCode == HttpResponseCode::BAD_REQUEST || // 400
- httpResponseCode == HttpResponseCode::FORBIDDEN) // 403
- {
- regionFromResponse = GetErrorMarshaller()->ExtractRegion(outcome.GetError());
- if (m_region == Aws::Region::AWS_GLOBAL && !regionFromResponse.empty() && regionFromResponse != signerRegion)
- {
- signerRegion = regionFromResponse.c_str();
- retryWithCorrectRegion = true;
- }
- }
-
+ // Adjust region
+ bool retryWithCorrectRegion = false;
+ HttpResponseCode httpResponseCode = outcome.GetError().GetResponseCode();
+ if (httpResponseCode == HttpResponseCode::MOVED_PERMANENTLY || // 301
+ httpResponseCode == HttpResponseCode::TEMPORARY_REDIRECT || // 307
+ httpResponseCode == HttpResponseCode::BAD_REQUEST || // 400
+ httpResponseCode == HttpResponseCode::FORBIDDEN) // 403
+ {
+ regionFromResponse = GetErrorMarshaller()->ExtractRegion(outcome.GetError());
+ if (m_region == Aws::Region::AWS_GLOBAL && !regionFromResponse.empty() && regionFromResponse != signerRegion)
+ {
+ signerRegion = regionFromResponse.c_str();
+ retryWithCorrectRegion = true;
+ }
+ }
+
long sleepMillis = m_retryStrategy->CalculateDelayBeforeNextRetry(outcome.GetError(), retries);
//AdjustClockSkew returns true means clock skew was the problem and skew was adjusted, false otherwise.
- //sleep if clock skew and region was NOT the problem. AdjustClockSkew may update error inside outcome.
- bool shouldSleep = !AdjustClockSkew(outcome, signerName) && !retryWithCorrectRegion;
+ //sleep if clock skew and region was NOT the problem. AdjustClockSkew may update error inside outcome.
+ bool shouldSleep = !AdjustClockSkew(outcome, signerName) && !retryWithCorrectRegion;
- if (!retryWithCorrectRegion && !m_retryStrategy->ShouldRetry(outcome.GetError(), retries))
+ if (!retryWithCorrectRegion && !m_retryStrategy->ShouldRetry(outcome.GetError(), retries))
{
break;
}
@@ -429,23 +429,23 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
{
m_httpClient->RetryRequestSleep(std::chrono::milliseconds(sleepMillis));
}
-
- Aws::Http::URI newUri = uri;
- Aws::String newEndpoint = GetErrorMarshaller()->ExtractEndpoint(outcome.GetError());
- if (!newEndpoint.empty())
- {
- newUri.SetAuthority(newEndpoint);
- }
- httpRequest = CreateHttpRequest(newUri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
-
- httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
- if (serverTime.WasParseSuccessful() && serverTime != DateTime())
- {
- requestInfo.ttl = DateTime::Now() + clockSkew + std::chrono::milliseconds(m_requestTimeoutMs);
- }
- requestInfo.attempt ++;
- requestInfo.maxAttempts = m_retryStrategy->GetMaxAttempts();
- httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
+
+ Aws::Http::URI newUri = uri;
+ Aws::String newEndpoint = GetErrorMarshaller()->ExtractEndpoint(outcome.GetError());
+ if (!newEndpoint.empty())
+ {
+ newUri.SetAuthority(newEndpoint);
+ }
+ httpRequest = CreateHttpRequest(newUri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
+
+ httpRequest->SetHeaderValue(Http::SDK_INVOCATION_ID_HEADER, invocationId);
+ if (serverTime.WasParseSuccessful() && serverTime != DateTime())
+ {
+ requestInfo.ttl = DateTime::Now() + clockSkew + std::chrono::milliseconds(m_requestTimeoutMs);
+ }
+ requestInfo.attempt ++;
+ requestInfo.maxAttempts = m_retryStrategy->GetMaxAttempts();
+ httpRequest->SetHeaderValue(Http::SDK_REQUEST_HEADER, requestInfo);
Aws::Monitoring::OnRequestRetry(this->GetServiceClientName(), requestName, httpRequest, contexts);
}
Aws::Monitoring::OnFinish(this->GetServiceClientName(), requestName, httpRequest, contexts);
@@ -454,29 +454,29 @@ HttpResponseOutcome AWSClient::AttemptExhaustively(const Aws::Http::URI& uri,
static bool DoesResponseGenerateError(const std::shared_ptr<HttpResponse>& response)
{
- if (response->HasClientError()) return true;
+ if (response->HasClientError()) return true;
int responseCode = static_cast<int>(response->GetResponseCode());
return responseCode < SUCCESS_RESPONSE_MIN || responseCode > SUCCESS_RESPONSE_MAX;
}
-HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpRequest>& httpRequest, const Aws::AmazonWebServiceRequest& request,
- const char* signerName, const char* signerRegionOverride, const char* signerServiceNameOverride) const
+HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpRequest>& httpRequest, const Aws::AmazonWebServiceRequest& request,
+ const char* signerName, const char* signerRegionOverride, const char* signerServiceNameOverride) const
{
BuildHttpRequest(request, httpRequest);
auto signer = GetSignerByName(signerName);
- if (!signer->SignRequest(*httpRequest, signerRegionOverride, signerServiceNameOverride, request.SignBody()))
+ if (!signer->SignRequest(*httpRequest, signerRegionOverride, signerServiceNameOverride, request.SignBody()))
{
AWS_LOGSTREAM_ERROR(AWS_CLIENT_LOG_TAG, "Request signing failed. Returning error.");
return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::CLIENT_SIGNING_FAILURE, "", "SDK failed to sign the request", false/*retryable*/));
}
- if (request.GetRequestSignedHandler())
- {
- request.GetRequestSignedHandler()(*httpRequest);
- }
-
+ if (request.GetRequestSignedHandler())
+ {
+ request.GetRequestSignedHandler()(*httpRequest);
+ }
+
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request Successfully signed");
std::shared_ptr<HttpResponse> httpResponse(
m_httpClient->MakeRequest(httpRequest, m_readRateLimiter.get(), m_writeRateLimiter.get()));
@@ -484,22 +484,22 @@ HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpReque
if (DoesResponseGenerateError(httpResponse))
{
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned error. Attempting to generate appropriate error codes from response");
- auto error = BuildAWSError(httpResponse);
- return HttpResponseOutcome(std::move(error));
+ auto error = BuildAWSError(httpResponse);
+ return HttpResponseOutcome(std::move(error));
}
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned successful response.");
- return HttpResponseOutcome(std::move(httpResponse));
+ return HttpResponseOutcome(std::move(httpResponse));
}
-HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpRequest>& httpRequest,
- const char* signerName, const char* requestName, const char* signerRegionOverride, const char* signerServiceNameOverride) const
+HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpRequest>& httpRequest,
+ const char* signerName, const char* requestName, const char* signerRegionOverride, const char* signerServiceNameOverride) const
{
AWS_UNREFERENCED_PARAM(requestName);
auto signer = GetSignerByName(signerName);
- if (!signer->SignRequest(*httpRequest, signerRegionOverride, signerServiceNameOverride, true))
+ if (!signer->SignRequest(*httpRequest, signerRegionOverride, signerServiceNameOverride, true))
{
AWS_LOGSTREAM_ERROR(AWS_CLIENT_LOG_TAG, "Request signing failed. Returning error.");
return HttpResponseOutcome(AWSError<CoreErrors>(CoreErrors::CLIENT_SIGNING_FAILURE, "", "SDK failed to sign the request", false/*retryable*/));
@@ -515,23 +515,23 @@ HttpResponseOutcome AWSClient::AttemptOneRequest(const std::shared_ptr<HttpReque
if (DoesResponseGenerateError(httpResponse))
{
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned error. Attempting to generate appropriate error codes from response");
- auto error = BuildAWSError(httpResponse);
- return HttpResponseOutcome(std::move(error));
+ auto error = BuildAWSError(httpResponse);
+ return HttpResponseOutcome(std::move(error));
}
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned successful response.");
- return HttpResponseOutcome(std::move(httpResponse));
+ return HttpResponseOutcome(std::move(httpResponse));
}
StreamOutcome AWSClient::MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
Http::HttpMethod method,
- const char* signerName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* signerName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpResponseOutcome = AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride);
+ HttpResponseOutcome httpResponseOutcome = AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride);
if (httpResponseOutcome.IsSuccess())
{
return StreamOutcome(AmazonWebServiceResult<Stream::ResponseStream>(
@@ -539,17 +539,17 @@ StreamOutcome AWSClient::MakeRequestWithUnparsedResponse(const Aws::Http::URI& u
httpResponseOutcome.GetResult()->GetHeaders(), httpResponseOutcome.GetResult()->GetResponseCode()));
}
- return StreamOutcome(std::move(httpResponseOutcome));
+ return StreamOutcome(std::move(httpResponseOutcome));
}
-StreamOutcome AWSClient::MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
- Http::HttpMethod method,
- const char* signerName,
- const char* requestName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+StreamOutcome AWSClient::MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
+ Http::HttpMethod method,
+ const char* signerName,
+ const char* requestName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpResponseOutcome = AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride);
+ HttpResponseOutcome httpResponseOutcome = AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride);
if (httpResponseOutcome.IsSuccess())
{
return StreamOutcome(AmazonWebServiceResult<Stream::ResponseStream>(
@@ -557,39 +557,39 @@ StreamOutcome AWSClient::MakeRequestWithUnparsedResponse(const Aws::Http::URI& u
httpResponseOutcome.GetResult()->GetHeaders(), httpResponseOutcome.GetResult()->GetResponseCode()));
}
- return StreamOutcome(std::move(httpResponseOutcome));
+ return StreamOutcome(std::move(httpResponseOutcome));
}
XmlOutcome AWSXMLClient::MakeRequestWithEventStream(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
Http::HttpMethod method,
- const char* signerName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* signerName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome = AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride);
+ HttpResponseOutcome httpOutcome = AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride);
if (httpOutcome.IsSuccess())
{
return XmlOutcome(AmazonWebServiceResult<XmlDocument>(XmlDocument(), httpOutcome.GetResult()->GetHeaders()));
}
- return XmlOutcome(std::move(httpOutcome));
+ return XmlOutcome(std::move(httpOutcome));
}
-XmlOutcome AWSXMLClient::MakeRequestWithEventStream(const Aws::Http::URI& uri,
- Http::HttpMethod method,
- const char* signerName,
- const char* requestName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+XmlOutcome AWSXMLClient::MakeRequestWithEventStream(const Aws::Http::URI& uri,
+ Http::HttpMethod method,
+ const char* signerName,
+ const char* requestName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome = AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride);
+ HttpResponseOutcome httpOutcome = AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride);
if (httpOutcome.IsSuccess())
{
return XmlOutcome(AmazonWebServiceResult<XmlDocument>(XmlDocument(), httpOutcome.GetResult()->GetHeaders()));
}
- return XmlOutcome(std::move(httpOutcome));
+ return XmlOutcome(std::move(httpOutcome));
}
void AWSClient::AddHeadersToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest,
@@ -604,7 +604,7 @@ void AWSClient::AddHeadersToRequest(const std::shared_ptr<Aws::Http::HttpRequest
}
void AWSClient::AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest,
- const std::shared_ptr<Aws::IOStream>& body, bool needsContentMd5, bool isChunked) const
+ const std::shared_ptr<Aws::IOStream>& body, bool needsContentMd5, bool isChunked) const
{
httpRequest->AddContentBody(body);
@@ -616,8 +616,8 @@ void AWSClient::AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpReq
AWS_LOGSTREAM_TRACE(AWS_CLIENT_LOG_TAG, "No content body, content-length headers");
if(httpRequest->GetMethod() == HttpMethod::HTTP_POST || httpRequest->GetMethod() == HttpMethod::HTTP_PUT)
- {
- httpRequest->SetHeaderValue(Http::CONTENT_LENGTH_HEADER, "0");
+ {
+ httpRequest->SetHeaderValue(Http::CONTENT_LENGTH_HEADER, "0");
}
else
{
@@ -625,20 +625,20 @@ void AWSClient::AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpReq
}
}
- //Add transfer-encoding:chunked to header
- if (body && isChunked)
- {
- httpRequest->SetTransferEncoding(CHUNKED_VALUE);
- }
+ //Add transfer-encoding:chunked to header
+ if (body && isChunked)
+ {
+ httpRequest->SetTransferEncoding(CHUNKED_VALUE);
+ }
//in the scenario where we are adding a content body as a stream, the request object likely already
//has a content-length header set and we don't want to seek the stream just to find this information.
- else if (body && !httpRequest->HasHeader(Http::CONTENT_LENGTH_HEADER))
+ else if (body && !httpRequest->HasHeader(Http::CONTENT_LENGTH_HEADER))
{
- if (!m_httpClient->SupportsChunkedTransferEncoding())
- {
- AWS_LOGSTREAM_WARN(AWS_CLIENT_LOG_TAG, "This http client doesn't support transfer-encoding:chunked. " <<
- "The request may fail if it's not a seekable stream.");
- }
+ if (!m_httpClient->SupportsChunkedTransferEncoding())
+ {
+ AWS_LOGSTREAM_WARN(AWS_CLIENT_LOG_TAG, "This http client doesn't support transfer-encoding:chunked. " <<
+ "The request may fail if it's not a seekable stream.");
+ }
AWS_LOGSTREAM_TRACE(AWS_CLIENT_LOG_TAG, "Found body, but content-length has not been set, attempting to compute content-length");
body->seekg(0, body->end);
auto streamSize = body->tellg();
@@ -682,20 +682,20 @@ Aws::String Aws::Client::GetAuthorizationHeader(const Aws::Http::HttpRequest& ht
return authHeader.substr(signaturePosition + strlen(Aws::Auth::SIGNATURE) + 1);
}
-void AWSClient::BuildHttpRequest(const Aws::AmazonWebServiceRequest& request,
- const std::shared_ptr<HttpRequest>& httpRequest) const
+void AWSClient::BuildHttpRequest(const Aws::AmazonWebServiceRequest& request,
+ const std::shared_ptr<HttpRequest>& httpRequest) const
{
- //do headers first since the request likely will set content-length as it's own header.
+ //do headers first since the request likely will set content-length as it's own header.
AddHeadersToRequest(httpRequest, request.GetHeaders());
- if (request.IsEventStreamRequest())
+ if (request.IsEventStreamRequest())
{
- httpRequest->AddContentBody(request.GetBody());
+ httpRequest->AddContentBody(request.GetBody());
+ }
+ else
+ {
+ AddContentBodyToRequest(httpRequest, request.GetBody(), request.ShouldComputeContentMd5(), request.IsStreaming() && request.IsChunked() && m_httpClient->SupportsChunkedTransferEncoding());
}
- else
- {
- AddContentBodyToRequest(httpRequest, request.GetBody(), request.ShouldComputeContentMd5(), request.IsStreaming() && request.IsChunked() && m_httpClient->SupportsChunkedTransferEncoding());
- }
// Pass along handlers for processing data sent/received in bytes
httpRequest->SetDataReceivedEventHandler(request.GetDataReceivedEventHandler());
@@ -738,34 +738,34 @@ Aws::String AWSClient::GeneratePresignedUrl(URI& uri, HttpMethod method, const A
return {};
}
-Aws::String AWSClient::GeneratePresignedUrl(URI& uri, HttpMethod method, const char* region, long long expirationInSeconds) const
-{
- std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
- auto signer = GetSignerByName(Aws::Auth::SIGV4_SIGNER);
- if (signer->PresignRequest(*request, region, expirationInSeconds))
- {
- return request->GetURIString();
- }
-
- return {};
-}
-
-Aws::String AWSClient::GeneratePresignedUrl(URI& uri, HttpMethod method, const char* region, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds)
-{
- std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
- for (const auto& it: customizedHeaders)
- {
- request->SetHeaderValue(it.first.c_str(), it.second);
- }
- auto signer = GetSignerByName(Aws::Auth::SIGV4_SIGNER);
- if (signer->PresignRequest(*request, region, expirationInSeconds))
- {
- return request->GetURIString();
- }
-
- return {};
-}
-
+Aws::String AWSClient::GeneratePresignedUrl(URI& uri, HttpMethod method, const char* region, long long expirationInSeconds) const
+{
+ std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
+ auto signer = GetSignerByName(Aws::Auth::SIGV4_SIGNER);
+ if (signer->PresignRequest(*request, region, expirationInSeconds))
+ {
+ return request->GetURIString();
+ }
+
+ return {};
+}
+
+Aws::String AWSClient::GeneratePresignedUrl(URI& uri, HttpMethod method, const char* region, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds)
+{
+ std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
+ for (const auto& it: customizedHeaders)
+ {
+ request->SetHeaderValue(it.first.c_str(), it.second);
+ }
+ auto signer = GetSignerByName(Aws::Auth::SIGV4_SIGNER);
+ if (signer->PresignRequest(*request, region, expirationInSeconds))
+ {
+ return request->GetURIString();
+ }
+
+ return {};
+}
+
Aws::String AWSClient::GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, long long expirationInSeconds) const
{
std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
@@ -778,15 +778,15 @@ Aws::String AWSClient::GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::Http
return {};
}
-Aws::String AWSClient::GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds)
+Aws::String AWSClient::GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds)
{
std::shared_ptr<HttpRequest> request = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
- for (const auto& it: customizedHeaders)
- {
- request->SetHeaderValue(it.first.c_str(), it.second);
- }
+ for (const auto& it: customizedHeaders)
+ {
+ request->SetHeaderValue(it.first.c_str(), it.second);
+ }
auto signer = GetSignerByName(Aws::Auth::SIGV4_SIGNER);
- if (signer->PresignRequest(*request, region, serviceName, expirationInSeconds))
+ if (signer->PresignRequest(*request, region, serviceName, expirationInSeconds))
{
return request->GetURIString();
}
@@ -841,7 +841,7 @@ std::shared_ptr<Aws::Http::HttpRequest> AWSClient::ConvertToRequestForPresigning
{
request.PutToPresignedUrl(uri);
std::shared_ptr<HttpRequest> httpRequest = CreateHttpRequest(uri, method, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
-
+
for (auto& param : extraParams)
{
httpRequest->AddQueryStringParameter(param.first.c_str(), param.second);
@@ -875,14 +875,14 @@ AWSJsonClient::AWSJsonClient(const Aws::Client::ClientConfiguration& configurati
JsonOutcome AWSJsonClient::MakeRequest(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
Http::HttpMethod method,
- const char* signerName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* signerName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride));
+ HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride));
if (!httpOutcome.IsSuccess())
{
- return JsonOutcome(std::move(httpOutcome));
+ return JsonOutcome(std::move(httpOutcome));
}
if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
@@ -898,14 +898,14 @@ JsonOutcome AWSJsonClient::MakeRequest(const Aws::Http::URI& uri,
JsonOutcome AWSJsonClient::MakeRequest(const Aws::Http::URI& uri,
Http::HttpMethod method,
const char* signerName,
- const char* requestName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* requestName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride));
+ HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride));
if (!httpOutcome.IsSuccess())
{
- return JsonOutcome(std::move(httpOutcome));
+ return JsonOutcome(std::move(httpOutcome));
}
if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
@@ -933,13 +933,13 @@ JsonOutcome AWSJsonClient::MakeEventStreamRequest(std::shared_ptr<Aws::Http::Htt
if (DoesResponseGenerateError(httpResponse))
{
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned error. Attempting to generate appropriate error codes from response");
- auto error = BuildAWSError(httpResponse);
- return JsonOutcome(std::move(error));
+ auto error = BuildAWSError(httpResponse);
+ return JsonOutcome(std::move(error));
}
AWS_LOGSTREAM_DEBUG(AWS_CLIENT_LOG_TAG, "Request returned successful response.");
- HttpResponseOutcome httpOutcome(std::move(httpResponse));
+ HttpResponseOutcome httpOutcome(std::move(httpResponse));
if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
{
@@ -962,10 +962,10 @@ AWSError<CoreErrors> AWSJsonClient::BuildAWSError(
const std::shared_ptr<Aws::Http::HttpResponse>& httpResponse) const
{
AWSError<CoreErrors> error;
- if (httpResponse->HasClientError())
+ if (httpResponse->HasClientError())
{
- bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false;
- error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable);
+ bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false;
+ error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable);
}
else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().tellp() < 1)
{
@@ -985,7 +985,7 @@ AWSError<CoreErrors> AWSJsonClient::BuildAWSError(
error.SetResponseHeaders(httpResponse->GetHeaders());
error.SetResponseCode(httpResponse->GetResponseCode());
- error.SetRemoteHostIpAddress(httpResponse->GetOriginatingRequest().GetResolvedRemoteHost());
+ error.SetRemoteHostIpAddress(httpResponse->GetOriginatingRequest().GetResolvedRemoteHost());
AWS_LOGSTREAM_ERROR(AWS_CLIENT_LOG_TAG, error);
return error;
}
@@ -1008,14 +1008,14 @@ AWSXMLClient::AWSXMLClient(const Aws::Client::ClientConfiguration& configuration
XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
Http::HttpMethod method,
- const char* signerName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* signerName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride));
+ HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, request, method, signerName, signerRegionOverride, signerServiceNameOverride));
if (!httpOutcome.IsSuccess())
{
- return XmlOutcome(std::move(httpOutcome));
+ return XmlOutcome(std::move(httpOutcome));
}
if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
@@ -1038,14 +1038,14 @@ XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri,
XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri,
Http::HttpMethod method,
const char* signerName,
- const char* requestName,
- const char* signerRegionOverride,
- const char* signerServiceNameOverride) const
+ const char* requestName,
+ const char* signerRegionOverride,
+ const char* signerServiceNameOverride) const
{
- HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride));
+ HttpResponseOutcome httpOutcome(BASECLASS::AttemptExhaustively(uri, method, signerName, requestName, signerRegionOverride, signerServiceNameOverride));
if (!httpOutcome.IsSuccess())
{
- return XmlOutcome(std::move(httpOutcome));
+ return XmlOutcome(std::move(httpOutcome));
}
if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
@@ -1061,12 +1061,12 @@ XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri,
AWSError<CoreErrors> AWSXMLClient::BuildAWSError(const std::shared_ptr<Http::HttpResponse>& httpResponse) const
{
AWSError<CoreErrors> error;
- if (httpResponse->HasClientError())
+ if (httpResponse->HasClientError())
{
- bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false;
- error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable);
+ bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false;
+ error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable);
}
- else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().tellp() < 1)
+ else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().tellp() < 1)
{
auto responseCode = httpResponse->GetResponseCode();
auto errorCode = GuessBodylessErrorType(responseCode);
@@ -1092,7 +1092,7 @@ AWSError<CoreErrors> AWSXMLClient::BuildAWSError(const std::shared_ptr<Http::Htt
error.SetResponseHeaders(httpResponse->GetHeaders());
error.SetResponseCode(httpResponse->GetResponseCode());
- error.SetRemoteHostIpAddress(httpResponse->GetOriginatingRequest().GetResolvedRemoteHost());
+ error.SetRemoteHostIpAddress(httpResponse->GetOriginatingRequest().GetResolvedRemoteHost());
AWS_LOGSTREAM_ERROR(AWS_CLIENT_LOG_TAG, error);
return error;
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp
index 565d491015..f5fa676f98 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp
@@ -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/client/AWSErrorMarshaller.h>
#include <aws/core/utils/logging/LogMacros.h>
@@ -18,54 +18,54 @@ using namespace Aws::Http;
using namespace Aws::Utils;
using namespace Aws::Client;
-static const char AWS_ERROR_MARSHALLER_LOG_TAG[] = "AWSErrorMarshaller";
-AWS_CORE_API extern const char MESSAGE_LOWER_CASE[] = "message";
-AWS_CORE_API extern const char MESSAGE_CAMEL_CASE[] = "Message";
-AWS_CORE_API extern const char ERROR_TYPE_HEADER[] = "x-amzn-ErrorType";
-AWS_CORE_API extern const char REQUEST_ID_HEADER[] = "x-amzn-RequestId";
-AWS_CORE_API extern const char TYPE[] = "__type";
+static const char AWS_ERROR_MARSHALLER_LOG_TAG[] = "AWSErrorMarshaller";
+AWS_CORE_API extern const char MESSAGE_LOWER_CASE[] = "message";
+AWS_CORE_API extern const char MESSAGE_CAMEL_CASE[] = "Message";
+AWS_CORE_API extern const char ERROR_TYPE_HEADER[] = "x-amzn-ErrorType";
+AWS_CORE_API extern const char REQUEST_ID_HEADER[] = "x-amzn-RequestId";
+AWS_CORE_API extern const char TYPE[] = "__type";
AWSError<CoreErrors> JsonErrorMarshaller::Marshall(const Aws::Http::HttpResponse& httpResponse) const
{
JsonValue exceptionPayload(httpResponse.GetResponseBody());
JsonView payloadView(exceptionPayload);
- AWSError<CoreErrors> error;
- if (exceptionPayload.WasParseSuccessful())
+ AWSError<CoreErrors> error;
+ if (exceptionPayload.WasParseSuccessful())
{
- AWS_LOGSTREAM_TRACE(AWS_ERROR_MARSHALLER_LOG_TAG, "Error response is " << payloadView.WriteReadable());
-
- Aws::String message(payloadView.ValueExists(MESSAGE_CAMEL_CASE) ? payloadView.GetString(MESSAGE_CAMEL_CASE) :
- payloadView.ValueExists(MESSAGE_LOWER_CASE) ? payloadView.GetString(MESSAGE_LOWER_CASE) : "");
-
- if (httpResponse.HasHeader(ERROR_TYPE_HEADER))
- {
- error = Marshall(httpResponse.GetHeader(ERROR_TYPE_HEADER), message);
- }
- else if (payloadView.ValueExists(TYPE))
- {
- error = Marshall(payloadView.GetString(TYPE), message);
- }
- else
- {
- error = FindErrorByHttpResponseCode(httpResponse.GetResponseCode());
- error.SetMessage(message);
- }
+ AWS_LOGSTREAM_TRACE(AWS_ERROR_MARSHALLER_LOG_TAG, "Error response is " << payloadView.WriteReadable());
+
+ Aws::String message(payloadView.ValueExists(MESSAGE_CAMEL_CASE) ? payloadView.GetString(MESSAGE_CAMEL_CASE) :
+ payloadView.ValueExists(MESSAGE_LOWER_CASE) ? payloadView.GetString(MESSAGE_LOWER_CASE) : "");
+
+ if (httpResponse.HasHeader(ERROR_TYPE_HEADER))
+ {
+ error = Marshall(httpResponse.GetHeader(ERROR_TYPE_HEADER), message);
+ }
+ else if (payloadView.ValueExists(TYPE))
+ {
+ error = Marshall(payloadView.GetString(TYPE), message);
+ }
+ else
+ {
+ error = FindErrorByHttpResponseCode(httpResponse.GetResponseCode());
+ error.SetMessage(message);
+ }
}
else
{
- error = AWSError<CoreErrors>(CoreErrors::UNKNOWN, "", "Failed to parse error payload", false);
+ error = AWSError<CoreErrors>(CoreErrors::UNKNOWN, "", "Failed to parse error payload", false);
}
-
- error.SetRequestId(httpResponse.HasHeader(REQUEST_ID_HEADER) ? httpResponse.GetHeader(REQUEST_ID_HEADER) : "");
- error.SetJsonPayload(std::move(exceptionPayload));
- return error;
+
+ error.SetRequestId(httpResponse.HasHeader(REQUEST_ID_HEADER) ? httpResponse.GetHeader(REQUEST_ID_HEADER) : "");
+ error.SetJsonPayload(std::move(exceptionPayload));
+ return error;
+}
+
+const JsonValue& JsonErrorMarshaller::GetJsonPayloadFromError(const AWSError<CoreErrors>& error) const
+{
+ return error.GetJsonPayload();
}
-const JsonValue& JsonErrorMarshaller::GetJsonPayloadFromError(const AWSError<CoreErrors>& error) const
-{
- return error.GetJsonPayload();
-}
-
AWSError<CoreErrors> XmlErrorMarshaller::Marshall(const Aws::Http::HttpResponse& httpResponse) const
{
XmlDocument doc = XmlDocument::CreateFromXmlStream(httpResponse.GetResponseBody());
@@ -75,10 +75,10 @@ AWSError<CoreErrors> XmlErrorMarshaller::Marshall(const Aws::Http::HttpResponse&
if (doc.WasParseSuccessful() && !doc.GetRootElement().IsNull())
{
XmlNode errorNode = doc.GetRootElement();
-
- Aws::String requestId(!errorNode.FirstChild("RequestId").IsNull() ? errorNode.FirstChild("RequestId").GetText() :
- !errorNode.FirstChild("RequestID").IsNull() ? errorNode.FirstChild("RequestID").GetText() : "");
-
+
+ Aws::String requestId(!errorNode.FirstChild("RequestId").IsNull() ? errorNode.FirstChild("RequestId").GetText() :
+ !errorNode.FirstChild("RequestID").IsNull() ? errorNode.FirstChild("RequestID").GetText() : "");
+
if (errorNode.GetName() != "Error")
{
errorNode = doc.GetRootElement().FirstChild("Error");
@@ -94,9 +94,9 @@ AWSError<CoreErrors> XmlErrorMarshaller::Marshall(const Aws::Http::HttpResponse&
if (!errorNode.IsNull())
{
- requestId = !requestId.empty() ? requestId : !errorNode.FirstChild("RequestId").IsNull() ? errorNode.FirstChild("RequestId").GetText() :
- !errorNode.FirstChild("RequestID").IsNull() ? errorNode.FirstChild("RequestID").GetText() : "";
-
+ requestId = !requestId.empty() ? requestId : !errorNode.FirstChild("RequestId").IsNull() ? errorNode.FirstChild("RequestId").GetText() :
+ !errorNode.FirstChild("RequestID").IsNull() ? errorNode.FirstChild("RequestID").GetText() : "";
+
XmlNode codeNode = errorNode.FirstChild("Code");
XmlNode messageNode = errorNode.FirstChild("Message");
@@ -107,8 +107,8 @@ AWSError<CoreErrors> XmlErrorMarshaller::Marshall(const Aws::Http::HttpResponse&
errorParsed = true;
}
}
-
- error.SetRequestId(requestId);
+
+ error.SetRequestId(requestId);
}
if(!errorParsed)
@@ -120,15 +120,15 @@ AWSError<CoreErrors> XmlErrorMarshaller::Marshall(const Aws::Http::HttpResponse&
error = FindErrorByHttpResponseCode(httpResponse.GetResponseCode());
}
- error.SetXmlPayload(std::move(doc));
+ error.SetXmlPayload(std::move(doc));
return error;
}
-const XmlDocument& XmlErrorMarshaller::GetXmlPayloadFromError(const AWSError<CoreErrors>& error) const
-{
- return error.GetXmlPayload();
-}
-
+const XmlDocument& XmlErrorMarshaller::GetXmlPayloadFromError(const AWSError<CoreErrors>& error) const
+{
+ return error.GetXmlPayload();
+}
+
AWSError<CoreErrors> AWSErrorMarshaller::Marshall(const Aws::String& exceptionName, const Aws::String& message) const
{
if(exceptionName.empty())
@@ -142,11 +142,11 @@ AWSError<CoreErrors> AWSErrorMarshaller::Marshall(const Aws::String& exceptionNa
if (locationOfPound != Aws::String::npos)
{
- formalExceptionName = exceptionName.substr(locationOfPound + 1);
+ formalExceptionName = exceptionName.substr(locationOfPound + 1);
}
else if (locationOfColon != Aws::String::npos)
{
- formalExceptionName = exceptionName.substr(0, locationOfColon);
+ formalExceptionName = exceptionName.substr(0, locationOfColon);
}
else
{
@@ -161,7 +161,7 @@ AWSError<CoreErrors> AWSErrorMarshaller::Marshall(const Aws::String& exceptionNa
error.SetExceptionName(formalExceptionName);
error.SetMessage(message);
return error;
- }
+ }
AWS_LOGSTREAM_WARN(AWS_ERROR_MARSHALLER_LOG_TAG, "Encountered Unknown AWSError '" << exceptionName.c_str() <<
"': " << message.c_str());
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AsyncCallerContext.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AsyncCallerContext.cpp
index 80e19495df..4f9abdc9e4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AsyncCallerContext.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AsyncCallerContext.cpp
@@ -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/client/AsyncCallerContext.h>
#include <aws/core/utils/UUID.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
index 6e2fd8e56d..e517379a77 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
@@ -1,31 +1,31 @@
-/**
- * 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/client/ClientConfiguration.h>
-#include <aws/core/auth/AWSCredentialsProvider.h>
+#include <aws/core/auth/AWSCredentialsProvider.h>
#include <aws/core/client/DefaultRetryStrategy.h>
-#include <aws/core/platform/Environment.h>
+#include <aws/core/platform/Environment.h>
#include <aws/core/platform/OSVersionInfo.h>
#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/Version.h>
-#include <aws/core/config/AWSProfileConfigLoader.h>
-#include <aws/core/utils/logging/LogMacros.h>
+#include <aws/core/config/AWSProfileConfigLoader.h>
+#include <aws/core/utils/logging/LogMacros.h>
namespace Aws
{
-namespace Auth
-{
- AWS_CORE_API Aws::String GetConfigProfileFilename();
-}
+namespace Auth
+{
+ AWS_CORE_API Aws::String GetConfigProfileFilename();
+}
namespace Client
{
-static const char* CLIENT_CONFIG_TAG = "ClientConfiguration";
+static const char* CLIENT_CONFIG_TAG = "ClientConfiguration";
AWS_CORE_API Aws::String ComputeUserAgentString()
{
@@ -35,126 +35,126 @@ AWS_CORE_API Aws::String ComputeUserAgentString()
return ss.str();
}
-ClientConfiguration::ClientConfiguration() :
- scheme(Aws::Http::Scheme::HTTPS),
+ClientConfiguration::ClientConfiguration() :
+ scheme(Aws::Http::Scheme::HTTPS),
useDualStack(false),
- maxConnections(25),
- httpRequestTimeoutMs(0),
- requestTimeoutMs(3000),
+ maxConnections(25),
+ httpRequestTimeoutMs(0),
+ requestTimeoutMs(3000),
connectTimeoutMs(1000),
- enableTcpKeepAlive(true),
- tcpKeepAliveIntervalMs(30000),
- lowSpeedLimit(1),
+ enableTcpKeepAlive(true),
+ tcpKeepAliveIntervalMs(30000),
+ lowSpeedLimit(1),
proxyScheme(Aws::Http::Scheme::HTTP),
proxyPort(0),
- executor(Aws::MakeShared<Aws::Utils::Threading::DefaultExecutor>(CLIENT_CONFIG_TAG)),
+ executor(Aws::MakeShared<Aws::Utils::Threading::DefaultExecutor>(CLIENT_CONFIG_TAG)),
verifySSL(true),
writeRateLimiter(nullptr),
readRateLimiter(nullptr),
httpLibOverride(Aws::Http::TransferLibType::DEFAULT_CLIENT),
- followRedirects(FollowRedirectsPolicy::DEFAULT),
+ followRedirects(FollowRedirectsPolicy::DEFAULT),
disableExpectHeader(false),
enableClockSkewAdjustment(true),
enableHostPrefixInjection(true),
- enableEndpointDiscovery(false),
- profileName(Aws::Auth::GetConfigProfileName())
+ enableEndpointDiscovery(false),
+ profileName(Aws::Auth::GetConfigProfileName())
+{
+ AWS_LOGSTREAM_DEBUG(CLIENT_CONFIG_TAG, "ClientConfiguration will use SDK Auto Resolved profile: [" << profileName << "] if not specified by users.");
+
+ // Initialize Retry Strategy
+ int maxAttempts;
+ Aws::String maxAttemptsString = Aws::Environment::GetEnv("AWS_MAX_ATTEMPTS");
+ if (maxAttemptsString.empty())
+ {
+ maxAttemptsString = Aws::Config::GetCachedConfigValue("max_attempts");
+ }
+ // In case users specify 0 explicitly to disable retry.
+ if (maxAttemptsString == "0")
+ {
+ maxAttempts = 0;
+ }
+ else
+ {
+ maxAttempts = static_cast<int>(Aws::Utils::StringUtils::ConvertToInt32(maxAttemptsString.c_str()));
+ if (maxAttempts == 0)
+ {
+ AWS_LOGSTREAM_WARN(CLIENT_CONFIG_TAG, "Retry Strategy will use the default max attempts.");
+ maxAttempts = -1;
+ }
+ }
+
+ Aws::String retryMode = Aws::Environment::GetEnv("AWS_RETRY_MODE");
+ if (retryMode.empty())
+ {
+ retryMode = Aws::Config::GetCachedConfigValue("retry_mode");
+ }
+ if (retryMode == "standard")
+ {
+ if (maxAttempts < 0)
+ {
+ retryStrategy = Aws::MakeShared<StandardRetryStrategy>(CLIENT_CONFIG_TAG);
+ }
+ else
+ {
+ retryStrategy = Aws::MakeShared<StandardRetryStrategy>(CLIENT_CONFIG_TAG, maxAttempts);
+ }
+ }
+ else
+ {
+ retryStrategy = Aws::MakeShared<DefaultRetryStrategy>(CLIENT_CONFIG_TAG);
+ }
+
+ // Automatically determine the AWS region from environment variables, configuration file and EC2 metadata.
+ region = Aws::Environment::GetEnv("AWS_DEFAULT_REGION");
+ if (!region.empty())
+ {
+ return;
+ }
+
+ region = Aws::Environment::GetEnv("AWS_REGION");
+ if (!region.empty())
+ {
+ return;
+ }
+
+ region = Aws::Config::GetCachedConfigValue("region");
+ if (!region.empty())
+ {
+ return;
+ }
+
+ if (Aws::Utils::StringUtils::ToLower(Aws::Environment::GetEnv("AWS_EC2_METADATA_DISABLED").c_str()) != "true")
+ {
+ auto client = Aws::Internal::GetEC2MetadataClient();
+ if (client)
+ {
+ region = client->GetCurrentRegion();
+ }
+ }
+
+ if (!region.empty())
+ {
+ return;
+ }
+
+ region = Aws::String(Aws::Region::US_EAST_1);
+}
+
+ClientConfiguration::ClientConfiguration(const char* profile) : ClientConfiguration()
{
- AWS_LOGSTREAM_DEBUG(CLIENT_CONFIG_TAG, "ClientConfiguration will use SDK Auto Resolved profile: [" << profileName << "] if not specified by users.");
-
- // Initialize Retry Strategy
- int maxAttempts;
- Aws::String maxAttemptsString = Aws::Environment::GetEnv("AWS_MAX_ATTEMPTS");
- if (maxAttemptsString.empty())
- {
- maxAttemptsString = Aws::Config::GetCachedConfigValue("max_attempts");
- }
- // In case users specify 0 explicitly to disable retry.
- if (maxAttemptsString == "0")
- {
- maxAttempts = 0;
- }
- else
- {
- maxAttempts = static_cast<int>(Aws::Utils::StringUtils::ConvertToInt32(maxAttemptsString.c_str()));
- if (maxAttempts == 0)
- {
- AWS_LOGSTREAM_WARN(CLIENT_CONFIG_TAG, "Retry Strategy will use the default max attempts.");
- maxAttempts = -1;
- }
- }
-
- Aws::String retryMode = Aws::Environment::GetEnv("AWS_RETRY_MODE");
- if (retryMode.empty())
- {
- retryMode = Aws::Config::GetCachedConfigValue("retry_mode");
- }
- if (retryMode == "standard")
- {
- if (maxAttempts < 0)
- {
- retryStrategy = Aws::MakeShared<StandardRetryStrategy>(CLIENT_CONFIG_TAG);
- }
- else
- {
- retryStrategy = Aws::MakeShared<StandardRetryStrategy>(CLIENT_CONFIG_TAG, maxAttempts);
- }
- }
- else
- {
- retryStrategy = Aws::MakeShared<DefaultRetryStrategy>(CLIENT_CONFIG_TAG);
- }
-
- // Automatically determine the AWS region from environment variables, configuration file and EC2 metadata.
- region = Aws::Environment::GetEnv("AWS_DEFAULT_REGION");
- if (!region.empty())
- {
- return;
- }
-
- region = Aws::Environment::GetEnv("AWS_REGION");
- if (!region.empty())
- {
- return;
- }
-
- region = Aws::Config::GetCachedConfigValue("region");
- if (!region.empty())
- {
- return;
- }
-
- if (Aws::Utils::StringUtils::ToLower(Aws::Environment::GetEnv("AWS_EC2_METADATA_DISABLED").c_str()) != "true")
- {
- auto client = Aws::Internal::GetEC2MetadataClient();
- if (client)
- {
- region = client->GetCurrentRegion();
- }
- }
-
- if (!region.empty())
- {
- return;
- }
-
- region = Aws::String(Aws::Region::US_EAST_1);
+ if (profile && Aws::Config::HasCachedConfigProfile(profile))
+ {
+ this->profileName = Aws::String(profile);
+ AWS_LOGSTREAM_DEBUG(CLIENT_CONFIG_TAG, "Use user specified profile: [" << this->profileName << "] for ClientConfiguration.");
+ auto tmpRegion = Aws::Config::GetCachedConfigProfile(this->profileName).GetRegion();
+ if (!tmpRegion.empty())
+ {
+ region = tmpRegion;
+ }
+ return;
+ }
+ AWS_LOGSTREAM_WARN(CLIENT_CONFIG_TAG, "User specified profile: [" << profile << "] is not found, will use the SDK resolved one.");
}
-ClientConfiguration::ClientConfiguration(const char* profile) : ClientConfiguration()
-{
- if (profile && Aws::Config::HasCachedConfigProfile(profile))
- {
- this->profileName = Aws::String(profile);
- AWS_LOGSTREAM_DEBUG(CLIENT_CONFIG_TAG, "Use user specified profile: [" << this->profileName << "] for ClientConfiguration.");
- auto tmpRegion = Aws::Config::GetCachedConfigProfile(this->profileName).GetRegion();
- if (!tmpRegion.empty())
- {
- region = tmpRegion;
- }
- return;
- }
- AWS_LOGSTREAM_WARN(CLIENT_CONFIG_TAG, "User specified profile: [" << profile << "] is not found, will use the SDK resolved one.");
-}
-
} // namespace Client
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/CoreErrors.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/CoreErrors.cpp
index 03d736bd36..8c2c288dcd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/CoreErrors.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/CoreErrors.cpp
@@ -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/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
@@ -31,7 +31,7 @@ void CoreErrorsMapper::InitCoreErrorsMapper()
return;
}
s_CoreErrorsMapper = Aws::MakeUnique<Aws::Map<Aws::String, AWSError<CoreErrors> > >("InitCoreErrorsMapper");
-
+
s_CoreErrorsMapper->emplace("IncompleteSignature", AWSError<CoreErrors>(CoreErrors::INCOMPLETE_SIGNATURE, false));
s_CoreErrorsMapper->emplace("IncompleteSignatureException", AWSError<CoreErrors>(CoreErrors::INCOMPLETE_SIGNATURE, false));
s_CoreErrorsMapper->emplace("InvalidSignatureException", AWSError<CoreErrors>(CoreErrors::INVALID_SIGNATURE, false));
@@ -112,40 +112,40 @@ AWS_CORE_API AWSError<CoreErrors> CoreErrorsMapper::GetErrorForHttpResponseCode(
{
// best effort attempt to map HTTP response codes to CoreErrors
bool retryable = IsRetryableHttpResponseCode(code);
- AWSError<CoreErrors> error;
- switch (code)
+ AWSError<CoreErrors> error;
+ switch (code)
{
case HttpResponseCode::UNAUTHORIZED:
case HttpResponseCode::FORBIDDEN:
- error = AWSError<CoreErrors>(CoreErrors::ACCESS_DENIED, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::ACCESS_DENIED, retryable);
+ break;
case HttpResponseCode::NOT_FOUND:
- error = AWSError<CoreErrors>(CoreErrors::RESOURCE_NOT_FOUND, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::RESOURCE_NOT_FOUND, retryable);
+ break;
case HttpResponseCode::TOO_MANY_REQUESTS:
- error = AWSError<CoreErrors>(CoreErrors::SLOW_DOWN, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::SLOW_DOWN, retryable);
+ break;
case HttpResponseCode::INTERNAL_SERVER_ERROR:
- error = AWSError<CoreErrors>(CoreErrors::INTERNAL_FAILURE, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::INTERNAL_FAILURE, retryable);
+ break;
case HttpResponseCode::BANDWIDTH_LIMIT_EXCEEDED:
- error = AWSError<CoreErrors>(CoreErrors::THROTTLING, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::THROTTLING, retryable);
+ break;
case HttpResponseCode::SERVICE_UNAVAILABLE:
- error = AWSError<CoreErrors>(CoreErrors::SERVICE_UNAVAILABLE, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::SERVICE_UNAVAILABLE, retryable);
+ break;
case HttpResponseCode::REQUEST_TIMEOUT:
case HttpResponseCode::AUTHENTICATION_TIMEOUT:
case HttpResponseCode::LOGIN_TIMEOUT:
case HttpResponseCode::GATEWAY_TIMEOUT:
case HttpResponseCode::NETWORK_READ_TIMEOUT:
case HttpResponseCode::NETWORK_CONNECT_TIMEOUT:
- error = AWSError<CoreErrors>(CoreErrors::REQUEST_TIMEOUT, retryable);
- break;
+ error = AWSError<CoreErrors>(CoreErrors::REQUEST_TIMEOUT, retryable);
+ break;
default:
int codeValue = static_cast<int>(code);
- error = AWSError<CoreErrors>(CoreErrors::UNKNOWN, codeValue >= 500 && codeValue < 600);
+ error = AWSError<CoreErrors>(CoreErrors::UNKNOWN, codeValue >= 500 && codeValue < 600);
}
- error.SetResponseCode(code);
- return error;
+ error.SetResponseCode(code);
+ return error;
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/DefaultRetryStrategy.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/DefaultRetryStrategy.cpp
index 7bda42541d..7e57c79ffc 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/DefaultRetryStrategy.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/DefaultRetryStrategy.cpp
@@ -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/client/DefaultRetryStrategy.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/RetryStrategy.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/RetryStrategy.cpp
index f66070220d..b439b7ca99 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/RetryStrategy.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/RetryStrategy.cpp
@@ -1,102 +1,102 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-
-#include <aws/core/client/RetryStrategy.h>
-
-#include <aws/core/client/AWSError.h>
-#include <aws/core/client/CoreErrors.h>
-#include <aws/core/utils/Outcome.h>
-
-using namespace Aws::Utils::Threading;
-
-namespace Aws
-{
- namespace Client
- {
- static const int INITIAL_RETRY_TOKENS = 500;
- static const int RETRY_COST = 5;
- static const int NO_RETRY_INCREMENT = 1;
- static const int TIMEOUT_RETRY_COST = 10;
-
- StandardRetryStrategy::StandardRetryStrategy(long maxAttempts) :
- m_retryQuotaContainer(Aws::MakeShared<DefaultRetryQuotaContainer>("StandardRetryStrategy")),
- m_maxAttempts(maxAttempts)
- {}
-
- StandardRetryStrategy::StandardRetryStrategy(std::shared_ptr<RetryQuotaContainer> retryQuotaContainer, long maxAttempts) :
- m_retryQuotaContainer(retryQuotaContainer),
- m_maxAttempts(maxAttempts)
- {}
-
- void StandardRetryStrategy::RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome)
- {
- if (httpResponseOutcome.IsSuccess())
- {
- m_retryQuotaContainer->ReleaseRetryQuota(NO_RETRY_INCREMENT);
- }
- }
-
- void StandardRetryStrategy::RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome, const AWSError<CoreErrors>& lastError)
- {
- if (httpResponseOutcome.IsSuccess())
- {
- m_retryQuotaContainer->ReleaseRetryQuota(lastError);
- }
- }
-
- bool StandardRetryStrategy::ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
- {
- if (!error.ShouldRetry())
- return false;
-
- if (attemptedRetries + 1 >= m_maxAttempts)
- return false;
-
- return m_retryQuotaContainer->AcquireRetryQuota(error);
- }
-
- long StandardRetryStrategy::CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
- {
- AWS_UNREFERENCED_PARAM(error);
- return (std::min)(rand() % 1000 * (1 << attemptedRetries), 20000);
- }
-
- DefaultRetryQuotaContainer::DefaultRetryQuotaContainer() : m_retryQuota(INITIAL_RETRY_TOKENS)
- {}
-
- bool DefaultRetryQuotaContainer::AcquireRetryQuota(int capacityAmount)
- {
- WriterLockGuard guard(m_retryQuotaLock);
-
- if (capacityAmount > m_retryQuota)
- {
- return false;
- }
- else
- {
- m_retryQuota -= capacityAmount;
- return true;
- }
- }
-
- bool DefaultRetryQuotaContainer::AcquireRetryQuota(const AWSError<CoreErrors>& error)
- {
- int capacityAmount = error.GetErrorType() == CoreErrors::REQUEST_TIMEOUT ? TIMEOUT_RETRY_COST : RETRY_COST;
- return AcquireRetryQuota(capacityAmount);
- }
-
- void DefaultRetryQuotaContainer::ReleaseRetryQuota(int capacityAmount)
- {
- WriterLockGuard guard(m_retryQuotaLock);
- m_retryQuota = (std::min)(m_retryQuota + capacityAmount, INITIAL_RETRY_TOKENS);
- }
-
- void DefaultRetryQuotaContainer::ReleaseRetryQuota(const AWSError<CoreErrors>& error)
- {
- int capacityAmount = error.GetErrorType() == CoreErrors::REQUEST_TIMEOUT ? TIMEOUT_RETRY_COST : RETRY_COST;
- ReleaseRetryQuota(capacityAmount);
- }
- }
-} \ No newline at end of file
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+#include <aws/core/client/RetryStrategy.h>
+
+#include <aws/core/client/AWSError.h>
+#include <aws/core/client/CoreErrors.h>
+#include <aws/core/utils/Outcome.h>
+
+using namespace Aws::Utils::Threading;
+
+namespace Aws
+{
+ namespace Client
+ {
+ static const int INITIAL_RETRY_TOKENS = 500;
+ static const int RETRY_COST = 5;
+ static const int NO_RETRY_INCREMENT = 1;
+ static const int TIMEOUT_RETRY_COST = 10;
+
+ StandardRetryStrategy::StandardRetryStrategy(long maxAttempts) :
+ m_retryQuotaContainer(Aws::MakeShared<DefaultRetryQuotaContainer>("StandardRetryStrategy")),
+ m_maxAttempts(maxAttempts)
+ {}
+
+ StandardRetryStrategy::StandardRetryStrategy(std::shared_ptr<RetryQuotaContainer> retryQuotaContainer, long maxAttempts) :
+ m_retryQuotaContainer(retryQuotaContainer),
+ m_maxAttempts(maxAttempts)
+ {}
+
+ void StandardRetryStrategy::RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome)
+ {
+ if (httpResponseOutcome.IsSuccess())
+ {
+ m_retryQuotaContainer->ReleaseRetryQuota(NO_RETRY_INCREMENT);
+ }
+ }
+
+ void StandardRetryStrategy::RequestBookkeeping(const HttpResponseOutcome& httpResponseOutcome, const AWSError<CoreErrors>& lastError)
+ {
+ if (httpResponseOutcome.IsSuccess())
+ {
+ m_retryQuotaContainer->ReleaseRetryQuota(lastError);
+ }
+ }
+
+ bool StandardRetryStrategy::ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
+ {
+ if (!error.ShouldRetry())
+ return false;
+
+ if (attemptedRetries + 1 >= m_maxAttempts)
+ return false;
+
+ return m_retryQuotaContainer->AcquireRetryQuota(error);
+ }
+
+ long StandardRetryStrategy::CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
+ {
+ AWS_UNREFERENCED_PARAM(error);
+ return (std::min)(rand() % 1000 * (1 << attemptedRetries), 20000);
+ }
+
+ DefaultRetryQuotaContainer::DefaultRetryQuotaContainer() : m_retryQuota(INITIAL_RETRY_TOKENS)
+ {}
+
+ bool DefaultRetryQuotaContainer::AcquireRetryQuota(int capacityAmount)
+ {
+ WriterLockGuard guard(m_retryQuotaLock);
+
+ if (capacityAmount > m_retryQuota)
+ {
+ return false;
+ }
+ else
+ {
+ m_retryQuota -= capacityAmount;
+ return true;
+ }
+ }
+
+ bool DefaultRetryQuotaContainer::AcquireRetryQuota(const AWSError<CoreErrors>& error)
+ {
+ int capacityAmount = error.GetErrorType() == CoreErrors::REQUEST_TIMEOUT ? TIMEOUT_RETRY_COST : RETRY_COST;
+ return AcquireRetryQuota(capacityAmount);
+ }
+
+ void DefaultRetryQuotaContainer::ReleaseRetryQuota(int capacityAmount)
+ {
+ WriterLockGuard guard(m_retryQuotaLock);
+ m_retryQuota = (std::min)(m_retryQuota + capacityAmount, INITIAL_RETRY_TOKENS);
+ }
+
+ void DefaultRetryQuotaContainer::ReleaseRetryQuota(const AWSError<CoreErrors>& error)
+ {
+ int capacityAmount = error.GetErrorType() == CoreErrors::REQUEST_TIMEOUT ? TIMEOUT_RETRY_COST : RETRY_COST;
+ ReleaseRetryQuota(capacityAmount);
+ }
+ }
+} \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/SpecifiedRetryableErrorsRetryStrategy.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/SpecifiedRetryableErrorsRetryStrategy.cpp
index 007743c322..ec4e373304 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/SpecifiedRetryableErrorsRetryStrategy.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/client/SpecifiedRetryableErrorsRetryStrategy.cpp
@@ -1,28 +1,28 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-
-#include <aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h>
-
-#include <aws/core/client/AWSError.h>
-
-using namespace Aws;
-using namespace Aws::Client;
-
-bool SpecifiedRetryableErrorsRetryStrategy::ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
-{
- if (attemptedRetries >= m_maxRetries)
- {
- return false;
- }
- for (const auto& err: m_specifiedRetryableErrors)
- {
- if (error.GetExceptionName() == err)
- {
- return true;
- }
- }
-
- return error.ShouldRetry();
-}
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+#include <aws/core/client/SpecifiedRetryableErrorsRetryStrategy.h>
+
+#include <aws/core/client/AWSError.h>
+
+using namespace Aws;
+using namespace Aws::Client;
+
+bool SpecifiedRetryableErrorsRetryStrategy::ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const
+{
+ if (attemptedRetries >= m_maxRetries)
+ {
+ return false;
+ }
+ for (const auto& err: m_specifiedRetryableErrors)
+ {
+ if (error.GetExceptionName() == err)
+ {
+ return true;
+ }
+ }
+
+ return error.ShouldRetry();
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/config/AWSProfileConfigLoader.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/config/AWSProfileConfigLoader.cpp
index 5c99d1c83b..9ec2e54f55 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/config/AWSProfileConfigLoader.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/config/AWSProfileConfigLoader.cpp
@@ -1,11 +1,11 @@
-/**
- * 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/config/AWSProfileConfigLoader.h>
#include <aws/core/internal/AWSHttpResourceClient.h>
-#include <aws/core/auth/AWSCredentialsProvider.h>
+#include <aws/core/auth/AWSCredentialsProvider.h>
#include <aws/core/utils/memory/stl/AWSList.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/StringUtils.h>
@@ -21,24 +21,24 @@ namespace Aws
using namespace Aws::Auth;
static const char* const CONFIG_LOADER_TAG = "Aws::Config::AWSProfileConfigLoader";
- #ifdef _MSC_VER
- // VS2015 compiler's bug, warning s_CoreErrorsMapper: symbol will be dynamically initialized (implementation limitation)
- AWS_SUPPRESS_WARNING(4592,
- static Aws::UniquePtr<ConfigAndCredentialsCacheManager> s_configManager(nullptr);
- )
- #else
- static Aws::UniquePtr<ConfigAndCredentialsCacheManager> s_configManager(nullptr);
- #endif
-
- static const char CONFIG_CREDENTIALS_CACHE_MANAGER_TAG[] = "ConfigAndCredentialsCacheManager";
-
+ #ifdef _MSC_VER
+ // VS2015 compiler's bug, warning s_CoreErrorsMapper: symbol will be dynamically initialized (implementation limitation)
+ AWS_SUPPRESS_WARNING(4592,
+ static Aws::UniquePtr<ConfigAndCredentialsCacheManager> s_configManager(nullptr);
+ )
+ #else
+ static Aws::UniquePtr<ConfigAndCredentialsCacheManager> s_configManager(nullptr);
+ #endif
+
+ static const char CONFIG_CREDENTIALS_CACHE_MANAGER_TAG[] = "ConfigAndCredentialsCacheManager";
+
bool AWSProfileConfigLoader::Load()
{
if(LoadInternal())
{
AWS_LOGSTREAM_INFO(CONFIG_LOADER_TAG, "Successfully reloaded configuration.");
m_lastLoadTime = DateTime::Now();
- AWS_LOGSTREAM_TRACE(CONFIG_LOADER_TAG, "reloaded config at "
+ AWS_LOGSTREAM_TRACE(CONFIG_LOADER_TAG, "reloaded config at "
<< m_lastLoadTime.ToGmtString(DateFormat::ISO_8601));
return true;
}
@@ -54,7 +54,7 @@ namespace Aws
AWS_LOGSTREAM_INFO(CONFIG_LOADER_TAG, "Successfully persisted configuration.");
m_profiles = profiles;
m_lastLoadTime = DateTime::Now();
- AWS_LOGSTREAM_TRACE(CONFIG_LOADER_TAG, "persisted config at "
+ AWS_LOGSTREAM_TRACE(CONFIG_LOADER_TAG, "persisted config at "
<< m_lastLoadTime.ToGmtString(DateFormat::ISO_8601));
return true;
}
@@ -63,19 +63,19 @@ namespace Aws
return false;
}
- static const char REGION_KEY[] = "region";
- static const char ACCESS_KEY_ID_KEY[] = "aws_access_key_id";
- static const char SECRET_KEY_KEY[] = "aws_secret_access_key";
- static const char SESSION_TOKEN_KEY[] = "aws_session_token";
- static const char ROLE_ARN_KEY[] = "role_arn";
- static const char EXTERNAL_ID_KEY[] = "external_id";
- static const char CREDENTIAL_PROCESS_COMMAND[] = "credential_process";
- static const char SOURCE_PROFILE_KEY[] = "source_profile";
- static const char PROFILE_PREFIX[] = "profile ";
- static const char EQ = '=';
- static const char LEFT_BRACKET = '[';
- static const char RIGHT_BRACKET = ']';
- static const char PARSER_TAG[] = "Aws::Config::ConfigFileProfileFSM";
+ static const char REGION_KEY[] = "region";
+ static const char ACCESS_KEY_ID_KEY[] = "aws_access_key_id";
+ static const char SECRET_KEY_KEY[] = "aws_secret_access_key";
+ static const char SESSION_TOKEN_KEY[] = "aws_session_token";
+ static const char ROLE_ARN_KEY[] = "role_arn";
+ static const char EXTERNAL_ID_KEY[] = "external_id";
+ static const char CREDENTIAL_PROCESS_COMMAND[] = "credential_process";
+ static const char SOURCE_PROFILE_KEY[] = "source_profile";
+ static const char PROFILE_PREFIX[] = "profile ";
+ static const char EQ = '=';
+ static const char LEFT_BRACKET = '[';
+ static const char RIGHT_BRACKET = ']';
+ static const char PARSER_TAG[] = "Aws::Config::ConfigFileProfileFSM";
class ConfigFileProfileFSM
{
@@ -179,7 +179,7 @@ namespace Aws
if (sessionTokenIter != m_profileKeyValuePairs.end())
{
sessionToken = sessionTokenIter->second;
- }
+ }
profile.SetCredentials(Aws::Auth::AWSCredentials(accessKey, secretKey, sessionToken));
}
@@ -245,7 +245,7 @@ namespace Aws
AWSConfigFileProfileConfigLoader::AWSConfigFileProfileConfigLoader(const Aws::String& fileName, bool useProfilePrefix) :
m_fileName(fileName), m_useProfilePrefix(useProfilePrefix)
{
- AWS_LOGSTREAM_INFO(CONFIG_FILE_LOADER, "Initializing config loader against fileName "
+ AWS_LOGSTREAM_INFO(CONFIG_FILE_LOADER, "Initializing config loader against fileName "
<< fileName << " and using profilePrefix = " << useProfilePrefix);
}
@@ -325,14 +325,14 @@ namespace Aws
bool EC2InstanceProfileConfigLoader::LoadInternal()
{
- auto credentialsStr = m_ec2metadataClient->GetDefaultCredentialsSecurely();
+ auto credentialsStr = m_ec2metadataClient->GetDefaultCredentialsSecurely();
if(credentialsStr.empty()) return false;
Json::JsonValue credentialsDoc(credentialsStr);
- if (!credentialsDoc.WasParseSuccessful())
+ if (!credentialsDoc.WasParseSuccessful())
{
- AWS_LOGSTREAM_ERROR(EC2_INSTANCE_PROFILE_LOG_TAG,
- "Failed to parse output from EC2MetadataService.");
+ AWS_LOGSTREAM_ERROR(EC2_INSTANCE_PROFILE_LOG_TAG,
+ "Failed to parse output from EC2MetadataService.");
return false;
}
const char* accessKeyId = "AccessKeyId";
@@ -341,7 +341,7 @@ namespace Aws
auto credentialsView = credentialsDoc.View();
accessKey = credentialsView.GetString(accessKeyId);
- AWS_LOGSTREAM_INFO(EC2_INSTANCE_PROFILE_LOG_TAG,
+ AWS_LOGSTREAM_INFO(EC2_INSTANCE_PROFILE_LOG_TAG,
"Successfully pulled credentials from metadata service with access key " << accessKey);
secretKey = credentialsView.GetString(secretAccessKey);
@@ -359,182 +359,182 @@ namespace Aws
return true;
}
- ConfigAndCredentialsCacheManager::ConfigAndCredentialsCacheManager() :
- m_credentialsFileLoader(Aws::Auth::ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename()),
- m_configFileLoader(Aws::Auth::GetConfigProfileFilename(), true/*use profile prefix*/)
- {
- ReloadCredentialsFile();
- ReloadConfigFile();
- }
-
- void ConfigAndCredentialsCacheManager::ReloadConfigFile()
- {
- Aws::Utils::Threading::WriterLockGuard guard(m_configLock);
- m_configFileLoader.SetFileName(Aws::Auth::GetConfigProfileFilename());
- m_configFileLoader.Load();
- }
-
- void ConfigAndCredentialsCacheManager::ReloadCredentialsFile()
- {
- Aws::Utils::Threading::WriterLockGuard guard(m_credentialsLock);
- m_credentialsFileLoader.SetFileName(Aws::Auth::ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename());
- m_credentialsFileLoader.Load();
- }
-
- bool ConfigAndCredentialsCacheManager::HasConfigProfile(const Aws::String& profileName) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
- return (m_configFileLoader.GetProfiles().count(profileName) == 1);
- }
-
- Aws::Config::Profile ConfigAndCredentialsCacheManager::GetConfigProfile(const Aws::String& profileName) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
- const auto& profiles = m_configFileLoader.GetProfiles();
- const auto &iter = profiles.find(profileName);
- if (iter == profiles.end())
- {
- return {};
- }
- return iter->second;
- }
-
- Aws::Map<Aws::String, Aws::Config::Profile> ConfigAndCredentialsCacheManager::GetConfigProfiles() const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
- return m_configFileLoader.GetProfiles();
- }
-
- Aws::String ConfigAndCredentialsCacheManager::GetConfig(const Aws::String& profileName, const Aws::String& key) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
- const auto& profiles = m_configFileLoader.GetProfiles();
- const auto &iter = profiles.find(profileName);
- if (iter == profiles.end())
- {
- return {};
- }
- return iter->second.GetValue(key);
- }
-
- bool ConfigAndCredentialsCacheManager::HasCredentialsProfile(const Aws::String& profileName) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
- return (m_credentialsFileLoader.GetProfiles().count(profileName) == 1);
- }
-
- Aws::Config::Profile ConfigAndCredentialsCacheManager::GetCredentialsProfile(const Aws::String& profileName) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
- const auto &profiles = m_credentialsFileLoader.GetProfiles();
- const auto &iter = profiles.find(profileName);
- if (iter == profiles.end())
- {
- return {};
- }
- return iter->second;
- }
-
- Aws::Map<Aws::String, Aws::Config::Profile> ConfigAndCredentialsCacheManager::GetCredentialsProfiles() const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
- return m_credentialsFileLoader.GetProfiles();
- }
-
- Aws::Auth::AWSCredentials ConfigAndCredentialsCacheManager::GetCredentials(const Aws::String& profileName) const
- {
- Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
- const auto& profiles = m_credentialsFileLoader.GetProfiles();
- const auto &iter = profiles.find(profileName);
- if (iter == profiles.end())
- {
- return {};
- }
- return iter->second.GetCredentials();
- }
-
- void InitConfigAndCredentialsCacheManager()
- {
- if (s_configManager)
- {
- return;
- }
- s_configManager = Aws::MakeUnique<ConfigAndCredentialsCacheManager>(CONFIG_CREDENTIALS_CACHE_MANAGER_TAG);
- }
-
- void CleanupConfigAndCredentialsCacheManager()
- {
- if (!s_configManager)
- {
- return;
- }
- s_configManager = nullptr;
- }
-
- void ReloadCachedConfigFile()
- {
- assert(s_configManager);
- s_configManager->ReloadConfigFile();
- }
-
- void ReloadCachedCredentialsFile()
- {
- assert(s_configManager);
- s_configManager->ReloadCredentialsFile();
- }
-
- bool HasCachedConfigProfile(const Aws::String& profileName)
- {
- assert(s_configManager);
- return s_configManager->HasConfigProfile(profileName);
- }
-
- Aws::Config::Profile GetCachedConfigProfile(const Aws::String& profileName)
- {
- assert(s_configManager);
- return s_configManager->GetConfigProfile(profileName);
- }
-
- Aws::Map<Aws::String, Aws::Config::Profile> GetCachedConfigProfiles()
- {
- assert(s_configManager);
- return s_configManager->GetConfigProfiles();
- }
-
- Aws::String GetCachedConfigValue(const Aws::String &profileName, const Aws::String &key)
- {
- assert(s_configManager);
- return s_configManager->GetConfig(profileName, key);
- }
-
- Aws::String GetCachedConfigValue(const Aws::String &key)
- {
- assert(s_configManager);
- return s_configManager->GetConfig(Aws::Auth::GetConfigProfileName(), key);
- }
-
- bool HasCachedCredentialsProfile(const Aws::String& profileName)
- {
- assert(s_configManager);
- return s_configManager->HasCredentialsProfile(profileName);
- }
-
- Aws::Config::Profile GetCachedCredentialsProfile(const Aws::String &profileName)
- {
- assert(s_configManager);
- return s_configManager->GetCredentialsProfile(profileName);
- }
-
- Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles()
- {
- assert(s_configManager);
- return s_configManager->GetCredentialsProfiles();
- }
-
- Aws::Auth::AWSCredentials GetCachedCredentials(const Aws::String &profileName)
- {
- assert(s_configManager);
- return s_configManager->GetCredentials(profileName);
- }
+ ConfigAndCredentialsCacheManager::ConfigAndCredentialsCacheManager() :
+ m_credentialsFileLoader(Aws::Auth::ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename()),
+ m_configFileLoader(Aws::Auth::GetConfigProfileFilename(), true/*use profile prefix*/)
+ {
+ ReloadCredentialsFile();
+ ReloadConfigFile();
+ }
+
+ void ConfigAndCredentialsCacheManager::ReloadConfigFile()
+ {
+ Aws::Utils::Threading::WriterLockGuard guard(m_configLock);
+ m_configFileLoader.SetFileName(Aws::Auth::GetConfigProfileFilename());
+ m_configFileLoader.Load();
+ }
+
+ void ConfigAndCredentialsCacheManager::ReloadCredentialsFile()
+ {
+ Aws::Utils::Threading::WriterLockGuard guard(m_credentialsLock);
+ m_credentialsFileLoader.SetFileName(Aws::Auth::ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename());
+ m_credentialsFileLoader.Load();
+ }
+
+ bool ConfigAndCredentialsCacheManager::HasConfigProfile(const Aws::String& profileName) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
+ return (m_configFileLoader.GetProfiles().count(profileName) == 1);
+ }
+
+ Aws::Config::Profile ConfigAndCredentialsCacheManager::GetConfigProfile(const Aws::String& profileName) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
+ const auto& profiles = m_configFileLoader.GetProfiles();
+ const auto &iter = profiles.find(profileName);
+ if (iter == profiles.end())
+ {
+ return {};
+ }
+ return iter->second;
+ }
+
+ Aws::Map<Aws::String, Aws::Config::Profile> ConfigAndCredentialsCacheManager::GetConfigProfiles() const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
+ return m_configFileLoader.GetProfiles();
+ }
+
+ Aws::String ConfigAndCredentialsCacheManager::GetConfig(const Aws::String& profileName, const Aws::String& key) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_configLock);
+ const auto& profiles = m_configFileLoader.GetProfiles();
+ const auto &iter = profiles.find(profileName);
+ if (iter == profiles.end())
+ {
+ return {};
+ }
+ return iter->second.GetValue(key);
+ }
+
+ bool ConfigAndCredentialsCacheManager::HasCredentialsProfile(const Aws::String& profileName) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
+ return (m_credentialsFileLoader.GetProfiles().count(profileName) == 1);
+ }
+
+ Aws::Config::Profile ConfigAndCredentialsCacheManager::GetCredentialsProfile(const Aws::String& profileName) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
+ const auto &profiles = m_credentialsFileLoader.GetProfiles();
+ const auto &iter = profiles.find(profileName);
+ if (iter == profiles.end())
+ {
+ return {};
+ }
+ return iter->second;
+ }
+
+ Aws::Map<Aws::String, Aws::Config::Profile> ConfigAndCredentialsCacheManager::GetCredentialsProfiles() const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
+ return m_credentialsFileLoader.GetProfiles();
+ }
+
+ Aws::Auth::AWSCredentials ConfigAndCredentialsCacheManager::GetCredentials(const Aws::String& profileName) const
+ {
+ Aws::Utils::Threading::ReaderLockGuard guard(m_credentialsLock);
+ const auto& profiles = m_credentialsFileLoader.GetProfiles();
+ const auto &iter = profiles.find(profileName);
+ if (iter == profiles.end())
+ {
+ return {};
+ }
+ return iter->second.GetCredentials();
+ }
+
+ void InitConfigAndCredentialsCacheManager()
+ {
+ if (s_configManager)
+ {
+ return;
+ }
+ s_configManager = Aws::MakeUnique<ConfigAndCredentialsCacheManager>(CONFIG_CREDENTIALS_CACHE_MANAGER_TAG);
+ }
+
+ void CleanupConfigAndCredentialsCacheManager()
+ {
+ if (!s_configManager)
+ {
+ return;
+ }
+ s_configManager = nullptr;
+ }
+
+ void ReloadCachedConfigFile()
+ {
+ assert(s_configManager);
+ s_configManager->ReloadConfigFile();
+ }
+
+ void ReloadCachedCredentialsFile()
+ {
+ assert(s_configManager);
+ s_configManager->ReloadCredentialsFile();
+ }
+
+ bool HasCachedConfigProfile(const Aws::String& profileName)
+ {
+ assert(s_configManager);
+ return s_configManager->HasConfigProfile(profileName);
+ }
+
+ Aws::Config::Profile GetCachedConfigProfile(const Aws::String& profileName)
+ {
+ assert(s_configManager);
+ return s_configManager->GetConfigProfile(profileName);
+ }
+
+ Aws::Map<Aws::String, Aws::Config::Profile> GetCachedConfigProfiles()
+ {
+ assert(s_configManager);
+ return s_configManager->GetConfigProfiles();
+ }
+
+ Aws::String GetCachedConfigValue(const Aws::String &profileName, const Aws::String &key)
+ {
+ assert(s_configManager);
+ return s_configManager->GetConfig(profileName, key);
+ }
+
+ Aws::String GetCachedConfigValue(const Aws::String &key)
+ {
+ assert(s_configManager);
+ return s_configManager->GetConfig(Aws::Auth::GetConfigProfileName(), key);
+ }
+
+ bool HasCachedCredentialsProfile(const Aws::String& profileName)
+ {
+ assert(s_configManager);
+ return s_configManager->HasCredentialsProfile(profileName);
+ }
+
+ Aws::Config::Profile GetCachedCredentialsProfile(const Aws::String &profileName)
+ {
+ assert(s_configManager);
+ return s_configManager->GetCredentialsProfile(profileName);
+ }
+
+ Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles()
+ {
+ assert(s_configManager);
+ return s_configManager->GetCredentialsProfiles();
+ }
+
+ Aws::Auth::AWSCredentials GetCachedCredentials(const Aws::String &profileName)
+ {
+ assert(s_configManager);
+ return s_configManager->GetCredentials(profileName);
+ }
} // Config namespace
} // Aws namespace
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp
index 4d090ca9a8..2525976334 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp
@@ -269,7 +269,7 @@ static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_bu
unsigned char *after_end = NULL;
unsigned char number_c_string[64];
unsigned char decimal_point = get_decimal_point();
- bool isInteger = true;
+ bool isInteger = true;
size_t i = 0;
if ((input_buffer == NULL) || (input_buffer->content == NULL))
@@ -296,17 +296,17 @@ static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_bu
case '9':
case '+':
case '-':
- number_c_string[i] = buffer_at_offset(input_buffer)[i];
- break;
+ number_c_string[i] = buffer_at_offset(input_buffer)[i];
+ break;
case 'e':
case 'E':
number_c_string[i] = buffer_at_offset(input_buffer)[i];
- isInteger = false;
+ isInteger = false;
break;
case '.':
number_c_string[i] = decimal_point;
- isInteger = false;
+ isInteger = false;
break;
default:
@@ -323,12 +323,12 @@ loop_end:
}
item->valuedouble = number;
- // For integer which is out of the range of [INT_MIN, INT_MAX], it may lose precision if we cast it to double.
- // Instead, we keep the integer literal as a string.
- if (isInteger && (number > INT_MAX || number < INT_MIN))
- {
- item->valuestring = (char*)cJSON_strdup(number_c_string, &global_hooks);
- }
+ // For integer which is out of the range of [INT_MIN, INT_MAX], it may lose precision if we cast it to double.
+ // Instead, we keep the integer literal as a string.
+ if (isInteger && (number > INT_MAX || number < INT_MIN))
+ {
+ item->valuestring = (char*)cJSON_strdup(number_c_string, &global_hooks);
+ }
/* use saturation in case of overflow */
if (number >= INT_MAX)
@@ -497,13 +497,13 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
return false;
}
- /* For integer which is out of the range of [INT_MIN, INT_MAX], valuestring is an integer literal. */
- if (item->valuestring)
- {
- length = sprintf((char*)number_buffer, "%s", item->valuestring);
- }
+ /* For integer which is out of the range of [INT_MIN, INT_MAX], valuestring is an integer literal. */
+ if (item->valuestring)
+ {
+ length = sprintf((char*)number_buffer, "%s", item->valuestring);
+ }
/* This checks for NaN and Infinity */
- else if ((d * 0) != 0)
+ else if ((d * 0) != 0)
{
length = sprintf((char*)number_buffer, "null");
}
@@ -520,7 +520,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
}
}
- /* sprintf failed or buffer overrun occurred */
+ /* sprintf failed or buffer overrun occurred */
if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1)))
{
return false;
@@ -1571,7 +1571,7 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu
buffer_skip_whitespace(input_buffer);
if (!parse_string(current_item, input_buffer))
{
- goto fail; /* failed to parse name */
+ goto fail; /* failed to parse name */
}
buffer_skip_whitespace(input_buffer);
@@ -2329,41 +2329,41 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num)
return item;
}
-CJSON_PUBLIC(cJSON *) cJSON_CreateInt64(long long num)
-{
- cJSON *item = cJSON_New_Item(&global_hooks);
- if(item)
- {
- item->type = cJSON_Number;
- item->valuedouble = static_cast<double>(num);
-
- // For integer which is out of the range of [INT_MIN, INT_MAX], it may lose precision if we cast it to double.
- // Instead, we keep the integer literal as a string.
- if (num > INT_MAX || num < INT_MIN)
- {
- char buf[21];
- sprintf(buf, "%lld", num);
- item->valuestring = (char*)cJSON_strdup((const unsigned char*)buf, &global_hooks);
- }
-
- /* use saturation in case of overflow */
- if (num >= INT_MAX)
- {
- item->valueint = INT_MAX;
- }
- else if (num <= INT_MIN)
- {
- item->valueint = INT_MIN;
- }
- else
- {
- item->valueint = (int)num;
- }
- }
-
- return item;
-}
-
+CJSON_PUBLIC(cJSON *) cJSON_CreateInt64(long long num)
+{
+ cJSON *item = cJSON_New_Item(&global_hooks);
+ if(item)
+ {
+ item->type = cJSON_Number;
+ item->valuedouble = static_cast<double>(num);
+
+ // For integer which is out of the range of [INT_MIN, INT_MAX], it may lose precision if we cast it to double.
+ // Instead, we keep the integer literal as a string.
+ if (num > INT_MAX || num < INT_MIN)
+ {
+ char buf[21];
+ sprintf(buf, "%lld", num);
+ item->valuestring = (char*)cJSON_strdup((const unsigned char*)buf, &global_hooks);
+ }
+
+ /* use saturation in case of overflow */
+ if (num >= INT_MAX)
+ {
+ item->valueint = INT_MAX;
+ }
+ else if (num <= INT_MIN)
+ {
+ item->valueint = INT_MIN;
+ }
+ else
+ {
+ item->valueint = (int)num;
+ }
+ }
+
+ return item;
+}
+
CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
{
cJSON *item = cJSON_New_Item(&global_hooks);
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/tinyxml2/tinyxml2.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/tinyxml2/tinyxml2.cpp
index 0323c55d04..ebe0fd9eec 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/tinyxml2/tinyxml2.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/external/tinyxml2/tinyxml2.cpp
@@ -770,7 +770,7 @@ XMLNode::~XMLNode()
}
}
-const char* XMLNode::Value() const
+const char* XMLNode::Value() const
{
// Edge case: XMLDocuments don't have a Value. Return null.
if ( this->ToDocument() )
@@ -1339,12 +1339,12 @@ bool XMLUnknown::Accept( XMLVisitor* visitor ) const
// --------- XMLAttribute ---------- //
-const char* XMLAttribute::Name() const
+const char* XMLAttribute::Name() const
{
return _name.GetStr();
}
-const char* XMLAttribute::Value() const
+const char* XMLAttribute::Value() const
{
return _value.GetStr();
}
@@ -1531,42 +1531,42 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const
return 0;
}
-int XMLElement::IntAttribute(const char* name, int defaultValue) const
+int XMLElement::IntAttribute(const char* name, int defaultValue) const
{
int i = defaultValue;
QueryIntAttribute(name, &i);
return i;
}
-unsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const
+unsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const
{
unsigned i = defaultValue;
QueryUnsignedAttribute(name, &i);
return i;
}
-int64_t XMLElement::Int64Attribute(const char* name, int64_t defaultValue) const
+int64_t XMLElement::Int64Attribute(const char* name, int64_t defaultValue) const
{
int64_t i = defaultValue;
QueryInt64Attribute(name, &i);
return i;
}
-bool XMLElement::BoolAttribute(const char* name, bool defaultValue) const
+bool XMLElement::BoolAttribute(const char* name, bool defaultValue) const
{
bool b = defaultValue;
QueryBoolAttribute(name, &b);
return b;
}
-double XMLElement::DoubleAttribute(const char* name, double defaultValue) const
+double XMLElement::DoubleAttribute(const char* name, double defaultValue) const
{
double d = defaultValue;
QueryDoubleAttribute(name, &d);
return d;
}
-float XMLElement::FloatAttribute(const char* name, float defaultValue) const
+float XMLElement::FloatAttribute(const char* name, float defaultValue) const
{
float f = defaultValue;
QueryFloatAttribute(name, &f);
@@ -1593,7 +1593,7 @@ void XMLElement::SetText( const char* inText )
}
-void XMLElement::SetText( int v )
+void XMLElement::SetText( int v )
{
char buf[BUF_SIZE];
XMLUtil::ToStr( v, buf, BUF_SIZE );
@@ -1601,7 +1601,7 @@ void XMLElement::SetText( int v )
}
-void XMLElement::SetText( unsigned v )
+void XMLElement::SetText( unsigned v )
{
char buf[BUF_SIZE];
XMLUtil::ToStr( v, buf, BUF_SIZE );
@@ -1625,7 +1625,7 @@ void XMLElement::SetText( bool v )
}
-void XMLElement::SetText( float v )
+void XMLElement::SetText( float v )
{
char buf[BUF_SIZE];
XMLUtil::ToStr( v, buf, BUF_SIZE );
@@ -1633,7 +1633,7 @@ void XMLElement::SetText( float v )
}
-void XMLElement::SetText( double v )
+void XMLElement::SetText( double v )
{
char buf[BUF_SIZE];
XMLUtil::ToStr( v, buf, BUF_SIZE );
@@ -2061,7 +2061,7 @@ void XMLDocument::Clear()
_commentPool.Trace( "comment" );
_attributePool.Trace( "attribute" );
#endif
-
+
#ifdef DEBUG
if ( !hadError ) {
TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() );
@@ -2140,7 +2140,7 @@ static FILE* callfopen( const char* filepath, const char* mode )
#endif
return fp;
}
-
+
void XMLDocument::DeleteNode( XMLNode* node ) {
TIXMLASSERT( node );
TIXMLASSERT(node->_document == this );
@@ -2340,7 +2340,7 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ...
return errorName;
}
-const char* XMLDocument::ErrorStr() const
+const char* XMLDocument::ErrorStr() const
{
return _errorStr.Empty() ? "" : _errorStr.GetStr();
}
@@ -2798,5 +2798,5 @@ bool XMLPrinter::Visit( const XMLUnknown& unknown )
}
} // namespace tinyxml2
-} // namespace External
+} // namespace External
} // namespace Aws \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClient.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClient.cpp
index 2502464cd0..8542023393 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClient.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClient.cpp
@@ -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/http/HttpClient.h>
#include <aws/core/http/HttpRequest.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
index 7d19926475..a556e39a5d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpClientFactory.cpp
@@ -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.
+ */
+
#include <aws/core/http/HttpClientFactory.h>
#if ENABLE_CURL_CLIENT
@@ -34,11 +34,11 @@ namespace Aws
{
namespace Http
{
- static std::shared_ptr<HttpClientFactory>& GetHttpClientFactory()
- {
- static std::shared_ptr<HttpClientFactory> s_HttpClientFactory(nullptr);
- return s_HttpClientFactory;
- }
+ static std::shared_ptr<HttpClientFactory>& GetHttpClientFactory()
+ {
+ static std::shared_ptr<HttpClientFactory> s_HttpClientFactory(nullptr);
+ return s_HttpClientFactory;
+ }
static bool s_InitCleanupCurlFlag(false);
static bool s_InstallSigPipeHandler(false);
@@ -160,44 +160,44 @@ namespace Aws
void InitHttp()
{
- if(!GetHttpClientFactory())
+ if(!GetHttpClientFactory())
{
- GetHttpClientFactory() = Aws::MakeShared<DefaultHttpClientFactory>(HTTP_CLIENT_FACTORY_ALLOCATION_TAG);
+ GetHttpClientFactory() = Aws::MakeShared<DefaultHttpClientFactory>(HTTP_CLIENT_FACTORY_ALLOCATION_TAG);
}
- GetHttpClientFactory()->InitStaticState();
+ GetHttpClientFactory()->InitStaticState();
}
void CleanupHttp()
{
- if(GetHttpClientFactory())
+ if(GetHttpClientFactory())
{
- GetHttpClientFactory()->CleanupStaticState();
- GetHttpClientFactory() = nullptr;
+ GetHttpClientFactory()->CleanupStaticState();
+ GetHttpClientFactory() = nullptr;
}
}
void SetHttpClientFactory(const std::shared_ptr<HttpClientFactory>& factory)
{
CleanupHttp();
- GetHttpClientFactory() = factory;
+ GetHttpClientFactory() = factory;
}
std::shared_ptr<HttpClient> CreateHttpClient(const Aws::Client::ClientConfiguration& clientConfiguration)
{
- assert(GetHttpClientFactory());
- return GetHttpClientFactory()->CreateHttpClient(clientConfiguration);
+ assert(GetHttpClientFactory());
+ return GetHttpClientFactory()->CreateHttpClient(clientConfiguration);
}
std::shared_ptr<HttpRequest> CreateHttpRequest(const Aws::String& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory)
{
- assert(GetHttpClientFactory());
- return GetHttpClientFactory()->CreateHttpRequest(uri, method, streamFactory);
+ assert(GetHttpClientFactory());
+ return GetHttpClientFactory()->CreateHttpRequest(uri, method, streamFactory);
}
std::shared_ptr<HttpRequest> CreateHttpRequest(const URI& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory)
{
- assert(GetHttpClientFactory());
- return GetHttpClientFactory()->CreateHttpRequest(uri, method, streamFactory);
+ assert(GetHttpClientFactory());
+ return GetHttpClientFactory()->CreateHttpRequest(uri, method, streamFactory);
}
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpRequest.cpp
index 121f6f30c9..95cb626c22 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpRequest.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpRequest.cpp
@@ -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/http/HttpRequest.h>
@@ -10,28 +10,28 @@ namespace Aws
namespace Http
{
-const char DATE_HEADER[] = "date";
-const char AWS_DATE_HEADER[] = "X-Amz-Date";
-const char AWS_SECURITY_TOKEN[] = "X-Amz-Security-Token";
-const char ACCEPT_HEADER[] = "accept";
-const char ACCEPT_CHAR_SET_HEADER[] = "accept-charset";
-const char ACCEPT_ENCODING_HEADER[] = "accept-encoding";
-const char AUTHORIZATION_HEADER[] = "authorization";
-const char AWS_AUTHORIZATION_HEADER[] = "authorization";
-const char COOKIE_HEADER[] = "cookie";
-const char CONTENT_LENGTH_HEADER[] = "content-length";
-const char CONTENT_TYPE_HEADER[] = "content-type";
-const char TRANSFER_ENCODING_HEADER[] = "transfer-encoding";
-const char USER_AGENT_HEADER[] = "user-agent";
-const char VIA_HEADER[] = "via";
-const char HOST_HEADER[] = "host";
-const char AMZ_TARGET_HEADER[] = "x-amz-target";
-const char X_AMZ_EXPIRES_HEADER[] = "X-Amz-Expires";
-const char CONTENT_MD5_HEADER[] = "content-md5";
-const char API_VERSION_HEADER[] = "x-amz-api-version";
-const char SDK_INVOCATION_ID_HEADER[] = "amz-sdk-invocation-id";
-const char SDK_REQUEST_HEADER[] = "amz-sdk-request";
-const char CHUNKED_VALUE[] = "chunked";
+const char DATE_HEADER[] = "date";
+const char AWS_DATE_HEADER[] = "X-Amz-Date";
+const char AWS_SECURITY_TOKEN[] = "X-Amz-Security-Token";
+const char ACCEPT_HEADER[] = "accept";
+const char ACCEPT_CHAR_SET_HEADER[] = "accept-charset";
+const char ACCEPT_ENCODING_HEADER[] = "accept-encoding";
+const char AUTHORIZATION_HEADER[] = "authorization";
+const char AWS_AUTHORIZATION_HEADER[] = "authorization";
+const char COOKIE_HEADER[] = "cookie";
+const char CONTENT_LENGTH_HEADER[] = "content-length";
+const char CONTENT_TYPE_HEADER[] = "content-type";
+const char TRANSFER_ENCODING_HEADER[] = "transfer-encoding";
+const char USER_AGENT_HEADER[] = "user-agent";
+const char VIA_HEADER[] = "via";
+const char HOST_HEADER[] = "host";
+const char AMZ_TARGET_HEADER[] = "x-amz-target";
+const char X_AMZ_EXPIRES_HEADER[] = "X-Amz-Expires";
+const char CONTENT_MD5_HEADER[] = "content-md5";
+const char API_VERSION_HEADER[] = "x-amz-api-version";
+const char SDK_INVOCATION_ID_HEADER[] = "amz-sdk-invocation-id";
+const char SDK_REQUEST_HEADER[] = "amz-sdk-request";
+const char CHUNKED_VALUE[] = "chunked";
} // Http
} // Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpTypes.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpTypes.cpp
index feac9ff904..4d313e52f3 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpTypes.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/HttpTypes.cpp
@@ -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/http/HttpTypes.h>
#include <cassert>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/Scheme.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/Scheme.cpp
index f04aa145d3..5dcea06aab 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/Scheme.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/Scheme.cpp
@@ -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/http/Scheme.h>
#include <aws/core/utils/memory/stl/AWSString.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/URI.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/URI.cpp
index 2248219e54..a2239df54b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/URI.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/URI.cpp
@@ -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/http/URI.h>
@@ -131,8 +131,8 @@ Aws::String URI::URLEncodePathRFC3986(const Aws::String& path)
// RFC 3986 §2.2 Reserved characters
// NOTE: this implementation does not accurately implement the RFC on purpose to accommodate for
// discrepancies in the implementations of URL encoding between AWS services for legacy reasons.
- case '$': case '&': case ',':
- case ':': case '=': case '@':
+ case '$': case '&': case ',':
+ case ':': case '=': case '@':
ss << c;
break;
default:
@@ -161,42 +161,42 @@ Aws::String URI::URLEncodePath(const Aws::String& path)
}
//if the last character was also a slash, then add that back here.
- if (path.length() > 0 && path[path.length() - 1] == '/')
+ if (path.length() > 0 && path[path.length() - 1] == '/')
{
ss << '/';
}
- if (path.length() > 0 && path[0] != '/')
- {
- return ss.str().substr(1);
- }
- else
- {
- return ss.str();
- }
+ if (path.length() > 0 && path[0] != '/')
+ {
+ return ss.str().substr(1);
+ }
+ else
+ {
+ return ss.str();
+ }
}
void URI::SetPath(const Aws::String& value)
-{
- const Aws::Vector<Aws::String> pathParts = StringUtils::Split(value, '/');
- Aws::String path;
- path.reserve(value.length() + 1/* in case we have to append slash before the path. */);
-
- for (const auto& segment : pathParts)
- {
- path.push_back('/');
- path.append(segment);
- }
-
- if (value.back() == '/')
- {
- path.push_back('/');
- }
- m_path = std::move(path);
+{
+ const Aws::Vector<Aws::String> pathParts = StringUtils::Split(value, '/');
+ Aws::String path;
+ path.reserve(value.length() + 1/* in case we have to append slash before the path. */);
+
+ for (const auto& segment : pathParts)
+ {
+ path.push_back('/');
+ path.append(segment);
+ }
+
+ if (value.back() == '/')
+ {
+ path.push_back('/');
+ }
+ m_path = std::move(path);
}
//ugh, this isn't even part of the canonicalization spec. It is part of how our services have implemented their signers though....
-//it doesn't really hurt anything to reorder it though, so go ahead and sort the values for parameters with the same key
+//it doesn't really hurt anything to reorder it though, so go ahead and sort the values for parameters with the same key
void InsertValueOrderedParameter(QueryStringParameterCollection& queryParams, const Aws::String& key, const Aws::String& value)
{
auto entriesAtKey = queryParams.equal_range(key);
@@ -204,7 +204,7 @@ void InsertValueOrderedParameter(QueryStringParameterCollection& queryParams, co
{
if (entry->second > value)
{
- queryParams.emplace_hint(entry, key, value);
+ queryParams.emplace_hint(entry, key, value);
return;
}
}
@@ -275,7 +275,7 @@ void URI::CanonicalizeQueryString()
queryStringStream << "?";
}
- if(m_queryString.find('=') != std::string::npos)
+ if(m_queryString.find('=') != std::string::npos)
{
for (QueryStringParameterCollection::iterator iter = sortedParameters.begin();
iter != sortedParameters.end(); ++iter)
@@ -320,7 +320,7 @@ void URI::SetQueryString(const Aws::String& str)
m_queryString = "";
if (str.empty()) return;
-
+
if (str.front() != '?')
{
m_queryString.append("?").append(str);
@@ -328,7 +328,7 @@ void URI::SetQueryString(const Aws::String& str)
else
{
m_queryString = str;
- }
+ }
}
Aws::String URI::GetURIString(bool includeQueryString) const
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp
index 840247ed94..1a965cd795 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp
@@ -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/http/curl/CurlHandleContainer.h>
#include <aws/core/utils/logging/LogMacros.h>
@@ -14,10 +14,10 @@ using namespace Aws::Http;
static const char* CURL_HANDLE_CONTAINER_TAG = "CurlHandleContainer";
-CurlHandleContainer::CurlHandleContainer(unsigned maxSize, long httpRequestTimeout, long connectTimeout, bool enableTcpKeepAlive,
- unsigned long tcpKeepAliveIntervalMs, long lowSpeedTime, unsigned long lowSpeedLimit) :
- m_maxPoolSize(maxSize), m_httpRequestTimeout(httpRequestTimeout), m_connectTimeout(connectTimeout), m_enableTcpKeepAlive(enableTcpKeepAlive),
- m_tcpKeepAliveIntervalMs(tcpKeepAliveIntervalMs), m_lowSpeedTime(lowSpeedTime), m_lowSpeedLimit(lowSpeedLimit), m_poolSize(0)
+CurlHandleContainer::CurlHandleContainer(unsigned maxSize, long httpRequestTimeout, long connectTimeout, bool enableTcpKeepAlive,
+ unsigned long tcpKeepAliveIntervalMs, long lowSpeedTime, unsigned long lowSpeedLimit) :
+ m_maxPoolSize(maxSize), m_httpRequestTimeout(httpRequestTimeout), m_connectTimeout(connectTimeout), m_enableTcpKeepAlive(enableTcpKeepAlive),
+ m_tcpKeepAliveIntervalMs(tcpKeepAliveIntervalMs), m_lowSpeedTime(lowSpeedTime), m_lowSpeedLimit(lowSpeedLimit), m_poolSize(0)
{
AWS_LOGSTREAM_INFO(CURL_HANDLE_CONTAINER_TAG, "Initializing CurlHandleContainer with size " << maxSize);
}
@@ -60,45 +60,45 @@ void CurlHandleContainer::ReleaseCurlHandle(CURL* handle)
}
}
-void CurlHandleContainer::DestroyCurlHandle(CURL* handle)
-{
- if (!handle)
- {
- return;
- }
-
- curl_easy_cleanup(handle);
- AWS_LOGSTREAM_DEBUG(CURL_HANDLE_CONTAINER_TAG, "Destroy curl handle: " << handle);
- {
- std::lock_guard<std::mutex> locker(m_containerLock);
- // Other threads could be blocked and waiting on m_handleContainer.Acquire()
- // If the handle is not released back to the pool, it could create a deadlock
- // Create a new handle and release that into the pool
- handle = CreateCurlHandleInPool();
- }
- if (handle)
- {
- AWS_LOGSTREAM_DEBUG(CURL_HANDLE_CONTAINER_TAG, "Created replacement handle and released to pool: " << handle);
- }
-}
-
-
-CURL* CurlHandleContainer::CreateCurlHandleInPool()
-{
- CURL* curlHandle = curl_easy_init();
-
- if (curlHandle)
- {
- SetDefaultOptionsOnHandle(curlHandle);
- m_handleContainer.Release(curlHandle);
- }
- else
- {
- AWS_LOGSTREAM_ERROR(CURL_HANDLE_CONTAINER_TAG, "curl_easy_init failed to allocate.");
- }
- return curlHandle;
-}
-
+void CurlHandleContainer::DestroyCurlHandle(CURL* handle)
+{
+ if (!handle)
+ {
+ return;
+ }
+
+ curl_easy_cleanup(handle);
+ AWS_LOGSTREAM_DEBUG(CURL_HANDLE_CONTAINER_TAG, "Destroy curl handle: " << handle);
+ {
+ std::lock_guard<std::mutex> locker(m_containerLock);
+ // Other threads could be blocked and waiting on m_handleContainer.Acquire()
+ // If the handle is not released back to the pool, it could create a deadlock
+ // Create a new handle and release that into the pool
+ handle = CreateCurlHandleInPool();
+ }
+ if (handle)
+ {
+ AWS_LOGSTREAM_DEBUG(CURL_HANDLE_CONTAINER_TAG, "Created replacement handle and released to pool: " << handle);
+ }
+}
+
+
+CURL* CurlHandleContainer::CreateCurlHandleInPool()
+{
+ CURL* curlHandle = curl_easy_init();
+
+ if (curlHandle)
+ {
+ SetDefaultOptionsOnHandle(curlHandle);
+ m_handleContainer.Release(curlHandle);
+ }
+ else
+ {
+ AWS_LOGSTREAM_ERROR(CURL_HANDLE_CONTAINER_TAG, "curl_easy_init failed to allocate.");
+ }
+ return curlHandle;
+}
+
bool CurlHandleContainer::CheckAndGrowPool()
{
std::lock_guard<std::mutex> locker(m_containerLock);
@@ -111,7 +111,7 @@ bool CurlHandleContainer::CheckAndGrowPool()
unsigned actuallyAdded = 0;
for (unsigned i = 0; i < amountToAdd; ++i)
{
- CURL* curlHandle = CreateCurlHandleInPool();
+ CURL* curlHandle = CreateCurlHandleInPool();
if (curlHandle)
{
@@ -140,13 +140,13 @@ void CurlHandleContainer::SetDefaultOptionsOnHandle(CURL* handle)
//always turn signals off. This also forces dns queries to
//not be included in the timeout calculations.
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);
- curl_easy_setopt(handle, CURLOPT_TIMEOUT_MS, m_httpRequestTimeout);
+ curl_easy_setopt(handle, CURLOPT_TIMEOUT_MS, m_httpRequestTimeout);
curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT_MS, m_connectTimeout);
- curl_easy_setopt(handle, CURLOPT_LOW_SPEED_LIMIT, m_lowSpeedLimit);
- curl_easy_setopt(handle, CURLOPT_LOW_SPEED_TIME, m_lowSpeedTime < 1000 ? (m_lowSpeedTime == 0 ? 0 : 1) : m_lowSpeedTime / 1000);
- curl_easy_setopt(handle, CURLOPT_TCP_KEEPALIVE, m_enableTcpKeepAlive ? 1L : 0L);
- curl_easy_setopt(handle, CURLOPT_TCP_KEEPINTVL, m_tcpKeepAliveIntervalMs / 1000);
- curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, m_tcpKeepAliveIntervalMs / 1000);
+ curl_easy_setopt(handle, CURLOPT_LOW_SPEED_LIMIT, m_lowSpeedLimit);
+ curl_easy_setopt(handle, CURLOPT_LOW_SPEED_TIME, m_lowSpeedTime < 1000 ? (m_lowSpeedTime == 0 ? 0 : 1) : m_lowSpeedTime / 1000);
+ curl_easy_setopt(handle, CURLOPT_TCP_KEEPALIVE, m_enableTcpKeepAlive ? 1L : 0L);
+ curl_easy_setopt(handle, CURLOPT_TCP_KEEPINTVL, m_tcpKeepAliveIntervalMs / 1000);
+ curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, m_tcpKeepAliveIntervalMs / 1000);
#ifdef CURL_HAS_H2
curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
#endif
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp
index ee03bea875..2fb9cc9643 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp
@@ -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/http/curl/CurlHttpClient.h>
#include <aws/core/http/HttpRequest.h>
@@ -123,8 +123,8 @@ static char* strdup_callback(const char* str)
struct CurlWriteCallbackContext
{
CurlWriteCallbackContext(const CurlHttpClient* client,
- HttpRequest* request,
- HttpResponse* response,
+ HttpRequest* request,
+ HttpResponse* response,
Aws::Utils::RateLimits::RateLimiterInterface* rateLimiter) :
m_client(client),
m_request(request),
@@ -149,171 +149,171 @@ struct CurlReadCallbackContext
{}
const CurlHttpClient* m_client;
- CURL* m_curlHandle;
+ CURL* m_curlHandle;
Aws::Utils::RateLimits::RateLimiterInterface* m_rateLimiter;
HttpRequest* m_request;
};
static const char* CURL_HTTP_CLIENT_TAG = "CurlHttpClient";
-static size_t WriteData(char* ptr, size_t size, size_t nmemb, void* userdata)
+static size_t WriteData(char* ptr, size_t size, size_t nmemb, void* userdata)
{
- if (ptr)
+ if (ptr)
+ {
+ CurlWriteCallbackContext* context = reinterpret_cast<CurlWriteCallbackContext*>(userdata);
+
+ const CurlHttpClient* client = context->m_client;
+ if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
+ {
+ return 0;
+ }
+
+ HttpResponse* response = context->m_response;
+ size_t sizeToWrite = size * nmemb;
+ if (context->m_rateLimiter)
+ {
+ context->m_rateLimiter->ApplyAndPayForCost(static_cast<int64_t>(sizeToWrite));
+ }
+
+ response->GetResponseBody().write(ptr, static_cast<std::streamsize>(sizeToWrite));
+ if (context->m_request->IsEventStreamRequest())
+ {
+ response->GetResponseBody().flush();
+ }
+ auto& receivedHandler = context->m_request->GetDataReceivedEventHandler();
+ if (receivedHandler)
+ {
+ receivedHandler(context->m_request, context->m_response, static_cast<long long>(sizeToWrite));
+ }
+
+ AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, sizeToWrite << " bytes written to response.");
+ context->m_numBytesResponseReceived += sizeToWrite;
+ return sizeToWrite;
+ }
+ return 0;
+}
+
+static size_t WriteHeader(char* ptr, size_t size, size_t nmemb, void* userdata)
+{
+ if (ptr)
+ {
+ CurlWriteCallbackContext* context = reinterpret_cast<CurlWriteCallbackContext*>(userdata);
+ AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, ptr);
+ HttpResponse* response = context->m_response;
+ Aws::String headerLine(ptr);
+ Aws::Vector<Aws::String> keyValuePair = StringUtils::Split(headerLine, ':', 2);
+
+ if (keyValuePair.size() == 2)
+ {
+ response->AddHeader(StringUtils::Trim(keyValuePair[0].c_str()), StringUtils::Trim(keyValuePair[1].c_str()));
+ }
+
+ return size * nmemb;
+ }
+ return 0;
+}
+
+
+static size_t ReadBody(char* ptr, size_t size, size_t nmemb, void* userdata)
+{
+ CurlReadCallbackContext* context = reinterpret_cast<CurlReadCallbackContext*>(userdata);
+ if(context == nullptr)
+ {
+ return 0;
+ }
+
+ const CurlHttpClient* client = context->m_client;
+ if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
+ {
+ return CURL_READFUNC_ABORT;
+ }
+
+ HttpRequest* request = context->m_request;
+ const std::shared_ptr<Aws::IOStream>& ioStream = request->GetContentBody();
+
+ const size_t amountToRead = size * nmemb;
+ if (ioStream != nullptr && amountToRead > 0)
+ {
+ if (request->IsEventStreamRequest())
+ {
+ // Waiting for next available character to read.
+ // Without peek(), readsome() will keep reading 0 byte from the stream.
+ ioStream->peek();
+ ioStream->readsome(ptr, amountToRead);
+ }
+ else
+ {
+ ioStream->read(ptr, amountToRead);
+ }
+ size_t amountRead = static_cast<size_t>(ioStream->gcount());
+ auto& sentHandler = request->GetDataSentEventHandler();
+ if (sentHandler)
+ {
+ sentHandler(request, static_cast<long long>(amountRead));
+ }
+
+ if (context->m_rateLimiter)
+ {
+ context->m_rateLimiter->ApplyAndPayForCost(static_cast<int64_t>(amountRead));
+ }
+
+ return amountRead;
+ }
+
+ return 0;
+}
+
+static size_t SeekBody(void* userdata, curl_off_t offset, int origin)
+{
+ CurlReadCallbackContext* context = reinterpret_cast<CurlReadCallbackContext*>(userdata);
+ if(context == nullptr)
+ {
+ return CURL_SEEKFUNC_FAIL;
+ }
+
+ const CurlHttpClient* client = context->m_client;
+ if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
+ {
+ return CURL_SEEKFUNC_FAIL;
+ }
+
+ HttpRequest* request = context->m_request;
+ const std::shared_ptr<Aws::IOStream>& ioStream = request->GetContentBody();
+
+ std::ios_base::seekdir dir;
+ switch(origin)
+ {
+ case SEEK_SET:
+ dir = std::ios_base::beg;
+ break;
+ case SEEK_CUR:
+ dir = std::ios_base::cur;
+ break;
+ case SEEK_END:
+ dir = std::ios_base::end;
+ break;
+ default:
+ return CURL_SEEKFUNC_FAIL;
+ }
+
+ ioStream->clear();
+ ioStream->seekg(offset, dir);
+ if (ioStream->fail()) {
+ return CURL_SEEKFUNC_CANTSEEK;
+ }
+
+ return CURL_SEEKFUNC_OK;
+}
+
+void SetOptCodeForHttpMethod(CURL* requestHandle, const std::shared_ptr<HttpRequest>& request)
+{
+ switch (request->GetMethod())
{
- CurlWriteCallbackContext* context = reinterpret_cast<CurlWriteCallbackContext*>(userdata);
-
- const CurlHttpClient* client = context->m_client;
- if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
- {
- return 0;
- }
-
- HttpResponse* response = context->m_response;
- size_t sizeToWrite = size * nmemb;
- if (context->m_rateLimiter)
- {
- context->m_rateLimiter->ApplyAndPayForCost(static_cast<int64_t>(sizeToWrite));
- }
-
- response->GetResponseBody().write(ptr, static_cast<std::streamsize>(sizeToWrite));
- if (context->m_request->IsEventStreamRequest())
- {
- response->GetResponseBody().flush();
- }
- auto& receivedHandler = context->m_request->GetDataReceivedEventHandler();
- if (receivedHandler)
- {
- receivedHandler(context->m_request, context->m_response, static_cast<long long>(sizeToWrite));
- }
-
- AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, sizeToWrite << " bytes written to response.");
- context->m_numBytesResponseReceived += sizeToWrite;
- return sizeToWrite;
- }
- return 0;
-}
-
-static size_t WriteHeader(char* ptr, size_t size, size_t nmemb, void* userdata)
-{
- if (ptr)
- {
- CurlWriteCallbackContext* context = reinterpret_cast<CurlWriteCallbackContext*>(userdata);
- AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, ptr);
- HttpResponse* response = context->m_response;
- Aws::String headerLine(ptr);
- Aws::Vector<Aws::String> keyValuePair = StringUtils::Split(headerLine, ':', 2);
-
- if (keyValuePair.size() == 2)
- {
- response->AddHeader(StringUtils::Trim(keyValuePair[0].c_str()), StringUtils::Trim(keyValuePair[1].c_str()));
- }
-
- return size * nmemb;
- }
- return 0;
-}
-
-
-static size_t ReadBody(char* ptr, size_t size, size_t nmemb, void* userdata)
-{
- CurlReadCallbackContext* context = reinterpret_cast<CurlReadCallbackContext*>(userdata);
- if(context == nullptr)
- {
- return 0;
- }
-
- const CurlHttpClient* client = context->m_client;
- if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
- {
- return CURL_READFUNC_ABORT;
- }
-
- HttpRequest* request = context->m_request;
- const std::shared_ptr<Aws::IOStream>& ioStream = request->GetContentBody();
-
- const size_t amountToRead = size * nmemb;
- if (ioStream != nullptr && amountToRead > 0)
- {
- if (request->IsEventStreamRequest())
- {
- // Waiting for next available character to read.
- // Without peek(), readsome() will keep reading 0 byte from the stream.
- ioStream->peek();
- ioStream->readsome(ptr, amountToRead);
- }
- else
- {
- ioStream->read(ptr, amountToRead);
- }
- size_t amountRead = static_cast<size_t>(ioStream->gcount());
- auto& sentHandler = request->GetDataSentEventHandler();
- if (sentHandler)
- {
- sentHandler(request, static_cast<long long>(amountRead));
- }
-
- if (context->m_rateLimiter)
- {
- context->m_rateLimiter->ApplyAndPayForCost(static_cast<int64_t>(amountRead));
- }
-
- return amountRead;
- }
-
- return 0;
-}
-
-static size_t SeekBody(void* userdata, curl_off_t offset, int origin)
-{
- CurlReadCallbackContext* context = reinterpret_cast<CurlReadCallbackContext*>(userdata);
- if(context == nullptr)
- {
- return CURL_SEEKFUNC_FAIL;
- }
-
- const CurlHttpClient* client = context->m_client;
- if(!client->ContinueRequest(*context->m_request) || !client->IsRequestProcessingEnabled())
- {
- return CURL_SEEKFUNC_FAIL;
- }
-
- HttpRequest* request = context->m_request;
- const std::shared_ptr<Aws::IOStream>& ioStream = request->GetContentBody();
-
- std::ios_base::seekdir dir;
- switch(origin)
- {
- case SEEK_SET:
- dir = std::ios_base::beg;
- break;
- case SEEK_CUR:
- dir = std::ios_base::cur;
- break;
- case SEEK_END:
- dir = std::ios_base::end;
- break;
- default:
- return CURL_SEEKFUNC_FAIL;
- }
-
- ioStream->clear();
- ioStream->seekg(offset, dir);
- if (ioStream->fail()) {
- return CURL_SEEKFUNC_CANTSEEK;
- }
-
- return CURL_SEEKFUNC_OK;
-}
-
-void SetOptCodeForHttpMethod(CURL* requestHandle, const std::shared_ptr<HttpRequest>& request)
-{
- switch (request->GetMethod())
- {
case HttpMethod::HTTP_GET:
curl_easy_setopt(requestHandle, CURLOPT_HTTPGET, 1L);
break;
case HttpMethod::HTTP_POST:
- if (request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER) && request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0")
+ if (request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER) && request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0")
{
curl_easy_setopt(requestHandle, CURLOPT_CUSTOMREQUEST, "POST");
}
@@ -323,8 +323,8 @@ void SetOptCodeForHttpMethod(CURL* requestHandle, const std::shared_ptr<HttpRequ
}
break;
case HttpMethod::HTTP_PUT:
- if ((!request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER) || request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0") &&
- !request->HasHeader(Aws::Http::TRANSFER_ENCODING_HEADER))
+ if ((!request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER) || request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0") &&
+ !request->HasHeader(Aws::Http::TRANSFER_ENCODING_HEADER))
{
curl_easy_setopt(requestHandle, CURLOPT_CUSTOMREQUEST, "PUT");
}
@@ -338,8 +338,8 @@ void SetOptCodeForHttpMethod(CURL* requestHandle, const std::shared_ptr<HttpRequ
curl_easy_setopt(requestHandle, CURLOPT_NOBODY, 1L);
break;
case HttpMethod::HTTP_PATCH:
- if ((!request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER)|| request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0") &&
- !request->HasHeader(Aws::Http::TRANSFER_ENCODING_HEADER))
+ if ((!request->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER)|| request->GetHeaderValue(Aws::Http::CONTENT_LENGTH_HEADER) == "0") &&
+ !request->HasHeader(Aws::Http::TRANSFER_ENCODING_HEADER))
{
curl_easy_setopt(requestHandle, CURLOPT_CUSTOMREQUEST, "PATCH");
}
@@ -367,9 +367,9 @@ void CurlHttpClient::InitGlobalState()
{
if (!isInit)
{
- auto curlVersionData = curl_version_info(CURLVERSION_NOW);
- AWS_LOGSTREAM_INFO(CURL_HTTP_CLIENT_TAG, "Initializing Curl library with version: " << curlVersionData->version
- << ", ssl version: " << curlVersionData->ssl_version);
+ auto curlVersionData = curl_version_info(CURLVERSION_NOW);
+ AWS_LOGSTREAM_INFO(CURL_HTTP_CLIENT_TAG, "Initializing Curl library with version: " << curlVersionData->version
+ << ", ssl version: " << curlVersionData->ssl_version);
isInit = true;
#ifdef AWS_CUSTOM_MEMORY_MANAGEMENT
curl_global_init_mem(CURL_GLOBAL_ALL, &malloc_callback, &free_callback, &realloc_callback, &strdup_callback, &calloc_callback);
@@ -435,48 +435,48 @@ int CurlDebugCallback(CURL *handle, curl_infotype type, char *data, size_t size,
CurlHttpClient::CurlHttpClient(const ClientConfiguration& clientConfig) :
- Base(),
- m_curlHandleContainer(clientConfig.maxConnections, clientConfig.httpRequestTimeoutMs, clientConfig.connectTimeoutMs, clientConfig.enableTcpKeepAlive,
- clientConfig.tcpKeepAliveIntervalMs, clientConfig.requestTimeoutMs, clientConfig.lowSpeedLimit),
+ Base(),
+ m_curlHandleContainer(clientConfig.maxConnections, clientConfig.httpRequestTimeoutMs, clientConfig.connectTimeoutMs, clientConfig.enableTcpKeepAlive,
+ clientConfig.tcpKeepAliveIntervalMs, clientConfig.requestTimeoutMs, clientConfig.lowSpeedLimit),
m_isUsingProxy(!clientConfig.proxyHost.empty()), m_proxyUserName(clientConfig.proxyUserName),
m_proxyPassword(clientConfig.proxyPassword), m_proxyScheme(SchemeMapper::ToString(clientConfig.proxyScheme)), m_proxyHost(clientConfig.proxyHost),
- m_proxySSLCertPath(clientConfig.proxySSLCertPath), m_proxySSLCertType(clientConfig.proxySSLCertType),
- m_proxySSLKeyPath(clientConfig.proxySSLKeyPath), m_proxySSLKeyType(clientConfig.proxySSLKeyType),
- m_proxyKeyPasswd(clientConfig.proxySSLKeyPassword),
+ m_proxySSLCertPath(clientConfig.proxySSLCertPath), m_proxySSLCertType(clientConfig.proxySSLCertType),
+ m_proxySSLKeyPath(clientConfig.proxySSLKeyPath), m_proxySSLKeyType(clientConfig.proxySSLKeyType),
+ m_proxyKeyPasswd(clientConfig.proxySSLKeyPassword),
m_proxyPort(clientConfig.proxyPort), m_verifySSL(clientConfig.verifySSL), m_caPath(clientConfig.caPath),
m_caFile(clientConfig.caFile), m_proxyCaPath(clientConfig.proxyCaPath), m_proxyCaFile(clientConfig.proxyCaFile),
- m_disableExpectHeader(clientConfig.disableExpectHeader)
+ m_disableExpectHeader(clientConfig.disableExpectHeader)
{
- if (clientConfig.followRedirects == FollowRedirectsPolicy::NEVER ||
- (clientConfig.followRedirects == FollowRedirectsPolicy::DEFAULT && clientConfig.region == Aws::Region::AWS_GLOBAL))
- {
- m_allowRedirects = false;
- }
- else
- {
- m_allowRedirects = true;
- }
+ if (clientConfig.followRedirects == FollowRedirectsPolicy::NEVER ||
+ (clientConfig.followRedirects == FollowRedirectsPolicy::DEFAULT && clientConfig.region == Aws::Region::AWS_GLOBAL))
+ {
+ m_allowRedirects = false;
+ }
+ else
+ {
+ m_allowRedirects = true;
+ }
}
-std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<HttpRequest>& request,
- Aws::Utils::RateLimits::RateLimiterInterface* readLimiter,
- Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter) const
+std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<HttpRequest>& request,
+ Aws::Utils::RateLimits::RateLimiterInterface* readLimiter,
+ Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter) const
{
- URI uri = request->GetUri();
+ URI uri = request->GetUri();
Aws::String url = uri.GetURIString();
- std::shared_ptr<HttpResponse> response = Aws::MakeShared<StandardHttpResponse>(CURL_HTTP_CLIENT_TAG, request);
+ std::shared_ptr<HttpResponse> response = Aws::MakeShared<StandardHttpResponse>(CURL_HTTP_CLIENT_TAG, request);
AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, "Making request to " << url);
struct curl_slist* headers = NULL;
if (writeLimiter != nullptr)
{
- writeLimiter->ApplyAndPayForCost(request->GetSize());
+ writeLimiter->ApplyAndPayForCost(request->GetSize());
}
Aws::StringStream headerStream;
- HeaderValueCollection requestHeaders = request->GetHeaders();
+ HeaderValueCollection requestHeaders = request->GetHeaders();
AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, "Including headers:");
for (auto& requestHeader : requestHeaders)
@@ -488,17 +488,17 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
headers = curl_slist_append(headers, headerString.c_str());
}
- if (!request->HasHeader(Http::TRANSFER_ENCODING_HEADER))
+ if (!request->HasHeader(Http::TRANSFER_ENCODING_HEADER))
+ {
+ headers = curl_slist_append(headers, "transfer-encoding:");
+ }
+
+ if (!request->HasHeader(Http::CONTENT_LENGTH_HEADER))
{
- headers = curl_slist_append(headers, "transfer-encoding:");
- }
-
- if (!request->HasHeader(Http::CONTENT_LENGTH_HEADER))
- {
headers = curl_slist_append(headers, "content-length:");
}
- if (!request->HasHeader(Http::CONTENT_TYPE_HEADER))
+ if (!request->HasHeader(Http::CONTENT_TYPE_HEADER))
{
headers = curl_slist_append(headers, "content-type:");
}
@@ -520,16 +520,16 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
curl_easy_setopt(connectionHandle, CURLOPT_HTTPHEADER, headers);
}
- CurlWriteCallbackContext writeContext(this, request.get(), response.get(), readLimiter);
- CurlReadCallbackContext readContext(this, request.get(), writeLimiter);
+ CurlWriteCallbackContext writeContext(this, request.get(), response.get(), readLimiter);
+ CurlReadCallbackContext readContext(this, request.get(), writeLimiter);
SetOptCodeForHttpMethod(connectionHandle, request);
curl_easy_setopt(connectionHandle, CURLOPT_URL, url.c_str());
- curl_easy_setopt(connectionHandle, CURLOPT_WRITEFUNCTION, WriteData);
+ curl_easy_setopt(connectionHandle, CURLOPT_WRITEFUNCTION, WriteData);
curl_easy_setopt(connectionHandle, CURLOPT_WRITEDATA, &writeContext);
- curl_easy_setopt(connectionHandle, CURLOPT_HEADERFUNCTION, WriteHeader);
- curl_easy_setopt(connectionHandle, CURLOPT_HEADERDATA, &writeContext);
+ curl_easy_setopt(connectionHandle, CURLOPT_HEADERFUNCTION, WriteHeader);
+ curl_easy_setopt(connectionHandle, CURLOPT_HEADERDATA, &writeContext);
//we only want to override the default path if someone has explicitly told us to.
if(!m_caPath.empty())
@@ -595,59 +595,59 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
curl_easy_setopt(connectionHandle, CURLOPT_PROXYUSERNAME, m_proxyUserName.c_str());
curl_easy_setopt(connectionHandle, CURLOPT_PROXYPASSWORD, m_proxyPassword.c_str());
}
-#ifdef CURL_HAS_TLS_PROXY
- if (!m_proxySSLCertPath.empty())
- {
- curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLCERT, m_proxySSLCertPath.c_str());
- if (!m_proxySSLCertType.empty())
- {
- curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLCERTTYPE, m_proxySSLCertType.c_str());
- }
- }
- if (!m_proxySSLKeyPath.empty())
- {
- curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLKEY, m_proxySSLKeyPath.c_str());
- if (!m_proxySSLKeyType.empty())
- {
- curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLKEYTYPE, m_proxySSLKeyType.c_str());
- }
- if (!m_proxyKeyPasswd.empty())
- {
- curl_easy_setopt(connectionHandle, CURLOPT_PROXY_KEYPASSWD, m_proxyKeyPasswd.c_str());
- }
- }
-#endif //CURL_HAS_TLS_PROXY
+#ifdef CURL_HAS_TLS_PROXY
+ if (!m_proxySSLCertPath.empty())
+ {
+ curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLCERT, m_proxySSLCertPath.c_str());
+ if (!m_proxySSLCertType.empty())
+ {
+ curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLCERTTYPE, m_proxySSLCertType.c_str());
+ }
+ }
+ if (!m_proxySSLKeyPath.empty())
+ {
+ curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLKEY, m_proxySSLKeyPath.c_str());
+ if (!m_proxySSLKeyType.empty())
+ {
+ curl_easy_setopt(connectionHandle, CURLOPT_PROXY_SSLKEYTYPE, m_proxySSLKeyType.c_str());
+ }
+ if (!m_proxyKeyPasswd.empty())
+ {
+ curl_easy_setopt(connectionHandle, CURLOPT_PROXY_KEYPASSWD, m_proxyKeyPasswd.c_str());
+ }
+ }
+#endif //CURL_HAS_TLS_PROXY
}
else
{
curl_easy_setopt(connectionHandle, CURLOPT_PROXY, "");
}
- if (request->GetContentBody())
+ if (request->GetContentBody())
{
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, ReadBody);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, ReadBody);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &readContext);
- curl_easy_setopt(connectionHandle, CURLOPT_SEEKFUNCTION, SeekBody);
+ curl_easy_setopt(connectionHandle, CURLOPT_SEEKFUNCTION, SeekBody);
curl_easy_setopt(connectionHandle, CURLOPT_SEEKDATA, &readContext);
}
-
- OverrideOptionsOnConnectionHandle(connectionHandle);
+
+ OverrideOptionsOnConnectionHandle(connectionHandle);
Aws::Utils::DateTime startTransmissionTime = Aws::Utils::DateTime::Now();
CURLcode curlResponseCode = curl_easy_perform(connectionHandle);
- bool shouldContinueRequest = ContinueRequest(*request);
+ bool shouldContinueRequest = ContinueRequest(*request);
if (curlResponseCode != CURLE_OK && shouldContinueRequest)
{
- response->SetClientErrorType(CoreErrors::NETWORK_CONNECTION);
- Aws::StringStream ss;
- ss << "curlCode: " << curlResponseCode << ", " << curl_easy_strerror(curlResponseCode);
- response->SetClientErrorMessage(ss.str());
- AWS_LOGSTREAM_ERROR(CURL_HTTP_CLIENT_TAG, "Curl returned error code " << curlResponseCode
- << " - " << curl_easy_strerror(curlResponseCode));
+ response->SetClientErrorType(CoreErrors::NETWORK_CONNECTION);
+ Aws::StringStream ss;
+ ss << "curlCode: " << curlResponseCode << ", " << curl_easy_strerror(curlResponseCode);
+ response->SetClientErrorMessage(ss.str());
+ AWS_LOGSTREAM_ERROR(CURL_HTTP_CLIENT_TAG, "Curl returned error code " << curlResponseCode
+ << " - " << curl_easy_strerror(curlResponseCode));
}
else if(!shouldContinueRequest)
{
- response->SetClientErrorType(CoreErrors::USER_CANCELLED);
- response->SetClientErrorMessage("Request cancelled by user's continuation handler");
+ response->SetClientErrorType(CoreErrors::USER_CANCELLED);
+ response->SetClientErrorMessage("Request cancelled by user's continuation handler");
}
else
{
@@ -664,7 +664,7 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
AWS_LOGSTREAM_DEBUG(CURL_HTTP_CLIENT_TAG, "Returned content type " << contentType);
}
- if (request->GetMethod() != HttpMethod::HTTP_HEAD &&
+ if (request->GetMethod() != HttpMethod::HTTP_HEAD &&
writeContext.m_client->IsRequestProcessingEnabled() &&
response->HasHeader(Aws::Http::CONTENT_LENGTH_HEADER))
{
@@ -674,8 +674,8 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
AWS_LOGSTREAM_TRACE(CURL_HTTP_CLIENT_TAG, "Response body length: " << numBytesResponseReceived);
if (StringUtils::ConvertToInt64(contentLength.c_str()) != numBytesResponseReceived)
{
- response->SetClientErrorType(CoreErrors::NETWORK_CONNECTION);
- response->SetClientErrorMessage("Response body length doesn't match the content-length header.");
+ response->SetClientErrorType(CoreErrors::NETWORK_CONNECTION);
+ response->SetClientErrorMessage("Response body length doesn't match the content-length header.");
AWS_LOGSTREAM_ERROR(CURL_HTTP_CLIENT_TAG, "Response body length doesn't match the content-length header.");
}
}
@@ -687,38 +687,38 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
CURLcode ret = curl_easy_getinfo(connectionHandle, CURLINFO_NAMELOOKUP_TIME, &timep); // DNS Resolve Latency, seconds.
if (ret == CURLE_OK)
{
- request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::DnsLatency), static_cast<int64_t>(timep * 1000));// to milliseconds
+ request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::DnsLatency), static_cast<int64_t>(timep * 1000));// to milliseconds
}
- ret = curl_easy_getinfo(connectionHandle, CURLINFO_STARTTRANSFER_TIME, &timep); // Connect Latency
+ ret = curl_easy_getinfo(connectionHandle, CURLINFO_STARTTRANSFER_TIME, &timep); // Connect Latency
if (ret == CURLE_OK)
{
- request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::ConnectLatency), static_cast<int64_t>(timep * 1000));
+ request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::ConnectLatency), static_cast<int64_t>(timep * 1000));
}
ret = curl_easy_getinfo(connectionHandle, CURLINFO_APPCONNECT_TIME, &timep); // Ssl Latency
if (ret == CURLE_OK)
{
- request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::SslLatency), static_cast<int64_t>(timep * 1000));
+ request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::SslLatency), static_cast<int64_t>(timep * 1000));
}
const char* ip = nullptr;
auto curlGetInfoResult = curl_easy_getinfo(connectionHandle, CURLINFO_PRIMARY_IP, &ip); // Get the IP address of the remote endpoint
if (curlGetInfoResult == CURLE_OK && ip)
{
- request->SetResolvedRemoteHost(ip);
+ request->SetResolvedRemoteHost(ip);
}
- if (curlResponseCode != CURLE_OK)
+ if (curlResponseCode != CURLE_OK)
+ {
+ m_curlHandleContainer.DestroyCurlHandle(connectionHandle);
+ }
+ else
{
- m_curlHandleContainer.DestroyCurlHandle(connectionHandle);
+ m_curlHandleContainer.ReleaseCurlHandle(connectionHandle);
}
- else
- {
- m_curlHandleContainer.ReleaseCurlHandle(connectionHandle);
- }
- //go ahead and flush the response body stream
- response->GetResponseBody().flush();
- request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::RequestLatency), (DateTime::Now() - startTransmissionTime).count());
+ //go ahead and flush the response body stream
+ response->GetResponseBody().flush();
+ request->AddRequestMetric(GetHttpClientMetricNameByType(HttpClientMetricsType::RequestLatency), (DateTime::Now() - startTransmissionTime).count());
}
if (headers)
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp
index cfc3bc57c8..47a0ee4fac 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpRequest.cpp
@@ -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/http/standard/StandardHttpRequest.h>
@@ -35,13 +35,13 @@ StandardHttpRequest::StandardHttpRequest(const URI& uri, HttpMethod method) :
{
if(IsDefaultPort(uri))
{
- StandardHttpRequest::SetHeaderValue(HOST_HEADER, uri.GetAuthority());
+ StandardHttpRequest::SetHeaderValue(HOST_HEADER, uri.GetAuthority());
}
else
{
Aws::StringStream host;
host << uri.GetAuthority() << ":" << uri.GetPort();
- StandardHttpRequest::SetHeaderValue(HOST_HEADER, host.str());
+ StandardHttpRequest::SetHeaderValue(HOST_HEADER, host.str());
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp
index f7d84d9888..92d7a062b6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/http/standard/StandardHttpResponse.cpp
@@ -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/http/standard/StandardHttpResponse.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp
index 7dd2bd53ad..24145e4d92 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp
@@ -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/internal/AWSHttpResourceClient.h>
#include <aws/core/client/DefaultRetryStrategy.h>
@@ -10,31 +10,31 @@
#include <aws/core/http/HttpResponse.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/HashingUtils.h>
+#include <aws/core/utils/HashingUtils.h>
#include <aws/core/platform/Environment.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
-#include <aws/core/utils/xml/XmlSerializer.h>
-#include <mutex>
+#include <aws/core/utils/xml/XmlSerializer.h>
+#include <mutex>
#include <sstream>
-using namespace Aws;
+using namespace Aws;
using namespace Aws::Utils;
using namespace Aws::Utils::Logging;
-using namespace Aws::Utils::Xml;
+using namespace Aws::Utils::Xml;
using namespace Aws::Http;
using namespace Aws::Client;
using namespace Aws::Internal;
-static const char EC2_SECURITY_CREDENTIALS_RESOURCE[] = "/latest/meta-data/iam/security-credentials";
-static const char EC2_REGION_RESOURCE[] = "/latest/meta-data/placement/availability-zone";
-static const char EC2_IMDS_TOKEN_RESOURCE[] = "/latest/api/token";
-static const char EC2_IMDS_TOKEN_TTL_DEFAULT_VALUE[] = "21600";
-static const char EC2_IMDS_TOKEN_TTL_HEADER[] = "x-aws-ec2-metadata-token-ttl-seconds";
-static const char EC2_IMDS_TOKEN_HEADER[] = "x-aws-ec2-metadata-token";
-static const char RESOURCE_CLIENT_CONFIGURATION_ALLOCATION_TAG[] = "AWSHttpResourceClient";
-static const char EC2_METADATA_CLIENT_LOG_TAG[] = "EC2MetadataClient";
-static const char ECS_CREDENTIALS_CLIENT_LOG_TAG[] = "ECSCredentialsClient";
+static const char EC2_SECURITY_CREDENTIALS_RESOURCE[] = "/latest/meta-data/iam/security-credentials";
+static const char EC2_REGION_RESOURCE[] = "/latest/meta-data/placement/availability-zone";
+static const char EC2_IMDS_TOKEN_RESOURCE[] = "/latest/api/token";
+static const char EC2_IMDS_TOKEN_TTL_DEFAULT_VALUE[] = "21600";
+static const char EC2_IMDS_TOKEN_TTL_HEADER[] = "x-aws-ec2-metadata-token-ttl-seconds";
+static const char EC2_IMDS_TOKEN_HEADER[] = "x-aws-ec2-metadata-token";
+static const char RESOURCE_CLIENT_CONFIGURATION_ALLOCATION_TAG[] = "AWSHttpResourceClient";
+static const char EC2_METADATA_CLIENT_LOG_TAG[] = "EC2MetadataClient";
+static const char ECS_CREDENTIALS_CLIENT_LOG_TAG[] = "ECSCredentialsClient";
namespace Aws
{
@@ -43,464 +43,464 @@ namespace Aws
Aws::String ComputeUserAgentString();
}
- namespace Internal
- {
- static ClientConfiguration MakeDefaultHttpResourceClientConfiguration(const char *logtag)
- {
- ClientConfiguration res;
-
- res.maxConnections = 2;
- res.scheme = Scheme::HTTP;
-
- #if defined(WIN32) && defined(BYPASS_DEFAULT_PROXY)
- // For security reasons, we must bypass any proxy settings when fetching sensitive information, for example
- // user credentials. On Windows, IXMLHttpRequest2 does not support bypassing proxy settings, therefore,
- // we force using WinHTTP client. On POSIX systems, CURL is set to bypass proxy settings by default.
- res.httpLibOverride = TransferLibType::WIN_HTTP_CLIENT;
- AWS_LOGSTREAM_INFO(logtag, "Overriding the current HTTP client to WinHTTP to bypass proxy settings.");
- #else
- (void) logtag; // To disable warning about unused variable
- #endif
- // Explicitly set the proxy settings to empty/zero to avoid relying on defaults that could potentially change
- // in the future.
- res.proxyHost = "";
- res.proxyUserName = "";
- res.proxyPassword = "";
- res.proxyPort = 0;
-
- // EC2MetadataService throttles by delaying the response so the service client should set a large read timeout.
- // EC2MetadataService delay is in order of seconds so it only make sense to retry after a couple of seconds.
- res.connectTimeoutMs = 1000;
- res.requestTimeoutMs = 1000;
- res.retryStrategy = Aws::MakeShared<DefaultRetryStrategy>(RESOURCE_CLIENT_CONFIGURATION_ALLOCATION_TAG, 1, 1000);
-
- return res;
- }
-
- AWSHttpResourceClient::AWSHttpResourceClient(const Aws::Client::ClientConfiguration& clientConfiguration, const char* logtag)
- : m_logtag(logtag), m_retryStrategy(clientConfiguration.retryStrategy), m_httpClient(nullptr)
- {
- AWS_LOGSTREAM_INFO(m_logtag.c_str(),
- "Creating AWSHttpResourceClient with max connections "
- << clientConfiguration.maxConnections
- << " and scheme "
- << SchemeMapper::ToString(clientConfiguration.scheme));
-
- m_httpClient = CreateHttpClient(clientConfiguration);
- }
-
- AWSHttpResourceClient::AWSHttpResourceClient(const char* logtag)
- : AWSHttpResourceClient(MakeDefaultHttpResourceClientConfiguration(logtag), logtag)
- {
- }
-
- AWSHttpResourceClient::~AWSHttpResourceClient()
- {
- }
-
- Aws::String AWSHttpResourceClient::GetResource(const char* endpoint, const char* resource, const char* authToken) const
- {
- return GetResourceWithAWSWebServiceResult(endpoint, resource, authToken).GetPayload();
- }
-
- AmazonWebServiceResult<Aws::String> AWSHttpResourceClient::GetResourceWithAWSWebServiceResult(const char *endpoint, const char *resource, const char *authToken) const
- {
- Aws::StringStream ss;
- ss << endpoint;
- if (resource)
- {
- ss << resource;
- }
- std::shared_ptr<HttpRequest> request(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
-
- request->SetUserAgent(ComputeUserAgentString());
-
- if (authToken)
- {
- request->SetHeaderValue(Aws::Http::AWS_AUTHORIZATION_HEADER, authToken);
- }
-
- return GetResourceWithAWSWebServiceResult(request);
- }
-
- AmazonWebServiceResult<Aws::String> AWSHttpResourceClient::GetResourceWithAWSWebServiceResult(const std::shared_ptr<HttpRequest> &httpRequest) const
+ namespace Internal
+ {
+ static ClientConfiguration MakeDefaultHttpResourceClientConfiguration(const char *logtag)
+ {
+ ClientConfiguration res;
+
+ res.maxConnections = 2;
+ res.scheme = Scheme::HTTP;
+
+ #if defined(WIN32) && defined(BYPASS_DEFAULT_PROXY)
+ // For security reasons, we must bypass any proxy settings when fetching sensitive information, for example
+ // user credentials. On Windows, IXMLHttpRequest2 does not support bypassing proxy settings, therefore,
+ // we force using WinHTTP client. On POSIX systems, CURL is set to bypass proxy settings by default.
+ res.httpLibOverride = TransferLibType::WIN_HTTP_CLIENT;
+ AWS_LOGSTREAM_INFO(logtag, "Overriding the current HTTP client to WinHTTP to bypass proxy settings.");
+ #else
+ (void) logtag; // To disable warning about unused variable
+ #endif
+ // Explicitly set the proxy settings to empty/zero to avoid relying on defaults that could potentially change
+ // in the future.
+ res.proxyHost = "";
+ res.proxyUserName = "";
+ res.proxyPassword = "";
+ res.proxyPort = 0;
+
+ // EC2MetadataService throttles by delaying the response so the service client should set a large read timeout.
+ // EC2MetadataService delay is in order of seconds so it only make sense to retry after a couple of seconds.
+ res.connectTimeoutMs = 1000;
+ res.requestTimeoutMs = 1000;
+ res.retryStrategy = Aws::MakeShared<DefaultRetryStrategy>(RESOURCE_CLIENT_CONFIGURATION_ALLOCATION_TAG, 1, 1000);
+
+ return res;
+ }
+
+ AWSHttpResourceClient::AWSHttpResourceClient(const Aws::Client::ClientConfiguration& clientConfiguration, const char* logtag)
+ : m_logtag(logtag), m_retryStrategy(clientConfiguration.retryStrategy), m_httpClient(nullptr)
+ {
+ AWS_LOGSTREAM_INFO(m_logtag.c_str(),
+ "Creating AWSHttpResourceClient with max connections "
+ << clientConfiguration.maxConnections
+ << " and scheme "
+ << SchemeMapper::ToString(clientConfiguration.scheme));
+
+ m_httpClient = CreateHttpClient(clientConfiguration);
+ }
+
+ AWSHttpResourceClient::AWSHttpResourceClient(const char* logtag)
+ : AWSHttpResourceClient(MakeDefaultHttpResourceClientConfiguration(logtag), logtag)
+ {
+ }
+
+ AWSHttpResourceClient::~AWSHttpResourceClient()
+ {
+ }
+
+ Aws::String AWSHttpResourceClient::GetResource(const char* endpoint, const char* resource, const char* authToken) const
+ {
+ return GetResourceWithAWSWebServiceResult(endpoint, resource, authToken).GetPayload();
+ }
+
+ AmazonWebServiceResult<Aws::String> AWSHttpResourceClient::GetResourceWithAWSWebServiceResult(const char *endpoint, const char *resource, const char *authToken) const
{
- AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Retrieving credentials from " << httpRequest->GetURIString());
-
- for (long retries = 0;; retries++)
- {
- std::shared_ptr<HttpResponse> response(m_httpClient->MakeRequest(httpRequest));
-
- if (response->GetResponseCode() == HttpResponseCode::OK)
- {
- Aws::IStreamBufIterator eos;
- return {Aws::String(Aws::IStreamBufIterator(response->GetResponseBody()), eos), response->GetHeaders(), HttpResponseCode::OK};
- }
-
- const Aws::Client::AWSError<Aws::Client::CoreErrors> error = [this, &response]() {
- if (response->HasClientError() || response->GetResponseBody().tellp() < 1)
- {
- AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Http request to retrieve credentials failed");
- return AWSError<CoreErrors>(CoreErrors::NETWORK_CONNECTION, true); // Retryable
- }
- else if (m_errorMarshaller)
- {
- return m_errorMarshaller->Marshall(*response);
- }
- else
- {
- const auto responseCode = response->GetResponseCode();
-
- AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Http request to retrieve credentials failed with error code "
- << static_cast<int>(responseCode));
- return CoreErrorsMapper::GetErrorForHttpResponseCode(responseCode);
- }
- }();
-
- if (!m_retryStrategy->ShouldRetry(error, retries))
- {
- AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Can not retrive resource from " << httpRequest->GetURIString());
- return {{}, response->GetHeaders(), error.GetResponseCode()};
- }
- auto sleepMillis = m_retryStrategy->CalculateDelayBeforeNextRetry(error, retries);
- AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Request failed, now waiting " << sleepMillis << " ms before attempting again.");
- m_httpClient->RetryRequestSleep(std::chrono::milliseconds(sleepMillis));
- }
+ Aws::StringStream ss;
+ ss << endpoint;
+ if (resource)
+ {
+ ss << resource;
+ }
+ std::shared_ptr<HttpRequest> request(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+
+ request->SetUserAgent(ComputeUserAgentString());
+
+ if (authToken)
+ {
+ request->SetHeaderValue(Aws::Http::AWS_AUTHORIZATION_HEADER, authToken);
+ }
+
+ return GetResourceWithAWSWebServiceResult(request);
+ }
+
+ AmazonWebServiceResult<Aws::String> AWSHttpResourceClient::GetResourceWithAWSWebServiceResult(const std::shared_ptr<HttpRequest> &httpRequest) const
+ {
+ AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Retrieving credentials from " << httpRequest->GetURIString());
+
+ for (long retries = 0;; retries++)
+ {
+ std::shared_ptr<HttpResponse> response(m_httpClient->MakeRequest(httpRequest));
+
+ if (response->GetResponseCode() == HttpResponseCode::OK)
+ {
+ Aws::IStreamBufIterator eos;
+ return {Aws::String(Aws::IStreamBufIterator(response->GetResponseBody()), eos), response->GetHeaders(), HttpResponseCode::OK};
+ }
+
+ const Aws::Client::AWSError<Aws::Client::CoreErrors> error = [this, &response]() {
+ if (response->HasClientError() || response->GetResponseBody().tellp() < 1)
+ {
+ AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Http request to retrieve credentials failed");
+ return AWSError<CoreErrors>(CoreErrors::NETWORK_CONNECTION, true); // Retryable
+ }
+ else if (m_errorMarshaller)
+ {
+ return m_errorMarshaller->Marshall(*response);
+ }
+ else
+ {
+ const auto responseCode = response->GetResponseCode();
+
+ AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Http request to retrieve credentials failed with error code "
+ << static_cast<int>(responseCode));
+ return CoreErrorsMapper::GetErrorForHttpResponseCode(responseCode);
+ }
+ }();
+
+ if (!m_retryStrategy->ShouldRetry(error, retries))
+ {
+ AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Can not retrive resource from " << httpRequest->GetURIString());
+ return {{}, response->GetHeaders(), error.GetResponseCode()};
+ }
+ auto sleepMillis = m_retryStrategy->CalculateDelayBeforeNextRetry(error, retries);
+ AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Request failed, now waiting " << sleepMillis << " ms before attempting again.");
+ m_httpClient->RetryRequestSleep(std::chrono::milliseconds(sleepMillis));
+ }
+ }
+
+ EC2MetadataClient::EC2MetadataClient(const char* endpoint)
+ : AWSHttpResourceClient(EC2_METADATA_CLIENT_LOG_TAG), m_endpoint(endpoint), m_tokenRequired(true)
+ {
+ }
+
+ EC2MetadataClient::EC2MetadataClient(const Aws::Client::ClientConfiguration &clientConfiguration, const char *endpoint)
+ : AWSHttpResourceClient(clientConfiguration, EC2_METADATA_CLIENT_LOG_TAG), m_endpoint(endpoint), m_tokenRequired(true)
+ {
+ }
+
+ EC2MetadataClient::~EC2MetadataClient()
+ {
+
+ }
+
+ Aws::String EC2MetadataClient::GetResource(const char* resourcePath) const
+ {
+ return GetResource(m_endpoint.c_str(), resourcePath, nullptr/*authToken*/);
+ }
+
+ Aws::String EC2MetadataClient::GetDefaultCredentials() const
+ {
+ std::unique_lock<std::recursive_mutex> locker(m_tokenMutex);
+ if (m_tokenRequired)
+ {
+ return GetDefaultCredentialsSecurely();
+ }
+
+ AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Getting default credentials for ec2 instance");
+ auto result = GetResourceWithAWSWebServiceResult(m_endpoint.c_str(), EC2_SECURITY_CREDENTIALS_RESOURCE, nullptr);
+ Aws::String credentialsString = result.GetPayload();
+ auto httpResponseCode = result.GetResponseCode();
+
+ // Note, if service is insane, it might return 404 for our initial secure call,
+ // then when we fall back to insecure call, it might return 401 ask for secure call,
+ // Then, SDK might get into a recursive loop call situation between secure and insecure call.
+ if (httpResponseCode == Http::HttpResponseCode::UNAUTHORIZED)
+ {
+ m_tokenRequired = true;
+ return {};
+ }
+ locker.unlock();
+
+ Aws::String trimmedCredentialsString = StringUtils::Trim(credentialsString.c_str());
+ if (trimmedCredentialsString.empty()) return {};
+
+ Aws::Vector<Aws::String> securityCredentials = StringUtils::Split(trimmedCredentialsString, '\n');
+
+ AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource, " << EC2_SECURITY_CREDENTIALS_RESOURCE
+ << " returned credential string " << trimmedCredentialsString);
+
+ if (securityCredentials.size() == 0)
+ {
+ AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Initial call to ec2Metadataservice to get credentials failed");
+ return {};
+ }
+
+ Aws::StringStream ss;
+ ss << EC2_SECURITY_CREDENTIALS_RESOURCE << "/" << securityCredentials[0];
+ AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource " << ss.str());
+ return GetResource(ss.str().c_str());
}
- EC2MetadataClient::EC2MetadataClient(const char* endpoint)
- : AWSHttpResourceClient(EC2_METADATA_CLIENT_LOG_TAG), m_endpoint(endpoint), m_tokenRequired(true)
- {
- }
+ Aws::String EC2MetadataClient::GetDefaultCredentialsSecurely() const
+ {
+ std::unique_lock<std::recursive_mutex> locker(m_tokenMutex);
+ if (!m_tokenRequired)
+ {
+ return GetDefaultCredentials();
+ }
- EC2MetadataClient::EC2MetadataClient(const Aws::Client::ClientConfiguration &clientConfiguration, const char *endpoint)
- : AWSHttpResourceClient(clientConfiguration, EC2_METADATA_CLIENT_LOG_TAG), m_endpoint(endpoint), m_tokenRequired(true)
+ Aws::StringStream ss;
+ ss << m_endpoint << EC2_IMDS_TOKEN_RESOURCE;
+ std::shared_ptr<HttpRequest> tokenRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_PUT,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+ tokenRequest->SetHeaderValue(EC2_IMDS_TOKEN_TTL_HEADER, EC2_IMDS_TOKEN_TTL_DEFAULT_VALUE);
+ auto userAgentString = ComputeUserAgentString();
+ tokenRequest->SetUserAgent(userAgentString);
+ AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Calling EC2MetadataService to get token");
+ auto result = GetResourceWithAWSWebServiceResult(tokenRequest);
+ Aws::String tokenString = result.GetPayload();
+ Aws::String trimmedTokenString = StringUtils::Trim(tokenString.c_str());
+
+ if (result.GetResponseCode() == HttpResponseCode::BAD_REQUEST)
+ {
+ return {};
+ }
+ else if (result.GetResponseCode() != HttpResponseCode::OK || trimmedTokenString.empty())
+ {
+ m_tokenRequired = false;
+ AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Calling EC2MetadataService to get token failed, falling back to less secure way.");
+ return GetDefaultCredentials();
+ }
+ m_token = trimmedTokenString;
+ locker.unlock();
+ ss.str("");
+ ss << m_endpoint << EC2_SECURITY_CREDENTIALS_RESOURCE;
+ std::shared_ptr<HttpRequest> profileRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+ profileRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, trimmedTokenString);
+ profileRequest->SetUserAgent(userAgentString);
+ Aws::String profileString = GetResourceWithAWSWebServiceResult(profileRequest).GetPayload();
+
+ Aws::String trimmedProfileString = StringUtils::Trim(profileString.c_str());
+ Aws::Vector<Aws::String> securityCredentials = StringUtils::Split(trimmedProfileString, '\n');
+
+ AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource, " << EC2_SECURITY_CREDENTIALS_RESOURCE
+ << " with token returned profile string " << trimmedProfileString);
+ if (securityCredentials.size() == 0)
+ {
+ AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Calling EC2Metadataservice to get profiles failed");
+ return {};
+ }
+
+ ss.str("");
+ ss << m_endpoint << EC2_SECURITY_CREDENTIALS_RESOURCE << "/" << securityCredentials[0];
+ std::shared_ptr<HttpRequest> credentialsRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+ credentialsRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, trimmedTokenString);
+ credentialsRequest->SetUserAgent(userAgentString);
+ AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource " << ss.str() << " with token.");
+ return GetResourceWithAWSWebServiceResult(credentialsRequest).GetPayload();
+ }
+
+ Aws::String EC2MetadataClient::GetCurrentRegion() const
{
+ if (!m_region.empty())
+ {
+ return m_region;
+ }
+
+ AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Getting current region for ec2 instance");
+
+ Aws::StringStream ss;
+ ss << m_endpoint << EC2_REGION_RESOURCE;
+ std::shared_ptr<HttpRequest> regionRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+ {
+ std::lock_guard<std::recursive_mutex> locker(m_tokenMutex);
+ if (m_tokenRequired)
+ {
+ regionRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, m_token);
+ }
+ }
+ regionRequest->SetUserAgent(ComputeUserAgentString());
+ Aws::String azString = GetResourceWithAWSWebServiceResult(regionRequest).GetPayload();
+
+ if (azString.empty())
+ {
+ AWS_LOGSTREAM_INFO(m_logtag.c_str() ,
+ "Unable to pull region from instance metadata service ");
+ return {};
+ }
+
+ Aws::String trimmedAZString = StringUtils::Trim(azString.c_str());
+ AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource "
+ << EC2_REGION_RESOURCE << " , returned credential string " << trimmedAZString);
+
+ Aws::String region;
+ region.reserve(trimmedAZString.length());
+
+ bool digitFound = false;
+ for (auto character : trimmedAZString)
+ {
+ if(digitFound && !isdigit(character))
+ {
+ break;
+ }
+ if (isdigit(character))
+ {
+ digitFound = true;
+ }
+
+ region.append(1, character);
+ }
+
+ AWS_LOGSTREAM_INFO(m_logtag.c_str(), "Detected current region as " << region);
+ m_region = region;
+ return region;
}
- EC2MetadataClient::~EC2MetadataClient()
- {
-
- }
-
- Aws::String EC2MetadataClient::GetResource(const char* resourcePath) const
- {
- return GetResource(m_endpoint.c_str(), resourcePath, nullptr/*authToken*/);
- }
-
- Aws::String EC2MetadataClient::GetDefaultCredentials() const
- {
- std::unique_lock<std::recursive_mutex> locker(m_tokenMutex);
- if (m_tokenRequired)
+ #ifdef _MSC_VER
+ // VS2015 compiler's bug, warning s_ec2metadataClient: symbol will be dynamically initialized (implementation limitation)
+ AWS_SUPPRESS_WARNING(4592,
+ static std::shared_ptr<EC2MetadataClient> s_ec2metadataClient(nullptr);
+ )
+ #else
+ static std::shared_ptr<EC2MetadataClient> s_ec2metadataClient(nullptr);
+ #endif
+
+ void InitEC2MetadataClient()
+ {
+ if (s_ec2metadataClient)
{
- return GetDefaultCredentialsSecurely();
+ return;
}
-
- AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Getting default credentials for ec2 instance");
- auto result = GetResourceWithAWSWebServiceResult(m_endpoint.c_str(), EC2_SECURITY_CREDENTIALS_RESOURCE, nullptr);
- Aws::String credentialsString = result.GetPayload();
- auto httpResponseCode = result.GetResponseCode();
-
- // Note, if service is insane, it might return 404 for our initial secure call,
- // then when we fall back to insecure call, it might return 401 ask for secure call,
- // Then, SDK might get into a recursive loop call situation between secure and insecure call.
- if (httpResponseCode == Http::HttpResponseCode::UNAUTHORIZED)
+ s_ec2metadataClient = Aws::MakeShared<EC2MetadataClient>(EC2_METADATA_CLIENT_LOG_TAG);
+ }
+
+ void CleanupEC2MetadataClient()
+ {
+ if (!s_ec2metadataClient)
{
- m_tokenRequired = true;
- return {};
- }
- locker.unlock();
-
- Aws::String trimmedCredentialsString = StringUtils::Trim(credentialsString.c_str());
- if (trimmedCredentialsString.empty()) return {};
-
- Aws::Vector<Aws::String> securityCredentials = StringUtils::Split(trimmedCredentialsString, '\n');
-
- AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource, " << EC2_SECURITY_CREDENTIALS_RESOURCE
- << " returned credential string " << trimmedCredentialsString);
-
- if (securityCredentials.size() == 0)
- {
- AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Initial call to ec2Metadataservice to get credentials failed");
- return {};
+ return;
}
+ s_ec2metadataClient = nullptr;
+ }
- Aws::StringStream ss;
- ss << EC2_SECURITY_CREDENTIALS_RESOURCE << "/" << securityCredentials[0];
- AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource " << ss.str());
- return GetResource(ss.str().c_str());
- }
-
- Aws::String EC2MetadataClient::GetDefaultCredentialsSecurely() const
+ std::shared_ptr<EC2MetadataClient> GetEC2MetadataClient()
{
- std::unique_lock<std::recursive_mutex> locker(m_tokenMutex);
- if (!m_tokenRequired)
- {
- return GetDefaultCredentials();
- }
-
- Aws::StringStream ss;
- ss << m_endpoint << EC2_IMDS_TOKEN_RESOURCE;
- std::shared_ptr<HttpRequest> tokenRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_PUT,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
- tokenRequest->SetHeaderValue(EC2_IMDS_TOKEN_TTL_HEADER, EC2_IMDS_TOKEN_TTL_DEFAULT_VALUE);
- auto userAgentString = ComputeUserAgentString();
- tokenRequest->SetUserAgent(userAgentString);
- AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Calling EC2MetadataService to get token");
- auto result = GetResourceWithAWSWebServiceResult(tokenRequest);
- Aws::String tokenString = result.GetPayload();
- Aws::String trimmedTokenString = StringUtils::Trim(tokenString.c_str());
-
- if (result.GetResponseCode() == HttpResponseCode::BAD_REQUEST)
- {
- return {};
- }
- else if (result.GetResponseCode() != HttpResponseCode::OK || trimmedTokenString.empty())
- {
- m_tokenRequired = false;
- AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Calling EC2MetadataService to get token failed, falling back to less secure way.");
- return GetDefaultCredentials();
- }
- m_token = trimmedTokenString;
- locker.unlock();
- ss.str("");
- ss << m_endpoint << EC2_SECURITY_CREDENTIALS_RESOURCE;
- std::shared_ptr<HttpRequest> profileRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
- profileRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, trimmedTokenString);
- profileRequest->SetUserAgent(userAgentString);
- Aws::String profileString = GetResourceWithAWSWebServiceResult(profileRequest).GetPayload();
-
- Aws::String trimmedProfileString = StringUtils::Trim(profileString.c_str());
- Aws::Vector<Aws::String> securityCredentials = StringUtils::Split(trimmedProfileString, '\n');
-
- AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource, " << EC2_SECURITY_CREDENTIALS_RESOURCE
- << " with token returned profile string " << trimmedProfileString);
- if (securityCredentials.size() == 0)
- {
- AWS_LOGSTREAM_WARN(m_logtag.c_str(), "Calling EC2Metadataservice to get profiles failed");
- return {};
- }
-
- ss.str("");
- ss << m_endpoint << EC2_SECURITY_CREDENTIALS_RESOURCE << "/" << securityCredentials[0];
- std::shared_ptr<HttpRequest> credentialsRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
- credentialsRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, trimmedTokenString);
- credentialsRequest->SetUserAgent(userAgentString);
- AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource " << ss.str() << " with token.");
- return GetResourceWithAWSWebServiceResult(credentialsRequest).GetPayload();
+ return s_ec2metadataClient;
}
- Aws::String EC2MetadataClient::GetCurrentRegion() const
- {
- if (!m_region.empty())
- {
- return m_region;
- }
-
- AWS_LOGSTREAM_TRACE(m_logtag.c_str(), "Getting current region for ec2 instance");
-
- Aws::StringStream ss;
- ss << m_endpoint << EC2_REGION_RESOURCE;
- std::shared_ptr<HttpRequest> regionRequest(CreateHttpRequest(ss.str(), HttpMethod::HTTP_GET,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
- {
- std::lock_guard<std::recursive_mutex> locker(m_tokenMutex);
- if (m_tokenRequired)
- {
- regionRequest->SetHeaderValue(EC2_IMDS_TOKEN_HEADER, m_token);
- }
- }
- regionRequest->SetUserAgent(ComputeUserAgentString());
- Aws::String azString = GetResourceWithAWSWebServiceResult(regionRequest).GetPayload();
-
- if (azString.empty())
- {
- AWS_LOGSTREAM_INFO(m_logtag.c_str() ,
- "Unable to pull region from instance metadata service ");
- return {};
- }
-
- Aws::String trimmedAZString = StringUtils::Trim(azString.c_str());
- AWS_LOGSTREAM_DEBUG(m_logtag.c_str(), "Calling EC2MetadataService resource "
- << EC2_REGION_RESOURCE << " , returned credential string " << trimmedAZString);
-
- Aws::String region;
- region.reserve(trimmedAZString.length());
-
- bool digitFound = false;
- for (auto character : trimmedAZString)
- {
- if(digitFound && !isdigit(character))
- {
- break;
- }
- if (isdigit(character))
- {
- digitFound = true;
- }
-
- region.append(1, character);
- }
-
- AWS_LOGSTREAM_INFO(m_logtag.c_str(), "Detected current region as " << region);
- m_region = region;
- return region;
- }
-
- #ifdef _MSC_VER
- // VS2015 compiler's bug, warning s_ec2metadataClient: symbol will be dynamically initialized (implementation limitation)
- AWS_SUPPRESS_WARNING(4592,
- static std::shared_ptr<EC2MetadataClient> s_ec2metadataClient(nullptr);
- )
- #else
- static std::shared_ptr<EC2MetadataClient> s_ec2metadataClient(nullptr);
- #endif
-
- void InitEC2MetadataClient()
- {
- if (s_ec2metadataClient)
- {
- return;
- }
- s_ec2metadataClient = Aws::MakeShared<EC2MetadataClient>(EC2_METADATA_CLIENT_LOG_TAG);
- }
-
- void CleanupEC2MetadataClient()
- {
- if (!s_ec2metadataClient)
- {
- return;
- }
- s_ec2metadataClient = nullptr;
- }
-
- std::shared_ptr<EC2MetadataClient> GetEC2MetadataClient()
- {
- return s_ec2metadataClient;
- }
-
-
- ECSCredentialsClient::ECSCredentialsClient(const char* resourcePath, const char* endpoint, const char* token)
- : AWSHttpResourceClient(ECS_CREDENTIALS_CLIENT_LOG_TAG),
- m_resourcePath(resourcePath), m_endpoint(endpoint), m_token(token)
+
+ ECSCredentialsClient::ECSCredentialsClient(const char* resourcePath, const char* endpoint, const char* token)
+ : AWSHttpResourceClient(ECS_CREDENTIALS_CLIENT_LOG_TAG),
+ m_resourcePath(resourcePath), m_endpoint(endpoint), m_token(token)
{
}
-
- ECSCredentialsClient::ECSCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration, const char* resourcePath, const char* endpoint, const char* token)
- : AWSHttpResourceClient(clientConfiguration, ECS_CREDENTIALS_CLIENT_LOG_TAG),
- m_resourcePath(resourcePath), m_endpoint(endpoint), m_token(token)
+
+ ECSCredentialsClient::ECSCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration, const char* resourcePath, const char* endpoint, const char* token)
+ : AWSHttpResourceClient(clientConfiguration, ECS_CREDENTIALS_CLIENT_LOG_TAG),
+ m_resourcePath(resourcePath), m_endpoint(endpoint), m_token(token)
{
}
- static const char STS_RESOURCE_CLIENT_LOG_TAG[] = "STSResourceClient";
- STSCredentialsClient::STSCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration)
- : AWSHttpResourceClient(clientConfiguration, STS_RESOURCE_CLIENT_LOG_TAG)
- {
- SetErrorMarshaller(Aws::MakeUnique<Aws::Client::XmlErrorMarshaller>(STS_RESOURCE_CLIENT_LOG_TAG));
-
- Aws::StringStream ss;
- if (clientConfiguration.scheme == Aws::Http::Scheme::HTTP)
- {
- ss << "http://";
- }
- else
- {
- ss << "https://";
- }
-
- static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTH_1);
- static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTHWEST_1);
- auto hash = Aws::Utils::HashingUtils::HashString(clientConfiguration.region.c_str());
-
- ss << "sts." << clientConfiguration.region << ".amazonaws.com";
- if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH)
- {
- ss << ".cn";
- }
- m_endpoint = ss.str();
-
- AWS_LOGSTREAM_INFO(STS_RESOURCE_CLIENT_LOG_TAG, "Creating STS ResourceClient with endpoint: " << m_endpoint);
- }
-
- STSCredentialsClient::STSAssumeRoleWithWebIdentityResult STSCredentialsClient::GetAssumeRoleWithWebIdentityCredentials(const STSAssumeRoleWithWebIdentityRequest& request)
- {
- //Calculate query string
- Aws::StringStream ss;
- ss << "Action=AssumeRoleWithWebIdentity"
- << "&Version=2011-06-15"
- << "&RoleSessionName=" << Aws::Utils::StringUtils::URLEncode(request.roleSessionName.c_str())
- << "&RoleArn=" << Aws::Utils::StringUtils::URLEncode(request.roleArn.c_str())
- << "&WebIdentityToken=" << Aws::Utils::StringUtils::URLEncode(request.webIdentityToken.c_str());
-
- std::shared_ptr<HttpRequest> httpRequest(CreateHttpRequest(m_endpoint, HttpMethod::HTTP_POST,
- Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
-
- httpRequest->SetUserAgent(ComputeUserAgentString());
-
- std::shared_ptr<Aws::IOStream> body = Aws::MakeShared<Aws::StringStream>("STS_RESOURCE_CLIENT_LOG_TAG");
- *body << ss.str();
-
- httpRequest->AddContentBody(body);
- body->seekg(0, body->end);
- auto streamSize = body->tellg();
- body->seekg(0, body->beg);
- Aws::StringStream contentLength;
- contentLength << streamSize;
- httpRequest->SetContentLength(contentLength.str());
- httpRequest->SetContentType("application/x-www-form-urlencoded");
-
- Aws::String credentialsStr = GetResourceWithAWSWebServiceResult(httpRequest).GetPayload();
-
- //Parse credentials
- STSAssumeRoleWithWebIdentityResult result;
- if (credentialsStr.empty())
- {
- AWS_LOGSTREAM_WARN(STS_RESOURCE_CLIENT_LOG_TAG, "Get an empty credential from sts");
- return result;
- }
-
- const Utils::Xml::XmlDocument xmlDocument = XmlDocument::CreateFromXmlString(credentialsStr);
- XmlNode rootNode = xmlDocument.GetRootElement();
- XmlNode resultNode = rootNode;
- if (!rootNode.IsNull() && (rootNode.GetName() != "AssumeRoleWithWebIdentityResult"))
- {
- resultNode = rootNode.FirstChild("AssumeRoleWithWebIdentityResult");
- }
-
- if (!resultNode.IsNull())
- {
- XmlNode credentialsNode = resultNode.FirstChild("Credentials");
- if (!credentialsNode.IsNull())
- {
- XmlNode accessKeyIdNode = credentialsNode.FirstChild("AccessKeyId");
- if (!accessKeyIdNode.IsNull())
- {
- result.creds.SetAWSAccessKeyId(accessKeyIdNode.GetText());
- }
-
- XmlNode secretAccessKeyNode = credentialsNode.FirstChild("SecretAccessKey");
- if (!secretAccessKeyNode.IsNull())
- {
- result.creds.SetAWSSecretKey(secretAccessKeyNode.GetText());
- }
-
- XmlNode sessionTokenNode = credentialsNode.FirstChild("SessionToken");
- if (!sessionTokenNode.IsNull())
- {
- result.creds.SetSessionToken(sessionTokenNode.GetText());
- }
-
- XmlNode expirationNode = credentialsNode.FirstChild("Expiration");
- if (!expirationNode.IsNull())
- {
- result.creds.SetExpiration(DateTime(StringUtils::Trim(expirationNode.GetText().c_str()).c_str(), DateFormat::ISO_8601));
- }
- }
- }
- return result;
- }
- }
+ static const char STS_RESOURCE_CLIENT_LOG_TAG[] = "STSResourceClient";
+ STSCredentialsClient::STSCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration)
+ : AWSHttpResourceClient(clientConfiguration, STS_RESOURCE_CLIENT_LOG_TAG)
+ {
+ SetErrorMarshaller(Aws::MakeUnique<Aws::Client::XmlErrorMarshaller>(STS_RESOURCE_CLIENT_LOG_TAG));
+
+ Aws::StringStream ss;
+ if (clientConfiguration.scheme == Aws::Http::Scheme::HTTP)
+ {
+ ss << "http://";
+ }
+ else
+ {
+ ss << "https://";
+ }
+
+ static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTH_1);
+ static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTHWEST_1);
+ auto hash = Aws::Utils::HashingUtils::HashString(clientConfiguration.region.c_str());
+
+ ss << "sts." << clientConfiguration.region << ".amazonaws.com";
+ if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH)
+ {
+ ss << ".cn";
+ }
+ m_endpoint = ss.str();
+
+ AWS_LOGSTREAM_INFO(STS_RESOURCE_CLIENT_LOG_TAG, "Creating STS ResourceClient with endpoint: " << m_endpoint);
+ }
+
+ STSCredentialsClient::STSAssumeRoleWithWebIdentityResult STSCredentialsClient::GetAssumeRoleWithWebIdentityCredentials(const STSAssumeRoleWithWebIdentityRequest& request)
+ {
+ //Calculate query string
+ Aws::StringStream ss;
+ ss << "Action=AssumeRoleWithWebIdentity"
+ << "&Version=2011-06-15"
+ << "&RoleSessionName=" << Aws::Utils::StringUtils::URLEncode(request.roleSessionName.c_str())
+ << "&RoleArn=" << Aws::Utils::StringUtils::URLEncode(request.roleArn.c_str())
+ << "&WebIdentityToken=" << Aws::Utils::StringUtils::URLEncode(request.webIdentityToken.c_str());
+
+ std::shared_ptr<HttpRequest> httpRequest(CreateHttpRequest(m_endpoint, HttpMethod::HTTP_POST,
+ Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
+
+ httpRequest->SetUserAgent(ComputeUserAgentString());
+
+ std::shared_ptr<Aws::IOStream> body = Aws::MakeShared<Aws::StringStream>("STS_RESOURCE_CLIENT_LOG_TAG");
+ *body << ss.str();
+
+ httpRequest->AddContentBody(body);
+ body->seekg(0, body->end);
+ auto streamSize = body->tellg();
+ body->seekg(0, body->beg);
+ Aws::StringStream contentLength;
+ contentLength << streamSize;
+ httpRequest->SetContentLength(contentLength.str());
+ httpRequest->SetContentType("application/x-www-form-urlencoded");
+
+ Aws::String credentialsStr = GetResourceWithAWSWebServiceResult(httpRequest).GetPayload();
+
+ //Parse credentials
+ STSAssumeRoleWithWebIdentityResult result;
+ if (credentialsStr.empty())
+ {
+ AWS_LOGSTREAM_WARN(STS_RESOURCE_CLIENT_LOG_TAG, "Get an empty credential from sts");
+ return result;
+ }
+
+ const Utils::Xml::XmlDocument xmlDocument = XmlDocument::CreateFromXmlString(credentialsStr);
+ XmlNode rootNode = xmlDocument.GetRootElement();
+ XmlNode resultNode = rootNode;
+ if (!rootNode.IsNull() && (rootNode.GetName() != "AssumeRoleWithWebIdentityResult"))
+ {
+ resultNode = rootNode.FirstChild("AssumeRoleWithWebIdentityResult");
+ }
+
+ if (!resultNode.IsNull())
+ {
+ XmlNode credentialsNode = resultNode.FirstChild("Credentials");
+ if (!credentialsNode.IsNull())
+ {
+ XmlNode accessKeyIdNode = credentialsNode.FirstChild("AccessKeyId");
+ if (!accessKeyIdNode.IsNull())
+ {
+ result.creds.SetAWSAccessKeyId(accessKeyIdNode.GetText());
+ }
+
+ XmlNode secretAccessKeyNode = credentialsNode.FirstChild("SecretAccessKey");
+ if (!secretAccessKeyNode.IsNull())
+ {
+ result.creds.SetAWSSecretKey(secretAccessKeyNode.GetText());
+ }
+
+ XmlNode sessionTokenNode = credentialsNode.FirstChild("SessionToken");
+ if (!sessionTokenNode.IsNull())
+ {
+ result.creds.SetSessionToken(sessionTokenNode.GetText());
+ }
+
+ XmlNode expirationNode = credentialsNode.FirstChild("Expiration");
+ if (!expirationNode.IsNull())
+ {
+ result.creds.SetExpiration(DateTime(StringUtils::Trim(expirationNode.GetText().c_str()).c_str(), DateFormat::ISO_8601));
+ }
+ }
+ }
+ return result;
+ }
+ }
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/DefaultMonitoring.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/DefaultMonitoring.cpp
index 4bd51be06f..9953004bc3 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/DefaultMonitoring.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/DefaultMonitoring.cpp
@@ -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/utils/memory/AWSMemory.h>
#include <aws/core/monitoring/DefaultMonitoring.h>
@@ -21,22 +21,22 @@ namespace Aws
{
static const char DEFAULT_MONITORING_ALLOC_TAG[] = "DefaultMonitoringAllocTag";
static const int CLIENT_ID_LENGTH_LIMIT = 256;
- static const int USER_AGENT_LENGTH_LIMIT = 256;
+ static const int USER_AGENT_LENGTH_LIMIT = 256;
static const int ERROR_MESSAGE_LENGTH_LIMIT = 512;
const char DEFAULT_MONITORING_CLIENT_ID[] = ""; // default to empty;
- const char DEFAULT_MONITORING_HOST[] = "127.0.0.1"; // default to loopback ip address instead of "localhost" based on design specification.
+ const char DEFAULT_MONITORING_HOST[] = "127.0.0.1"; // default to loopback ip address instead of "localhost" based on design specification.
unsigned short DEFAULT_MONITORING_PORT = 31000; //default to 31000;
bool DEFAULT_MONITORING_ENABLE = false; //default to false;
const int DefaultMonitoring::DEFAULT_MONITORING_VERSION = 1;
const char DefaultMonitoring::DEFAULT_CSM_CONFIG_ENABLED[] = "csm_enabled";
const char DefaultMonitoring::DEFAULT_CSM_CONFIG_CLIENT_ID[] = "csm_client_id";
- const char DefaultMonitoring::DEFAULT_CSM_CONFIG_HOST[] = "csm_host";
+ const char DefaultMonitoring::DEFAULT_CSM_CONFIG_HOST[] = "csm_host";
const char DefaultMonitoring::DEFAULT_CSM_CONFIG_PORT[] = "csm_port";
const char DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED[] = "AWS_CSM_ENABLED";
const char DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID[] = "AWS_CSM_CLIENT_ID";
- const char DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_HOST[] = "AWS_CSM_HOST";
+ const char DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_HOST[] = "AWS_CSM_HOST";
const char DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_PORT[] = "AWS_CSM_PORT";
@@ -45,13 +45,13 @@ namespace Aws
Aws::Utils::DateTime apiCallStartTime;
Aws::Utils::DateTime attemptStartTime;
int retryCount = 0;
- bool lastAttemptSucceeded = false;
- bool lastErrorRetryable = false; //doesn't apply if last attempt succeeded.
+ bool lastAttemptSucceeded = false;
+ bool lastErrorRetryable = false; //doesn't apply if last attempt succeeded.
const Aws::Client::HttpResponseOutcome* outcome = nullptr;
};
- static inline void FillRequiredFieldsToJson(Json::JsonValue& json,
- const Aws::String& type,
+ static inline void FillRequiredFieldsToJson(Json::JsonValue& json,
+ const Aws::String& type,
const Aws::String& service,
const Aws::String& api,
const Aws::String& clientId,
@@ -65,17 +65,17 @@ namespace Aws
.WithString("ClientId", clientId.substr(0, CLIENT_ID_LENGTH_LIMIT))
.WithInt64("Timestamp", timestamp.Millis())
.WithInteger("Version", version)
- .WithString("UserAgent", userAgent.substr(0, USER_AGENT_LENGTH_LIMIT));
+ .WithString("UserAgent", userAgent.substr(0, USER_AGENT_LENGTH_LIMIT));
}
static inline void FillRequiredApiCallFieldsToJson(Json::JsonValue& json,
int attemptCount,
- int64_t apiCallLatency,
- bool maxRetriesExceeded)
+ int64_t apiCallLatency,
+ bool maxRetriesExceeded)
{
json.WithInteger("AttemptCount", attemptCount)
- .WithInt64("Latency", apiCallLatency)
- .WithInteger("MaxRetriesExceeded", maxRetriesExceeded ? 1 : 0);
+ .WithInt64("Latency", apiCallLatency)
+ .WithInteger("MaxRetriesExceeded", maxRetriesExceeded ? 1 : 0);
}
static inline void FillRequiredApiAttemptFieldsToJson(Json::JsonValue& json,
@@ -86,7 +86,7 @@ namespace Aws
.WithInt64("AttemptLatency", attemptLatency);
}
- static inline void ExportResponseHeaderToJson(Json::JsonValue& json, const Aws::Http::HeaderValueCollection& headers,
+ static inline void ExportResponseHeaderToJson(Json::JsonValue& json, const Aws::Http::HeaderValueCollection& headers,
const Aws::String& headerName, const Aws::String& targetName)
{
auto iter = headers.find(headerName);
@@ -105,17 +105,17 @@ namespace Aws
}
}
- static inline void FillOptionalApiCallFieldsToJson(Json::JsonValue& json,
+ static inline void FillOptionalApiCallFieldsToJson(Json::JsonValue& json,
const Aws::Http::HttpRequest* request,
const Aws::Client::HttpResponseOutcome& outcome)
- {
- if (!request->GetSigningRegion().empty())
- {
- json.WithString("Region", request->GetSigningRegion());
- }
+ {
+ if (!request->GetSigningRegion().empty())
+ {
+ json.WithString("Region", request->GetSigningRegion());
+ }
if (!outcome.IsSuccess())
{
- if (outcome.GetError().GetExceptionName().empty()) // Not Aws Exception
+ if (outcome.GetError().GetExceptionName().empty()) // Not Aws Exception
{
json.WithString("FinalSdkExceptionMessage", outcome.GetError().GetMessage().substr(0, ERROR_MESSAGE_LENGTH_LIMIT));
}
@@ -126,20 +126,20 @@ namespace Aws
}
json.WithInteger("FinalHttpStatusCode", static_cast<int>(outcome.GetError().GetResponseCode()));
}
- else
+ else
{
json.WithInteger("FinalHttpStatusCode", static_cast<int>(outcome.GetResult()->GetResponseCode()));
}
- }
-
+ }
+
static inline void FillOptionalApiAttemptFieldsToJson(Json::JsonValue& json,
- const Aws::Http::HttpRequest* request,
+ const Aws::Http::HttpRequest* request,
const Aws::Client::HttpResponseOutcome& outcome,
const CoreMetricsCollection& metricsFromCore)
{
/**
*No matter request succeeded or not, these fields should be included as long as their requirements
- *are met. We should be able to access response (so as to access original request) if the response has error.
+ *are met. We should be able to access response (so as to access original request) if the response has error.
*/
if (request->HasAwsSessionToken() && !request->GetAwsSessionToken().empty())
{
@@ -159,10 +159,10 @@ namespace Aws
ExportResponseHeaderToJson(json, headers, StringUtils::ToLower("x-amzn-RequestId"), "XAmznRequestId");
ExportResponseHeaderToJson(json, headers, StringUtils::ToLower("x-amz-request-id"), "XAmzRequestId");
ExportResponseHeaderToJson(json, headers, StringUtils::ToLower("x-amz-id-2"), "XAmzId2");
-
+
if (!outcome.IsSuccess())
{
- if (outcome.GetError().GetExceptionName().empty()) // Not Aws Exception
+ if (outcome.GetError().GetExceptionName().empty()) // Not Aws Exception
{
json.WithString("SdkExceptionMessage", outcome.GetError().GetMessage().substr(0, ERROR_MESSAGE_LENGTH_LIMIT));
}
@@ -173,7 +173,7 @@ namespace Aws
}
json.WithInteger("HttpStatusCode", static_cast<int>(outcome.GetError().GetResponseCode()));
}
- else
+ else
{
json.WithInteger("HttpStatusCode", static_cast<int>(outcome.GetResult()->GetResponseCode()));
}
@@ -189,8 +189,8 @@ namespace Aws
ExportHttpMetricsToJson(json, metricsFromCore.httpClientMetrics, HttpClientMetricsType::TcpLatency);
}
- DefaultMonitoring::DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port):
- m_udp(host.c_str(), port), m_clientId(clientId)
+ DefaultMonitoring::DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port):
+ m_udp(host.c_str(), port), m_clientId(clientId)
{
}
@@ -221,7 +221,7 @@ namespace Aws
CollectAndSendAttemptData(serviceName, requestName, request, outcome, metricsFromCore, context);
}
- void DefaultMonitoring::OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
+ void DefaultMonitoring::OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const
{
AWS_UNREFERENCED_PARAM(request);
@@ -232,7 +232,7 @@ namespace Aws
AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "OnRequestRetry Service: " << serviceName << "Request: " << requestName << " RetryCnt:" << defaultContext->retryCount);
}
- void DefaultMonitoring::OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
+ void DefaultMonitoring::OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const
{
AWS_UNREFERENCED_PARAM(request);
@@ -241,72 +241,72 @@ namespace Aws
DefaultContext* defaultContext = static_cast<DefaultContext*>(context);
Aws::Utils::Json::JsonValue json;
FillRequiredFieldsToJson(json, "ApiCall", serviceName, requestName, m_clientId, defaultContext->apiCallStartTime, DEFAULT_MONITORING_VERSION, request->GetUserAgent());
- FillRequiredApiCallFieldsToJson(json, defaultContext->retryCount + 1, (DateTime::Now() - defaultContext->apiCallStartTime).count(), (!defaultContext->lastAttemptSucceeded && defaultContext->lastErrorRetryable));
+ FillRequiredApiCallFieldsToJson(json, defaultContext->retryCount + 1, (DateTime::Now() - defaultContext->apiCallStartTime).count(), (!defaultContext->lastAttemptSucceeded && defaultContext->lastErrorRetryable));
FillOptionalApiCallFieldsToJson(json, request.get(), *(defaultContext->outcome));
Aws::String compactData = json.View().WriteCompact();
- m_udp.SendData(reinterpret_cast<const uint8_t*>(compactData.c_str()), static_cast<int>(compactData.size()));
+ m_udp.SendData(reinterpret_cast<const uint8_t*>(compactData.c_str()), static_cast<int>(compactData.size()));
AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Send API Metrics: \n" << json.View().WriteReadable());
Aws::Delete(defaultContext);
}
void DefaultMonitoring::CollectAndSendAttemptData(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome,
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome,
const CoreMetricsCollection& metricsFromCore, void* context) const
{
DefaultContext* defaultContext = static_cast<DefaultContext*>(context);
defaultContext->outcome = &outcome;
- defaultContext->lastAttemptSucceeded = outcome.IsSuccess() ? true : false;
- defaultContext->lastErrorRetryable = (!outcome.IsSuccess() && outcome.GetError().ShouldRetry()) ? true : false;
+ defaultContext->lastAttemptSucceeded = outcome.IsSuccess() ? true : false;
+ defaultContext->lastErrorRetryable = (!outcome.IsSuccess() && outcome.GetError().ShouldRetry()) ? true : false;
Aws::Utils::Json::JsonValue json;
FillRequiredFieldsToJson(json, "ApiCallAttempt", serviceName, requestName, m_clientId, defaultContext->attemptStartTime, DEFAULT_MONITORING_VERSION, request->GetUserAgent());
FillRequiredApiAttemptFieldsToJson(json, request->GetUri().GetAuthority(), (DateTime::Now() - defaultContext->attemptStartTime).count());
- FillOptionalApiAttemptFieldsToJson(json, request.get(), outcome, metricsFromCore);
+ FillOptionalApiAttemptFieldsToJson(json, request.get(), outcome, metricsFromCore);
Aws::String compactData = json.View().WriteCompact();
AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Send Attempt Metrics: \n" << json.View().WriteReadable());
- m_udp.SendData(reinterpret_cast<const uint8_t*>(compactData.c_str()), static_cast<int>(compactData.size()));
+ m_udp.SendData(reinterpret_cast<const uint8_t*>(compactData.c_str()), static_cast<int>(compactData.size()));
}
Aws::UniquePtr<MonitoringInterface> DefaultMonitoringFactory::CreateMonitoringInstance() const
- {
+ {
Aws::String clientId(DEFAULT_MONITORING_CLIENT_ID); // default to empty
- Aws::String host(DEFAULT_MONITORING_HOST); // default to 127.0.0.1
+ Aws::String host(DEFAULT_MONITORING_HOST); // default to 127.0.0.1
unsigned short port = DEFAULT_MONITORING_PORT; // default to 31000
bool enable = DEFAULT_MONITORING_ENABLE; //default to false;
//check profile_config
- Aws::String tmpEnable = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_ENABLED);
- Aws::String tmpClientId = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_CLIENT_ID);
- Aws::String tmpHost = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_HOST);
- Aws::String tmpPort = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_PORT);
+ Aws::String tmpEnable = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_ENABLED);
+ Aws::String tmpClientId = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_CLIENT_ID);
+ Aws::String tmpHost = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_HOST);
+ Aws::String tmpPort = Aws::Config::GetCachedConfigValue(DefaultMonitoring::DEFAULT_CSM_CONFIG_PORT);
+
+ if (!tmpEnable.empty())
+ {
+ enable = StringUtils::CaselessCompare(tmpEnable.c_str(), "true") ? true : false;
+ AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_enabled from profile_config to be " << enable);
+ }
+ if (!tmpClientId.empty())
+ {
+ clientId = tmpClientId;
+ AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_client_id from profile_config to be " << clientId);
+ }
- if (!tmpEnable.empty())
+ if (!tmpHost.empty())
{
- enable = StringUtils::CaselessCompare(tmpEnable.c_str(), "true") ? true : false;
- AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_enabled from profile_config to be " << enable);
- }
- if (!tmpClientId.empty())
- {
- clientId = tmpClientId;
- AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_client_id from profile_config to be " << clientId);
- }
-
- if (!tmpHost.empty())
- {
- host = tmpHost;
- AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_host from profile_config to be " << host);
+ host = tmpHost;
+ AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_host from profile_config to be " << host);
+ }
+
+ if (!tmpPort.empty())
+ {
+ port = static_cast<short>(StringUtils::ConvertToInt32(tmpPort.c_str()));
+ AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_port from profile_config to be " << port);
}
- if (!tmpPort.empty())
- {
- port = static_cast<short>(StringUtils::ConvertToInt32(tmpPort.c_str()));
- AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved csm_port from profile_config to be " << port);
- }
-
// check environment variables
- tmpEnable = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED);
- tmpClientId = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID);
- tmpHost = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_HOST);
- tmpPort = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_PORT);
+ tmpEnable = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED);
+ tmpClientId = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID);
+ tmpHost = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_HOST);
+ tmpPort = Aws::Environment::GetEnv(DefaultMonitoring::DEFAULT_CSM_ENVIRONMENT_VAR_PORT);
if (!tmpEnable.empty())
{
enable = StringUtils::CaselessCompare(tmpEnable.c_str(), "true") ? true : false;
@@ -318,11 +318,11 @@ namespace Aws
AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved AWS_CSM_CLIENT_ID from Environment variable to be " << clientId);
}
- if (!tmpHost.empty())
- {
- host = tmpHost;
- AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved AWS_CSM_HOST from Environment variable to be " << host);
- }
+ if (!tmpHost.empty())
+ {
+ host = tmpHost;
+ AWS_LOGSTREAM_DEBUG(DEFAULT_MONITORING_ALLOC_TAG, "Resolved AWS_CSM_HOST from Environment variable to be " << host);
+ }
if (!tmpPort.empty())
{
port = static_cast<unsigned short>(StringUtils::ConvertToInt32(tmpPort.c_str()));
@@ -333,7 +333,7 @@ namespace Aws
{
return nullptr;
}
- return Aws::MakeUnique<DefaultMonitoring>(DEFAULT_MONITORING_ALLOC_TAG, clientId, host, port);
+ return Aws::MakeUnique<DefaultMonitoring>(DEFAULT_MONITORING_ALLOC_TAG, clientId, host, port);
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/HttpClientMetrics.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/HttpClientMetrics.cpp
index 7207dc2bd8..f3ef582867 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/HttpClientMetrics.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/HttpClientMetrics.cpp
@@ -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.
*/
#include <aws/core/utils/HashingUtils.h>
@@ -10,28 +10,28 @@ namespace Aws
{
namespace Monitoring
{
- static const char HTTP_CLIENT_METRICS_DESTINATION_IP[] = "DestinationIp";
+ static const char HTTP_CLIENT_METRICS_DESTINATION_IP[] = "DestinationIp";
static const char HTTP_CLIENT_METRICS_ACQUIRE_CONNECTION_LATENCY[] = "AcquireConnectionLatency";
static const char HTTP_CLIENT_METRICS_CONNECTION_REUSED[] = "ConnectionReused";
static const char HTTP_CLIENT_METRICS_CONNECTION_LATENCY[] = "ConnectLatency";
static const char HTTP_CLIENT_METRICS_REQUEST_LATENCY[] = "RequestLatency";
static const char HTTP_CLIENT_METRICS_DNS_LATENCY[] = "DnsLatency";
- static const char HTTP_CLIENT_METRICS_TCP_LATENCY[] = "TcpLatency";
+ static const char HTTP_CLIENT_METRICS_TCP_LATENCY[] = "TcpLatency";
static const char HTTP_CLIENT_METRICS_SSL_LATENCY[] = "SslLatency";
static const char HTTP_CLIENT_METRICS_UNKNOWN[] = "Unknown";
using namespace Aws::Utils;
HttpClientMetricsType GetHttpClientMetricTypeByName(const Aws::String& name)
{
- static std::map<int, HttpClientMetricsType> metricsNameHashToType =
+ static std::map<int, HttpClientMetricsType> metricsNameHashToType =
{
- std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_DESTINATION_IP), HttpClientMetricsType::DestinationIp),
+ std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_DESTINATION_IP), HttpClientMetricsType::DestinationIp),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_ACQUIRE_CONNECTION_LATENCY), HttpClientMetricsType::AcquireConnectionLatency),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_CONNECTION_REUSED), HttpClientMetricsType::ConnectionReused),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_CONNECTION_LATENCY), HttpClientMetricsType::ConnectLatency),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_REQUEST_LATENCY), HttpClientMetricsType::RequestLatency),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_DNS_LATENCY), HttpClientMetricsType::DnsLatency),
- std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_TCP_LATENCY), HttpClientMetricsType::TcpLatency),
+ std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_TCP_LATENCY), HttpClientMetricsType::TcpLatency),
std::pair<int, HttpClientMetricsType>(HashingUtils::HashString(HTTP_CLIENT_METRICS_SSL_LATENCY), HttpClientMetricsType::SslLatency)
};
@@ -46,15 +46,15 @@ namespace Aws
Aws::String GetHttpClientMetricNameByType(HttpClientMetricsType type)
{
- static std::map<int, std::string> metricsTypeToName =
+ static std::map<int, std::string> metricsTypeToName =
{
- std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::DestinationIp), HTTP_CLIENT_METRICS_DESTINATION_IP),
+ std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::DestinationIp), HTTP_CLIENT_METRICS_DESTINATION_IP),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::AcquireConnectionLatency), HTTP_CLIENT_METRICS_ACQUIRE_CONNECTION_LATENCY),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::ConnectionReused), HTTP_CLIENT_METRICS_CONNECTION_REUSED),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::ConnectLatency), HTTP_CLIENT_METRICS_CONNECTION_LATENCY),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::RequestLatency), HTTP_CLIENT_METRICS_REQUEST_LATENCY),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::DnsLatency), HTTP_CLIENT_METRICS_DNS_LATENCY),
- std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::TcpLatency), HTTP_CLIENT_METRICS_TCP_LATENCY),
+ std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::TcpLatency), HTTP_CLIENT_METRICS_TCP_LATENCY),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::SslLatency), HTTP_CLIENT_METRICS_SSL_LATENCY),
std::pair<int, std::string>(static_cast<int>(HttpClientMetricsType::Unknown), HTTP_CLIENT_METRICS_UNKNOWN)
};
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp
index 4710a87709..7a8d3adb41 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp
@@ -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.
*/
#include <aws/core/utils/memory/AWSMemory.h>
@@ -23,7 +23,7 @@ namespace Aws
const char MonitoringTag[] = "MonitoringAllocTag";
/**
- * Global factory to create global metrics instance.
+ * Global factory to create global metrics instance.
*/
static Aws::UniquePtr<Monitors> s_monitors;
@@ -32,7 +32,7 @@ namespace Aws
assert(s_monitors);
Aws::Vector<void*> contexts;
contexts.reserve(s_monitors->size());
- for (const auto& interface: *s_monitors)
+ for (const auto& interface: *s_monitors)
{
contexts.emplace_back(interface->OnRequestStarted(serviceName, requestName, request));
}
@@ -63,7 +63,7 @@ namespace Aws
}
}
- 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)
{
assert(s_monitors);
@@ -75,7 +75,7 @@ namespace Aws
}
}
- 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)
{
assert(s_monitors);
@@ -124,6 +124,6 @@ namespace Aws
s_monitors = nullptr;
}
- } // namespace Monitoring
+ } // namespace Monitoring
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/Net.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/Net.cpp
index d1495ef18d..244df21945 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/Net.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/Net.cpp
@@ -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/net/Net.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/SimpleUDP.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/SimpleUDP.cpp
index f588b2bf11..d9e0c385fd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/SimpleUDP.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/net/linux-shared/SimpleUDP.cpp
@@ -1,11 +1,11 @@
-/**
- * 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 <sys/types.h>
#include <sys/socket.h>
-#include <netdb.h>
+#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
@@ -20,117 +20,117 @@ namespace Aws
namespace Net
{
static const char ALLOC_TAG[] = "SimpleUDP";
- static const char IPV4_LOOP_BACK_ADDRESS[] = "127.0.0.1";
- static const char IPV6_LOOP_BACK_ADDRESS[] = "::1";
-
- static inline bool IsValidIPAddress(const char* ip, int addressFamily/*AF_INET or AF_INET6*/)
+ static const char IPV4_LOOP_BACK_ADDRESS[] = "127.0.0.1";
+ static const char IPV6_LOOP_BACK_ADDRESS[] = "::1";
+
+ static inline bool IsValidIPAddress(const char* ip, int addressFamily/*AF_INET or AF_INET6*/)
{
- char buffer[128];
- return inet_pton(addressFamily, ip, (void*)buffer) == 1 ?true :false;
+ char buffer[128];
+ return inet_pton(addressFamily, ip, (void*)buffer) == 1 ?true :false;
+ }
+
+ static bool GetASockAddrFromHostName(const char* hostName, void* sockAddrBuffer, size_t& addrLength, int& addressFamily)
+ {
+ struct addrinfo hints, *res;
+
+ memset(&hints, 0, sizeof(hints));
+
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ if (getaddrinfo(hostName, nullptr, &hints, &res))
+ {
+ return false;
+ }
+
+ memcpy(sockAddrBuffer, res->ai_addr, res->ai_addrlen);
+ addrLength = res->ai_addrlen;
+ addressFamily = res->ai_family;
+ freeaddrinfo(res);
+ return true;
}
- static bool GetASockAddrFromHostName(const char* hostName, void* sockAddrBuffer, size_t& addrLength, int& addressFamily)
+ static sockaddr_in BuildAddrInfoIPV4(const char* hostIP, short port)
{
- struct addrinfo hints, *res;
-
- memset(&hints, 0, sizeof(hints));
-
- hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = SOCK_DGRAM;
- if (getaddrinfo(hostName, nullptr, &hints, &res))
- {
- return false;
- }
-
- memcpy(sockAddrBuffer, res->ai_addr, res->ai_addrlen);
- addrLength = res->ai_addrlen;
- addressFamily = res->ai_family;
- freeaddrinfo(res);
- return true;
+#if (__GNUC__ == 4) && !defined(__clang__)
+ AWS_SUPPRESS_WARNING("-Wmissing-field-initializers",
+ sockaddr_in addrinfo {};
+ );
+#else
+ sockaddr_in addrinfo {};
+#endif
+ addrinfo.sin_family = AF_INET;
+ addrinfo.sin_port = htons(port);
+ inet_pton(AF_INET, hostIP, &addrinfo.sin_addr);
+ return addrinfo;
+ }
+
+ static sockaddr_in6 BuildAddrInfoIPV6(const char* hostIP, short port)
+ {
+#if (__GNUC__ == 4) && !defined(__clang__)
+ AWS_SUPPRESS_WARNING("-Wmissing-field-initializers",
+ sockaddr_in6 addrinfo {};
+ );
+#else
+ sockaddr_in6 addrinfo {};
+#endif
+ addrinfo.sin6_family = AF_INET6;
+ addrinfo.sin6_port = htons(port);
+ inet_pton(AF_INET6, hostIP, &addrinfo.sin6_addr);
+ return addrinfo;
}
- static sockaddr_in BuildAddrInfoIPV4(const char* hostIP, short port)
- {
-#if (__GNUC__ == 4) && !defined(__clang__)
- AWS_SUPPRESS_WARNING("-Wmissing-field-initializers",
- sockaddr_in addrinfo {};
- );
-#else
- sockaddr_in addrinfo {};
-#endif
- addrinfo.sin_family = AF_INET;
- addrinfo.sin_port = htons(port);
- inet_pton(AF_INET, hostIP, &addrinfo.sin_addr);
- return addrinfo;
- }
-
- static sockaddr_in6 BuildAddrInfoIPV6(const char* hostIP, short port)
- {
-#if (__GNUC__ == 4) && !defined(__clang__)
- AWS_SUPPRESS_WARNING("-Wmissing-field-initializers",
- sockaddr_in6 addrinfo {};
- );
-#else
- sockaddr_in6 addrinfo {};
-#endif
- addrinfo.sin6_family = AF_INET6;
- addrinfo.sin6_port = htons(port);
- inet_pton(AF_INET6, hostIP, &addrinfo.sin6_addr);
- return addrinfo;
- }
-
SimpleUDP::SimpleUDP(int addressFamily, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking):
- m_addressFamily(addressFamily), m_connected(false), m_socket(-1), m_port(0)
+ m_addressFamily(addressFamily), m_connected(false), m_socket(-1), m_port(0)
{
CreateSocket(addressFamily, sendBufSize, receiveBufSize, nonBlocking);
}
SimpleUDP::SimpleUDP(bool IPV4, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking) :
- m_addressFamily(IPV4 ? AF_INET : AF_INET6), m_connected(false), m_socket(-1), m_port(0)
+ m_addressFamily(IPV4 ? AF_INET : AF_INET6), m_connected(false), m_socket(-1), m_port(0)
+ {
+ CreateSocket(m_addressFamily, sendBufSize, receiveBufSize, nonBlocking);
+ }
+
+ SimpleUDP::SimpleUDP(const char* host, unsigned short port, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking) :
+ m_addressFamily(AF_INET), m_connected(false), m_socket(-1), m_port(port)
{
+ if (IsValidIPAddress(host, AF_INET))
+ {
+ m_addressFamily = AF_INET;
+ m_hostIP = Aws::String(host);
+ }
+ else if (IsValidIPAddress(host, AF_INET6))
+ {
+ m_addressFamily = AF_INET6;
+ m_hostIP = Aws::String(host);
+ }
+ else
+ {
+ char sockAddrBuffer[100];
+ char hostBuffer[100];
+ size_t addrLength = 0;
+ if (GetASockAddrFromHostName(host, (void*)sockAddrBuffer, addrLength, m_addressFamily))
+ {
+ if (m_addressFamily == AF_INET)
+ {
+ struct sockaddr_in* sockaddr = reinterpret_cast<struct sockaddr_in*>(sockAddrBuffer);
+ inet_ntop(m_addressFamily, &(sockaddr->sin_addr), hostBuffer, sizeof(hostBuffer));
+ }
+ else
+ {
+ struct sockaddr_in6* sockaddr = reinterpret_cast<struct sockaddr_in6*>(sockAddrBuffer);
+ inet_ntop(m_addressFamily, &(sockaddr->sin6_addr), hostBuffer, sizeof(hostBuffer));
+ }
+ m_hostIP = Aws::String(hostBuffer);
+ }
+ else
+ {
+ AWS_LOGSTREAM_ERROR(ALLOC_TAG, "Can't retrieve a valid ip address based on provided host: " << host);
+ }
+ }
CreateSocket(m_addressFamily, sendBufSize, receiveBufSize, nonBlocking);
}
- SimpleUDP::SimpleUDP(const char* host, unsigned short port, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking) :
- m_addressFamily(AF_INET), m_connected(false), m_socket(-1), m_port(port)
- {
- if (IsValidIPAddress(host, AF_INET))
- {
- m_addressFamily = AF_INET;
- m_hostIP = Aws::String(host);
- }
- else if (IsValidIPAddress(host, AF_INET6))
- {
- m_addressFamily = AF_INET6;
- m_hostIP = Aws::String(host);
- }
- else
- {
- char sockAddrBuffer[100];
- char hostBuffer[100];
- size_t addrLength = 0;
- if (GetASockAddrFromHostName(host, (void*)sockAddrBuffer, addrLength, m_addressFamily))
- {
- if (m_addressFamily == AF_INET)
- {
- struct sockaddr_in* sockaddr = reinterpret_cast<struct sockaddr_in*>(sockAddrBuffer);
- inet_ntop(m_addressFamily, &(sockaddr->sin_addr), hostBuffer, sizeof(hostBuffer));
- }
- else
- {
- struct sockaddr_in6* sockaddr = reinterpret_cast<struct sockaddr_in6*>(sockAddrBuffer);
- inet_ntop(m_addressFamily, &(sockaddr->sin6_addr), hostBuffer, sizeof(hostBuffer));
- }
- m_hostIP = Aws::String(hostBuffer);
- }
- else
- {
- AWS_LOGSTREAM_ERROR(ALLOC_TAG, "Can't retrieve a valid ip address based on provided host: " << host);
- }
- }
- CreateSocket(m_addressFamily, sendBufSize, receiveBufSize, nonBlocking);
- }
-
SimpleUDP::~SimpleUDP()
{
close(GetUnderlyingSocket());
@@ -184,35 +184,35 @@ namespace Aws
return ret;
}
- int SimpleUDP::ConnectToHost(const char* hostIP, unsigned short port) const
+ int SimpleUDP::ConnectToHost(const char* hostIP, unsigned short port) const
{
int ret;
if (m_addressFamily == AF_INET6)
{
- sockaddr_in6 addrinfo = BuildAddrInfoIPV6(hostIP, port);
+ sockaddr_in6 addrinfo = BuildAddrInfoIPV6(hostIP, port);
ret = connect(GetUnderlyingSocket(), reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in6));
}
else
{
- sockaddr_in addrinfo = BuildAddrInfoIPV4(hostIP, port);
+ sockaddr_in addrinfo = BuildAddrInfoIPV4(hostIP, port);
ret = connect(GetUnderlyingSocket(), reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in));
}
m_connected = ret ? false : true;
return ret;
}
- int SimpleUDP::ConnectToLocalHost(unsigned short port) const
- {
- if (m_addressFamily == AF_INET6)
- {
- return ConnectToHost(IPV6_LOOP_BACK_ADDRESS, port);
- }
- else
- {
- return ConnectToHost(IPV4_LOOP_BACK_ADDRESS, port);
- }
- }
-
+ int SimpleUDP::ConnectToLocalHost(unsigned short port) const
+ {
+ if (m_addressFamily == AF_INET6)
+ {
+ return ConnectToHost(IPV6_LOOP_BACK_ADDRESS, port);
+ }
+ else
+ {
+ return ConnectToHost(IPV4_LOOP_BACK_ADDRESS, port);
+ }
+ }
+
int SimpleUDP::Bind(const sockaddr* address, size_t addressLength) const
{
return bind(GetUnderlyingSocket(), address, static_cast<socklen_t>(addressLength));
@@ -222,22 +222,22 @@ namespace Aws
{
if (m_addressFamily == AF_INET6)
{
- sockaddr_in6 addrinfo = BuildAddrInfoIPV6(IPV6_LOOP_BACK_ADDRESS, port);
+ sockaddr_in6 addrinfo = BuildAddrInfoIPV6(IPV6_LOOP_BACK_ADDRESS, port);
return bind(GetUnderlyingSocket(), reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in6));
}
else
{
- sockaddr_in addrinfo = BuildAddrInfoIPV4(IPV4_LOOP_BACK_ADDRESS, port);
+ sockaddr_in addrinfo = BuildAddrInfoIPV4(IPV4_LOOP_BACK_ADDRESS, port);
return bind(GetUnderlyingSocket(), reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in));
}
}
int SimpleUDP::SendData(const uint8_t* data, size_t dataLen) const
{
- if (!m_connected)
- {
- ConnectToHost(m_hostIP.c_str(), m_port);
- }
+ if (!m_connected)
+ {
+ ConnectToHost(m_hostIP.c_str(), m_port);
+ }
return send(GetUnderlyingSocket(), data, dataLen, 0);
}
@@ -245,7 +245,7 @@ namespace Aws
{
if (m_connected)
{
- return send(GetUnderlyingSocket(), data, dataLen, 0);
+ return send(GetUnderlyingSocket(), data, dataLen, 0);
}
else
{
@@ -257,16 +257,16 @@ namespace Aws
{
if (m_connected)
{
- return send(GetUnderlyingSocket(), data, dataLen, 0);
+ return send(GetUnderlyingSocket(), data, dataLen, 0);
}
else if (m_addressFamily == AF_INET6)
{
- sockaddr_in6 addrinfo = BuildAddrInfoIPV6(IPV6_LOOP_BACK_ADDRESS, port);
+ sockaddr_in6 addrinfo = BuildAddrInfoIPV6(IPV6_LOOP_BACK_ADDRESS, port);
return sendto(GetUnderlyingSocket(), data, dataLen, 0, reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in6));
}
else
{
- sockaddr_in addrinfo = BuildAddrInfoIPV4(IPV4_LOOP_BACK_ADDRESS, port);
+ sockaddr_in addrinfo = BuildAddrInfoIPV4(IPV4_LOOP_BACK_ADDRESS, port);
return sendto(GetUnderlyingSocket(), data, dataLen, 0, reinterpret_cast<sockaddr*>(&addrinfo), sizeof(sockaddr_in));
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp
index facba6a7a7..ee627340bb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Environment.cpp
@@ -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/platform/Environment.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp
index 447fd9bf09..c1ad818911 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp
@@ -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/platform/FileSystem.h>
#include <aws/core/platform/Environment.h>
@@ -9,7 +9,7 @@
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/UUID.h>
+#include <aws/core/utils/UUID.h>
#include <unistd.h>
#include <pwd.h>
@@ -19,9 +19,9 @@
#include <climits>
#include <cassert>
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
namespace Aws
{
namespace FileSystem
@@ -72,7 +72,7 @@ static const char* FILE_SYSTEM_UTILS_LOG_TAG = "FileSystemUtils";
{
Aws::String entryName = dirEntry->d_name;
if(entryName != ".." && entryName != ".")
- {
+ {
entry = ParseFileInfo(dirEntry, true);
invalidEntry = false;
}
@@ -117,9 +117,9 @@ static const char* FILE_SYSTEM_UTILS_LOG_TAG = "FileSystemUtils";
entry.path = m_directoryEntry.path;
entry.relativePath = m_directoryEntry.relativePath;
}
-
+
AWS_LOGSTREAM_TRACE(FILE_SYSTEM_UTILS_LOG_TAG, "Calling stat on path " << entry.path);
-
+
struct stat dirInfo;
if(!lstat(entry.path.c_str(), &dirInfo))
{
@@ -147,7 +147,7 @@ static const char* FILE_SYSTEM_UTILS_LOG_TAG = "FileSystemUtils";
AWS_LOGSTREAM_ERROR(FILE_SYSTEM_UTILS_LOG_TAG, "Failed to stat file path " << entry.path << " with error code " << errno);
}
- return entry;
+ return entry;
}
DIR* m_dir;
@@ -252,8 +252,8 @@ Aws::String CreateTempFilePath()
{
Aws::StringStream ss;
auto dt = Aws::Utils::DateTime::Now();
-
- ss << dt.ToGmtString("%Y%m%dT%H%M%S") << dt.Millis() << Aws::String(Aws::Utils::UUID::RandomUUID());
+
+ ss << dt.ToGmtString("%Y%m%dT%H%M%S") << dt.Millis() << Aws::String(Aws::Utils::UUID::RandomUUID());
Aws::String tempFile(ss.str());
AWS_LOGSTREAM_DEBUG(FILE_SYSTEM_UTILS_LOG_TAG, "CreateTempFilePath generated: " << tempFile);
@@ -264,22 +264,22 @@ Aws::String CreateTempFilePath()
Aws::String GetExecutableDirectory()
{
char dest[PATH_MAX];
- memset(dest, 0, PATH_MAX);
-#ifdef __APPLE__
- uint32_t destSize = PATH_MAX;
- if (_NSGetExecutablePath(dest, &destSize) == 0)
-#else
- size_t destSize = PATH_MAX;
- if (readlink("/proc/self/exe", dest, destSize))
-#endif
+ memset(dest, 0, PATH_MAX);
+#ifdef __APPLE__
+ uint32_t destSize = PATH_MAX;
+ if (_NSGetExecutablePath(dest, &destSize) == 0)
+#else
+ size_t destSize = PATH_MAX;
+ if (readlink("/proc/self/exe", dest, destSize))
+#endif
{
Aws::String executablePath(dest);
auto lastSlash = executablePath.find_last_of('/');
if(lastSlash != std::string::npos)
{
return executablePath.substr(0, lastSlash);
- }
- }
+ }
+ }
return "./";
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/OSVersionInfo.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/OSVersionInfo.cpp
index ed35c20fa0..040173a2e5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/OSVersionInfo.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/OSVersionInfo.cpp
@@ -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/platform/OSVersionInfo.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Security.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Security.cpp
index 15490f24f0..286de1a948 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Security.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Security.cpp
@@ -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/platform/Security.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Time.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Time.cpp
index 8c8f3b8209..7a0d3d1c0a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Time.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/platform/linux-shared/Time.cpp
@@ -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/platform/Time.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/ARN.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/ARN.cpp
index c4fce2ccac..dac358c09d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/ARN.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/ARN.cpp
@@ -1,46 +1,46 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-
-#include <aws/core/utils/ARN.h>
-#include <aws/core/utils/StringUtils.h>
-#include <aws/core/utils/logging/LogMacros.h>
-
-namespace Aws
-{
- namespace Utils
- {
- ARN::ARN(const Aws::String& arnString)
- {
- m_valid = false;
-
- // An ARN can be identified as any string starting with arn: with 6 defined segments each separated by a :
- const auto result = StringUtils::Split(arnString, ':', StringUtils::SplitOptions::INCLUDE_EMPTY_ENTRIES);
-
- if (result.size() < 6)
- {
- return;
- }
-
- if (result[0] != "arn")
- {
- return;
- }
-
- m_arnString = arnString;
- m_partition = result[1];
- m_service = result[2];
- m_region = result[3];
- m_accountId = result[4];
- m_resource = result[5];
-
- for (size_t i = 6; i < result.size(); i++)
- {
- m_resource += ":" + result[i];
- }
-
- m_valid = true;
- }
- }
-} \ No newline at end of file
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+#include <aws/core/utils/ARN.h>
+#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/logging/LogMacros.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ ARN::ARN(const Aws::String& arnString)
+ {
+ m_valid = false;
+
+ // An ARN can be identified as any string starting with arn: with 6 defined segments each separated by a :
+ const auto result = StringUtils::Split(arnString, ':', StringUtils::SplitOptions::INCLUDE_EMPTY_ENTRIES);
+
+ if (result.size() < 6)
+ {
+ return;
+ }
+
+ if (result[0] != "arn")
+ {
+ return;
+ }
+
+ m_arnString = arnString;
+ m_partition = result[1];
+ m_service = result[2];
+ m_region = result[3];
+ m_accountId = result[4];
+ m_resource = result[5];
+
+ for (size_t i = 6; i < result.size(); i++)
+ {
+ m_resource += ":" + result[i];
+ }
+
+ m_valid = true;
+ }
+ }
+} \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Array.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Array.cpp
index ce9ad56703..43e7863421 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Array.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Array.cpp
@@ -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/utils/Array.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
index 667f181900..ce588150e2 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
@@ -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/utils/DNS.h>
#include <aws/core/utils/StringUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DateTimeCommon.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DateTimeCommon.cpp
index 639688d255..b690c90c2d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DateTimeCommon.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DateTimeCommon.cpp
@@ -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/utils/DateTime.h>
@@ -17,7 +17,7 @@ static const char* CLASS_TAG = "DateTime";
static const char* RFC822_DATE_FORMAT_STR_MINUS_Z = "%a, %d %b %Y %H:%M:%S";
static const char* RFC822_DATE_FORMAT_STR_WITH_Z = "%a, %d %b %Y %H:%M:%S %Z";
static const char* ISO_8601_LONG_DATE_FORMAT_STR = "%Y-%m-%dT%H:%M:%SZ";
-static const char* ISO_8601_LONG_BASIC_DATE_FORMAT_STR = "%Y%m%dT%H%M%SZ";
+static const char* ISO_8601_LONG_BASIC_DATE_FORMAT_STR = "%Y%m%dT%H%M%SZ";
using namespace Aws::Utils;
@@ -79,7 +79,7 @@ static int GetWeekDayNumberFromStr(const char* timeString, size_t startIndex, si
case 'n':
return 0;
default:
- return -1;
+ return -1;
}
default:
return -1;
@@ -210,7 +210,7 @@ static int GetMonthNumberFromStr(const char* timeString, size_t startIndex, size
return 2;
default:
return -1;
- }
+ }
default:
return -1;
}
@@ -376,8 +376,8 @@ static int GetMonthNumberFromStr(const char* timeString, size_t startIndex, size
return -1;
}
}
-// Ensure local classes with generic names have internal linkage
-namespace {
+// Ensure local classes with generic names have internal linkage
+namespace {
class DateParser
{
@@ -385,7 +385,7 @@ public:
DateParser(const char* toParse) : m_error(false), m_toParse(toParse), m_utcAssumed(true)
{
m_parsedTimestamp = CreateZeroedTm();
- memset(m_tz, 0, 7);
+ memset(m_tz, 0, 7);
}
virtual ~DateParser() = default;
@@ -401,8 +401,8 @@ protected:
const char* m_toParse;
std::tm m_parsedTimestamp;
bool m_utcAssumed;
- // The size should be at least one byte greater than the maximum possible size so that we could use the last char to indicate the end of the string.
- char m_tz[7];
+ // The size should be at least one byte greater than the maximum possible size so that we could use the last char to indicate the end of the string.
+ char m_tz[7];
};
static const int MAX_LEN = 100;
@@ -414,8 +414,8 @@ static const int MAX_LEN = 100;
class RFC822DateParser : public DateParser
{
public:
- RFC822DateParser(const char* toParse) : DateParser(toParse), m_state(0)
- {
+ RFC822DateParser(const char* toParse) : DateParser(toParse), m_state(0)
+ {
}
/**
@@ -423,13 +423,13 @@ public:
*/
void Parse() override
{
- size_t len = strlen(m_toParse);
+ size_t len = strlen(m_toParse);
//DOS check
if (len > MAX_LEN)
{
- AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
- m_error = true;
+ AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
+ m_error = true;
return;
}
@@ -445,7 +445,7 @@ public:
{
case 0:
if(c == ',')
- {
+ {
int weekNumber = GetWeekDayNumberFromStr(m_toParse, stateStartIndex, index + 1);
if (weekNumber > -1)
@@ -464,10 +464,10 @@ public:
m_error = true;
}
break;
- case 1:
+ case 1:
if (isspace(c))
{
- m_state = 2;
+ m_state = 2;
stateStartIndex = index + 1;
}
else
@@ -579,18 +579,18 @@ public:
}
break;
case 8:
- if ((isalnum(c) || c == '+' || c == '-') && (index - stateStartIndex < 5))
+ if ((isalnum(c) || c == '+' || c == '-') && (index - stateStartIndex < 5))
{
m_tz[index - stateStartIndex] = c;
- }
- else
- {
- m_error = true;
- }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ default:
+ m_error = true;
break;
- default:
- m_error = true;
- break;
}
index++;
@@ -598,7 +598,7 @@ public:
if (m_tz[0] != 0)
{
- m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
+ m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
}
m_error = (m_error || m_state != finalState);
@@ -607,101 +607,101 @@ public:
int GetState() const { return m_state; }
private:
- //Detects whether or not the passed in timezone string is a UTC zone.
- static bool IsUTCTimeZoneDesignator(const char* str)
- {
- size_t len = strlen(str);
- if (len < 3)
- {
- return false;
- }
-
- int index = 0;
- char c = str[index];
- switch (c)
- {
- case 'U':
- case 'u':
- c = str[++index];
- switch(c)
- {
- case 'T':
- case 't':
- c = str[++index];
- switch(c)
- {
- case 'C':
- case 'c':
- return true;
- default:
- return false;
- }
-
- case 'C':
- case 'c':
- c = str[++index];
- switch (c)
- {
- case 'T':
- case 't':
- return true;
- default:
- return false;
- }
- default:
- return false;
- }
- case 'G':
- case 'g':
- c = str[++index];
- switch (c)
- {
- case 'M':
- case 'm':
- c = str[++index];
- switch (c)
- {
- case 'T':
- case 't':
- return true;
- default:
- return false;
- }
- default:
- return false;
- }
- case '+':
- case '-':
- c = str[++index];
- switch (c)
- {
- case '0':
- c = str[++index];
- switch (c)
- {
- case '0':
- c = str[++index];
- switch (c)
- {
- case '0':
- return true;
- default:
- return false;
- }
- default:
- return false;
- }
- default:
- return false;
- }
- case 'Z':
- return true;
- default:
- return false;
- }
-
- }
-
+ //Detects whether or not the passed in timezone string is a UTC zone.
+ static bool IsUTCTimeZoneDesignator(const char* str)
+ {
+ size_t len = strlen(str);
+ if (len < 3)
+ {
+ return false;
+ }
+
+ int index = 0;
+ char c = str[index];
+ switch (c)
+ {
+ case 'U':
+ case 'u':
+ c = str[++index];
+ switch(c)
+ {
+ case 'T':
+ case 't':
+ c = str[++index];
+ switch(c)
+ {
+ case 'C':
+ case 'c':
+ return true;
+ default:
+ return false;
+ }
+
+ case 'C':
+ case 'c':
+ c = str[++index];
+ switch (c)
+ {
+ case 'T':
+ case 't':
+ return true;
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+ case 'G':
+ case 'g':
+ c = str[++index];
+ switch (c)
+ {
+ case 'M':
+ case 'm':
+ c = str[++index];
+ switch (c)
+ {
+ case 'T':
+ case 't':
+ return true;
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+ case '+':
+ case '-':
+ c = str[++index];
+ switch (c)
+ {
+ case '0':
+ c = str[++index];
+ switch (c)
+ {
+ case '0':
+ c = str[++index];
+ switch (c)
+ {
+ case '0':
+ return true;
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+ case 'Z':
+ return true;
+ default:
+ return false;
+ }
+
+ }
+
int m_state;
};
@@ -724,7 +724,7 @@ public:
//DOS check
if (len > MAX_LEN)
{
- AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
+ AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
m_error = true;
return;
}
@@ -820,10 +820,10 @@ public:
break;
case 5:
- if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 2))
+ if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 2))
{
- m_tz[0] = c;
- m_state = 7;
+ m_tz[0] = c;
+ m_state = 7;
stateStartIndex = index + 1;
}
else if (c == '.' && index - stateStartIndex == 2)
@@ -842,10 +842,10 @@ public:
break;
case 6:
- if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 3))
+ if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 3))
{
- m_tz[0] = c;
- m_state = 7;
+ m_tz[0] = c;
+ m_state = 7;
stateStartIndex = index + 1;
}
else if(!isdigit(c))
@@ -853,263 +853,263 @@ public:
m_error = true;
}
break;
- case 7:
- if ((isdigit(c) || c == ':') && (index - stateStartIndex < 5))
- {
- m_tz[1 + index - stateStartIndex] = c;
- }
- else
- {
- m_error = true;
- }
- break;
- default:
- m_error = true;
- break;
+ case 7:
+ if ((isdigit(c) || c == ':') && (index - stateStartIndex < 5))
+ {
+ m_tz[1 + index - stateStartIndex] = c;
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ default:
+ m_error = true;
+ break;
}
index++;
}
- if (m_tz[0] != 0)
- {
- m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
- }
-
+ if (m_tz[0] != 0)
+ {
+ m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
+ }
+
m_error = (m_error || m_state != finalState);
}
-private:
- //Detects whether or not the passed in timezone string is a UTC zone.
- static bool IsUTCTimeZoneDesignator(const char* str)
- {
- size_t len = strlen(str);
-
- if (len > 0)
- {
- if (len == 1 && str[0] == 'Z')
- {
- return true;
- }
-
- if (len == 6 && str[0] == '+'
- && str[1] == '0'
- && str[2] == '0'
- && str[3] == ':'
- && str[4] == '0'
- && str[5] == '0')
- {
- return true;
- }
-
- return false;
- }
-
- return false;
- }
-
- int m_state;
-};
-
-class ISO_8601BasicDateParser : public DateParser
-{
-public:
- ISO_8601BasicDateParser(const char* stringToParse) : DateParser(stringToParse), m_state(0)
- {
- }
-
- //parses "%Y%m%dT%H%M%SZ or "%Y%m%dT%H%M%S000Z"
- void Parse() override
- {
- size_t len = strlen(m_toParse);
-
- //DOS check
- if (len > MAX_LEN)
- {
- AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
- m_error = true;
- return;
- }
-
- size_t index = 0;
- size_t stateStartIndex = 0;
- const int finalState = 7;
-
- while (m_state <= finalState && !m_error && index < len)
- {
- char c = m_toParse[index];
- switch (m_state)
- {
- // On year: %Y
- case 0:
- if (isdigit(c))
- {
- m_parsedTimestamp.tm_year = m_parsedTimestamp.tm_year * 10 + (c - '0');
- if (index - stateStartIndex == 3)
- {
- m_state = 1;
- stateStartIndex = index + 1;
- m_parsedTimestamp.tm_year -= 1900;
- }
- }
- else
- {
- m_error = true;
- }
- break;
- // On month: %m
- case 1:
- if (isdigit(c))
- {
- m_parsedTimestamp.tm_mon = m_parsedTimestamp.tm_mon * 10 + (c - '0');
- if (index - stateStartIndex == 1)
- {
- m_state = 2;
- stateStartIndex = index + 1;
- m_parsedTimestamp.tm_mon -= 1;
- }
- }
- else
- {
- m_error = true;
- }
- break;
- // On month day: %d
- case 2:
- if (c == 'T' && index - stateStartIndex == 2)
- {
- m_state = 3;
- stateStartIndex = index + 1;
- }
- else if (isdigit(c))
- {
- m_parsedTimestamp.tm_mday = m_parsedTimestamp.tm_mday * 10 + (c - '0');
- }
- else
- {
- m_error = true;
- }
- break;
- // On hour: %H
- case 3:
- if (isdigit(c))
- {
- m_parsedTimestamp.tm_hour = m_parsedTimestamp.tm_hour * 10 + (c - '0');
- if (index - stateStartIndex == 1)
- {
- m_state = 4;
- stateStartIndex = index + 1;
- }
- }
- else
- {
- m_error = true;
- }
- break;
- // On minute: %M
- case 4:
- if (isdigit(c))
- {
- m_parsedTimestamp.tm_min = m_parsedTimestamp.tm_min * 10 + (c - '0');
- if (index - stateStartIndex == 1)
- {
- m_state = 5;
- stateStartIndex = index + 1;
- }
- }
- else
- {
- m_error = true;
- }
- break;
- // On second: %S
- case 5:
- if (isdigit(c))
- {
- m_parsedTimestamp.tm_sec = m_parsedTimestamp.tm_sec * 10 + (c - '0');
- if (index - stateStartIndex == 1)
- {
- m_state = 6;
- stateStartIndex = index + 1;
- }
- }
- else
- {
- m_error = true;
- }
- break;
- // On TZ: Z or 000Z
- case 6:
- if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 0 || index - stateStartIndex == 3))
- {
- m_tz[0] = c;
- m_state = 7;
- stateStartIndex = index + 1;
- }
- else if (!isdigit(c) || index - stateStartIndex > 3)
- {
- m_error = true;
- }
- break;
- case 7:
- if ((isdigit(c) || c == ':') && (index - stateStartIndex < 5))
- {
- m_tz[1 + index - stateStartIndex] = c;
- }
- else
- {
- m_error = true;
- }
- break;
- default:
- m_error = true;
- break;
- }
- index++;
- }
-
- if (m_tz[0] != 0)
- {
- m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
- }
-
- m_error = (m_error || m_state != finalState);
- }
-
private:
- //Detects whether or not the passed in timezone string is a UTC zone.
- static bool IsUTCTimeZoneDesignator(const char* str)
- {
- size_t len = strlen(str);
-
- if (len > 0)
- {
- if (len == 1 && str[0] == 'Z')
- {
- return true;
- }
-
- if (len == 5 && str[0] == '+'
- && str[1] == '0'
- && str[2] == '0'
- && str[3] == '0'
- && str[4] == '0')
- {
- return true;
- }
-
- return false;
- }
-
- return false;
- }
-
+ //Detects whether or not the passed in timezone string is a UTC zone.
+ static bool IsUTCTimeZoneDesignator(const char* str)
+ {
+ size_t len = strlen(str);
+
+ if (len > 0)
+ {
+ if (len == 1 && str[0] == 'Z')
+ {
+ return true;
+ }
+
+ if (len == 6 && str[0] == '+'
+ && str[1] == '0'
+ && str[2] == '0'
+ && str[3] == ':'
+ && str[4] == '0'
+ && str[5] == '0')
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return false;
+ }
+
int m_state;
};
-
-} // namespace
+
+class ISO_8601BasicDateParser : public DateParser
+{
+public:
+ ISO_8601BasicDateParser(const char* stringToParse) : DateParser(stringToParse), m_state(0)
+ {
+ }
+
+ //parses "%Y%m%dT%H%M%SZ or "%Y%m%dT%H%M%S000Z"
+ void Parse() override
+ {
+ size_t len = strlen(m_toParse);
+
+ //DOS check
+ if (len > MAX_LEN)
+ {
+ AWS_LOGSTREAM_WARN(CLASS_TAG, "Incoming String to parse too long with length: " << len)
+ m_error = true;
+ return;
+ }
+
+ size_t index = 0;
+ size_t stateStartIndex = 0;
+ const int finalState = 7;
+
+ while (m_state <= finalState && !m_error && index < len)
+ {
+ char c = m_toParse[index];
+ switch (m_state)
+ {
+ // On year: %Y
+ case 0:
+ if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_year = m_parsedTimestamp.tm_year * 10 + (c - '0');
+ if (index - stateStartIndex == 3)
+ {
+ m_state = 1;
+ stateStartIndex = index + 1;
+ m_parsedTimestamp.tm_year -= 1900;
+ }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On month: %m
+ case 1:
+ if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_mon = m_parsedTimestamp.tm_mon * 10 + (c - '0');
+ if (index - stateStartIndex == 1)
+ {
+ m_state = 2;
+ stateStartIndex = index + 1;
+ m_parsedTimestamp.tm_mon -= 1;
+ }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On month day: %d
+ case 2:
+ if (c == 'T' && index - stateStartIndex == 2)
+ {
+ m_state = 3;
+ stateStartIndex = index + 1;
+ }
+ else if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_mday = m_parsedTimestamp.tm_mday * 10 + (c - '0');
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On hour: %H
+ case 3:
+ if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_hour = m_parsedTimestamp.tm_hour * 10 + (c - '0');
+ if (index - stateStartIndex == 1)
+ {
+ m_state = 4;
+ stateStartIndex = index + 1;
+ }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On minute: %M
+ case 4:
+ if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_min = m_parsedTimestamp.tm_min * 10 + (c - '0');
+ if (index - stateStartIndex == 1)
+ {
+ m_state = 5;
+ stateStartIndex = index + 1;
+ }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On second: %S
+ case 5:
+ if (isdigit(c))
+ {
+ m_parsedTimestamp.tm_sec = m_parsedTimestamp.tm_sec * 10 + (c - '0');
+ if (index - stateStartIndex == 1)
+ {
+ m_state = 6;
+ stateStartIndex = index + 1;
+ }
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ // On TZ: Z or 000Z
+ case 6:
+ if ((c == 'Z' || c == '+' || c == '-' ) && (index - stateStartIndex == 0 || index - stateStartIndex == 3))
+ {
+ m_tz[0] = c;
+ m_state = 7;
+ stateStartIndex = index + 1;
+ }
+ else if (!isdigit(c) || index - stateStartIndex > 3)
+ {
+ m_error = true;
+ }
+ break;
+ case 7:
+ if ((isdigit(c) || c == ':') && (index - stateStartIndex < 5))
+ {
+ m_tz[1 + index - stateStartIndex] = c;
+ }
+ else
+ {
+ m_error = true;
+ }
+ break;
+ default:
+ m_error = true;
+ break;
+ }
+ index++;
+ }
+
+ if (m_tz[0] != 0)
+ {
+ m_utcAssumed = IsUTCTimeZoneDesignator(m_tz);
+ }
+
+ m_error = (m_error || m_state != finalState);
+ }
+
+private:
+ //Detects whether or not the passed in timezone string is a UTC zone.
+ static bool IsUTCTimeZoneDesignator(const char* str)
+ {
+ size_t len = strlen(str);
+
+ if (len > 0)
+ {
+ if (len == 1 && str[0] == 'Z')
+ {
+ return true;
+ }
+
+ if (len == 5 && str[0] == '+'
+ && str[1] == '0'
+ && str[2] == '0'
+ && str[3] == '0'
+ && str[4] == '0')
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return false;
+ }
+
+ int m_state;
+};
+
+} // namespace
DateTime::DateTime(const std::chrono::system_clock::time_point& timepointToAssign) : m_time(timepointToAssign), m_valid(true)
-{
+{
}
DateTime::DateTime(int64_t millisSinceEpoch) : m_valid(true)
@@ -1213,10 +1213,10 @@ Aws::String DateTime::ToLocalTimeString(DateFormat format) const
{
case DateFormat::ISO_8601:
return ToLocalTimeString(ISO_8601_LONG_DATE_FORMAT_STR);
- case DateFormat::ISO_8601_BASIC:
- return ToLocalTimeString(ISO_8601_LONG_BASIC_DATE_FORMAT_STR);
+ case DateFormat::ISO_8601_BASIC:
+ return ToLocalTimeString(ISO_8601_LONG_BASIC_DATE_FORMAT_STR);
case DateFormat::RFC822:
- return ToLocalTimeString(RFC822_DATE_FORMAT_STR_WITH_Z);
+ return ToLocalTimeString(RFC822_DATE_FORMAT_STR_WITH_Z);
default:
assert(0);
return "";
@@ -1238,11 +1238,11 @@ Aws::String DateTime::ToGmtString(DateFormat format) const
{
case DateFormat::ISO_8601:
return ToGmtString(ISO_8601_LONG_DATE_FORMAT_STR);
- case DateFormat::ISO_8601_BASIC:
- return ToGmtString(ISO_8601_LONG_BASIC_DATE_FORMAT_STR);
+ case DateFormat::ISO_8601_BASIC:
+ return ToGmtString(ISO_8601_LONG_BASIC_DATE_FORMAT_STR);
case DateFormat::RFC822:
{
- //Windows erroneously drops the local timezone in for %Z
+ //Windows erroneously drops the local timezone in for %Z
Aws::String rfc822GmtString = ToGmtString(RFC822_DATE_FORMAT_STR_MINUS_Z);
rfc822GmtString += " GMT";
return rfc822GmtString;
@@ -1254,7 +1254,7 @@ Aws::String DateTime::ToGmtString(DateFormat format) const
}
Aws::String DateTime::ToGmtString(const char* formatStr) const
-{
+{
struct tm gmtTimeStamp = ConvertTimestampToGmtStruct();
char formattedString[100];
@@ -1343,31 +1343,31 @@ Aws::String DateTime::CalculateGmtTimestampAsString(const char* formatStr)
return now.ToGmtString(formatStr);
}
-Aws::String DateTime::CalculateGmtTimeWithMsPrecision()
-{
- auto now = DateTime::Now();
- struct tm gmtTimeStamp = now.ConvertTimestampToGmtStruct();
-
- char formattedString[100];
- auto len = std::strftime(formattedString, sizeof(formattedString), "%Y-%m-%d %H:%M:%S", &gmtTimeStamp);
- if (len)
- {
- auto ms = now.Millis();
- ms = ms - ms / 1000 * 1000; // calculate the milliseconds as fraction.
- formattedString[len++] = '.';
- int divisor = 100;
- while(divisor)
- {
- auto digit = ms / divisor;
- formattedString[len++] = char('0' + digit);
- ms = ms - divisor * digit;
- divisor /= 10;
- }
- formattedString[len] = '\0';
- }
- return formattedString;
-}
-
+Aws::String DateTime::CalculateGmtTimeWithMsPrecision()
+{
+ auto now = DateTime::Now();
+ struct tm gmtTimeStamp = now.ConvertTimestampToGmtStruct();
+
+ char formattedString[100];
+ auto len = std::strftime(formattedString, sizeof(formattedString), "%Y-%m-%d %H:%M:%S", &gmtTimeStamp);
+ if (len)
+ {
+ auto ms = now.Millis();
+ ms = ms - ms / 1000 * 1000; // calculate the milliseconds as fraction.
+ formattedString[len++] = '.';
+ int divisor = 100;
+ while(divisor)
+ {
+ auto digit = ms / divisor;
+ formattedString[len++] = char('0' + digit);
+ ms = ms - divisor * digit;
+ divisor /= 10;
+ }
+ formattedString[len] = '\0';
+ }
+ return formattedString;
+}
+
int DateTime::CalculateCurrentHour()
{
return Now().GetHour(true);
@@ -1384,14 +1384,14 @@ std::chrono::milliseconds DateTime::Diff(const DateTime& a, const DateTime& b)
return std::chrono::duration_cast<std::chrono::milliseconds>(diff);
}
-std::chrono::milliseconds DateTime::operator-(const DateTime& other) const
+std::chrono::milliseconds DateTime::operator-(const DateTime& other) const
{
auto diff = this->m_time - other.m_time;
return std::chrono::duration_cast<std::chrono::milliseconds>(diff);
}
void DateTime::ConvertTimestampStringToTimePoint(const char* timestamp, DateFormat format)
-{
+{
std::tm timeStruct;
bool isUtc = true;
@@ -1413,17 +1413,17 @@ void DateTime::ConvertTimestampStringToTimePoint(const char* timestamp, DateForm
m_valid = parser.WasParseSuccessful();
isUtc = parser.ShouldIAssumeThisIsUTC();
timeStruct = parser.GetParsedTimestamp();
- break;
+ break;
+ }
+ case DateFormat::ISO_8601_BASIC:
+ {
+ ISO_8601BasicDateParser parser(timestamp);
+ parser.Parse();
+ m_valid = parser.WasParseSuccessful();
+ isUtc = parser.ShouldIAssumeThisIsUTC();
+ timeStruct = parser.GetParsedTimestamp();
+ break;
}
- case DateFormat::ISO_8601_BASIC:
- {
- ISO_8601BasicDateParser parser(timestamp);
- parser.Parse();
- m_valid = parser.WasParseSuccessful();
- isUtc = parser.ShouldIAssumeThisIsUTC();
- timeStruct = parser.GetParsedTimestamp();
- break;
- }
case DateFormat::AutoDetect:
{
RFC822DateParser rfcParser(timestamp);
@@ -1444,24 +1444,24 @@ void DateTime::ConvertTimestampStringToTimePoint(const char* timestamp, DateForm
timeStruct = isoParser.GetParsedTimestamp();
break;
}
- ISO_8601BasicDateParser isoBasicParser(timestamp);
- isoBasicParser.Parse();
- if (isoBasicParser.WasParseSuccessful())
- {
- m_valid = true;
- isUtc = isoBasicParser.ShouldIAssumeThisIsUTC();
- timeStruct = isoBasicParser.GetParsedTimestamp();
- break;
- }
+ ISO_8601BasicDateParser isoBasicParser(timestamp);
+ isoBasicParser.Parse();
+ if (isoBasicParser.WasParseSuccessful())
+ {
+ m_valid = true;
+ isUtc = isoBasicParser.ShouldIAssumeThisIsUTC();
+ timeStruct = isoBasicParser.GetParsedTimestamp();
+ break;
+ }
m_valid = false;
break;
}
- default:
+ default:
assert(0);
- }
-
+ }
+
if (m_valid)
- {
+ {
std::time_t tt;
if(isUtc)
{
@@ -1474,7 +1474,7 @@ void DateTime::ConvertTimestampStringToTimePoint(const char* timestamp, DateForm
tt = std::mktime(&timeStruct);
}
m_time = std::chrono::system_clock::from_time_t(tt);
- }
+ }
}
tm DateTime::GetTimeStruct(bool localTime) const
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Directory.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Directory.cpp
index 53df08a0df..49ca56b280 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Directory.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/Directory.cpp
@@ -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/platform/FileSystem.h>
#include <aws/core/utils/memory/stl/AWSQueue.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/EnumParseOverflowContainer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/EnumParseOverflowContainer.cpp
index dda261995b..eaeba1d910 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/EnumParseOverflowContainer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/EnumParseOverflowContainer.cpp
@@ -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/utils/EnumParseOverflowContainer.h>
#include <aws/core/utils/logging/LogMacros.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/FileSystemUtils.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/FileSystemUtils.cpp
index 7ddb31c829..c47f750960 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/FileSystemUtils.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/FileSystemUtils.cpp
@@ -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.
*/
#include <aws/core/utils/FileSystemUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/GetTheLights.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/GetTheLights.cpp
index d693ccedf0..6e78b546ab 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/GetTheLights.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/GetTheLights.cpp
@@ -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/utils/GetTheLights.h>
#include <cassert>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp
index e077530c80..147bddf33e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp
@@ -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/utils/logging/LogMacros.h>
#include <aws/core/utils/HashingUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/StringUtils.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/StringUtils.cpp
index 00c940a9bf..e1deb3f046 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/StringUtils.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/StringUtils.cpp
@@ -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/utils/StringUtils.h>
@@ -75,56 +75,56 @@ bool StringUtils::CaselessCompare(const char* value1, const char* value2)
Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn)
{
- return Split(toSplit, splitOn, SIZE_MAX, SplitOptions::NOT_SET);
+ return Split(toSplit, splitOn, SIZE_MAX, SplitOptions::NOT_SET);
+}
+
+Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn, SplitOptions option)
+{
+ return Split(toSplit, splitOn, SIZE_MAX, option);
}
-Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn, SplitOptions option)
-{
- return Split(toSplit, splitOn, SIZE_MAX, option);
-}
-
Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts)
{
- return Split(toSplit, splitOn, numOfTargetParts, SplitOptions::NOT_SET);
-}
-
-Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts, SplitOptions option)
-{
+ return Split(toSplit, splitOn, numOfTargetParts, SplitOptions::NOT_SET);
+}
+
+Aws::Vector<Aws::String> StringUtils::Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts, SplitOptions option)
+{
Aws::Vector<Aws::String> returnValues;
Aws::StringStream input(toSplit);
Aws::String item;
while(returnValues.size() < numOfTargetParts - 1 && std::getline(input, item, splitOn))
{
- if (!item.empty() || option == SplitOptions::INCLUDE_EMPTY_ENTRIES)
+ if (!item.empty() || option == SplitOptions::INCLUDE_EMPTY_ENTRIES)
{
returnValues.emplace_back(std::move(item));
}
}
- if (std::getline(input, item, static_cast<char>(EOF)))
+ if (std::getline(input, item, static_cast<char>(EOF)))
{
- if (option != SplitOptions::INCLUDE_EMPTY_ENTRIES)
- {
- // Trim all leading delimiters.
- item.erase(item.begin(), std::find_if(item.begin(), item.end(), [splitOn](int ch) { return ch != splitOn; }));
- if (!item.empty())
- {
- returnValues.emplace_back(std::move(item));
- }
- }
- else
- {
- returnValues.emplace_back(std::move(item));
- }
-
+ if (option != SplitOptions::INCLUDE_EMPTY_ENTRIES)
+ {
+ // Trim all leading delimiters.
+ item.erase(item.begin(), std::find_if(item.begin(), item.end(), [splitOn](int ch) { return ch != splitOn; }));
+ if (!item.empty())
+ {
+ returnValues.emplace_back(std::move(item));
+ }
+ }
+ else
+ {
+ returnValues.emplace_back(std::move(item));
+ }
+
+ }
+ // To handle the case when there are trailing delimiters.
+ else if (!toSplit.empty() && toSplit.back() == splitOn && option == SplitOptions::INCLUDE_EMPTY_ENTRIES)
+ {
+ returnValues.emplace_back();
}
- // To handle the case when there are trailing delimiters.
- else if (!toSplit.empty() && toSplit.back() == splitOn && option == SplitOptions::INCLUDE_EMPTY_ENTRIES)
- {
- returnValues.emplace_back();
- }
-
+
return returnValues;
}
@@ -282,20 +282,20 @@ Aws::String StringUtils::URLDecode(const char* safe)
return unescaped;
}
-static bool IsSpace(int ch)
-{
- if (ch < -1 || ch > 255)
- {
- return false;
- }
-
- return ::isspace(ch) != 0;
-}
-
+static bool IsSpace(int ch)
+{
+ if (ch < -1 || ch > 255)
+ {
+ return false;
+ }
+
+ return ::isspace(ch) != 0;
+}
+
Aws::String StringUtils::LTrim(const char* source)
{
Aws::String copy(source);
- copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](int ch) { return !IsSpace(ch); }));
+ copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](int ch) { return !IsSpace(ch); }));
return copy;
}
@@ -303,7 +303,7 @@ Aws::String StringUtils::LTrim(const char* source)
Aws::String StringUtils::RTrim(const char* source)
{
Aws::String copy(source);
- copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](int ch) { return !IsSpace(ch); }).base(), copy.end());
+ copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](int ch) { return !IsSpace(ch); }).base(), copy.end());
return copy;
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/TempFile.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/TempFile.cpp
index 74f5d0327e..7bc07266c9 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/TempFile.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/TempFile.cpp
@@ -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/utils/FileSystemUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/UUID.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/UUID.cpp
index 5fdd6d800a..862f3eacdd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/UUID.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/UUID.cpp
@@ -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/utils/UUID.h>
#include <aws/core/utils/HashingUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/base64/Base64.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/base64/Base64.cpp
index 9ea8afd0de..2103d6d5a6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/base64/Base64.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/base64/Base64.cpp
@@ -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/utils/base64/Base64.h>
#include <cstring>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Cipher.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Cipher.cpp
index 03a518f073..1c844273f4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Cipher.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Cipher.cpp
@@ -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/utils/crypto/Cipher.h>
#include <aws/core/utils/crypto/Factories.h>
@@ -27,31 +27,31 @@ namespace Aws
//swap byte ordering
template<class T>
typename std::enable_if<std::is_unsigned<T>::value, T>::type
- bswap(T i, T j = 0u, std::size_t n = 0u)
+ bswap(T i, T j = 0u, std::size_t n = 0u)
{
return n == sizeof(T) ? j :
bswap<T>(i >> CHAR_BIT, (j << CHAR_BIT) | (i & (T)(unsigned char)(-1)), n + 1);
}
CryptoBuffer IncrementCTRCounter(const CryptoBuffer& counter, uint32_t numberOfBlocks)
- {
+ {
// minium counter size is 12 bytes. This isn't a variable because some compilers
// are stupid and thing that variable is unused.
assert(counter.GetLength() >= 12);
- CryptoBuffer incrementedCounter(counter);
+ CryptoBuffer incrementedCounter(counter);
//get the last 4 bytes and manipulate them as an integer.
- uint32_t* ctrPtr = (uint32_t*)(incrementedCounter.GetUnderlyingData() + incrementedCounter.GetLength() - sizeof(int32_t));
+ uint32_t* ctrPtr = (uint32_t*)(incrementedCounter.GetUnderlyingData() + incrementedCounter.GetLength() - sizeof(int32_t));
if(IS_BIG_ENDIAN)
{
//you likely are not Big Endian, but
//if it's big endian, just go ahead and increment it... done
- *ctrPtr += numberOfBlocks;
+ *ctrPtr += numberOfBlocks;
}
else
{
- //otherwise, swap the byte ordering of the integer we loaded from the buffer (because it is backwards). However, the number of blocks is already properly
+ //otherwise, swap the byte ordering of the integer we loaded from the buffer (because it is backwards). However, the number of blocks is already properly
//aligned. Once we compute the new value, swap it back so that the mirroring operation goes back to the actual buffer.
*ctrPtr = bswap<uint32_t>(bswap<uint32_t>(*ctrPtr) + numberOfBlocks);
}
@@ -65,14 +65,14 @@ namespace Aws
CryptoBuffer bytes(lengthBytes);
size_t lengthToGenerate = ctrMode ? (3 * bytes.GetLength()) / 4 : bytes.GetLength();
-
+
rng->GetBytes(bytes.GetUnderlyingData(), lengthToGenerate);
if(!*rng)
{
AWS_LOGSTREAM_FATAL(LOG_TAG, "Random Number generation failed. Abort all crypto operations.");
assert(false);
- abort();
+ abort();
}
return bytes;
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoMaterial.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoMaterial.cpp
index 38542bef76..3036bd70eb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoMaterial.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoMaterial.cpp
@@ -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/utils/crypto/ContentCryptoMaterial.h>
#include <aws/core/utils/crypto/Cipher.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoScheme.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoScheme.cpp
index 7bd0fd8d75..f39a75df2c 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoScheme.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/ContentCryptoScheme.cpp
@@ -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/utils/crypto/ContentCryptoScheme.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoBuf.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoBuf.cpp
index 9e000ad1b4..2b47097679 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoBuf.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoBuf.cpp
@@ -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/utils/crypto/CryptoBuf.h>
@@ -94,7 +94,7 @@ namespace Aws
if (cryptoBuffer.GetLength() && m_cipher)
{
CryptoBuffer putBackArea(m_putBack);
-
+
m_isBuf = CryptoBuffer({&putBackArea, &cryptoBuffer});
//in the very unlikely case that the cipher had less output than the source stream.
assert(seekTo <= index);
@@ -294,19 +294,19 @@ namespace Aws
if(cryptoBuf.GetLength())
{
//allow mid block decryption. We have to decrypt it, but we don't have to write it to the stream.
- //the assumption here is that tellp() will always be 0 or >= 16 bytes. The block offset should only
+ //the assumption here is that tellp() will always be 0 or >= 16 bytes. The block offset should only
//be the offset of the first block read.
- size_t len = cryptoBuf.GetLength();
- size_t blockOffset = m_stream.tellp() > m_blockOffset ? 0 : m_blockOffset;
- if (len > blockOffset)
- {
- m_stream.write(reinterpret_cast<char*>(cryptoBuf.GetUnderlyingData() + blockOffset), len - blockOffset);
- m_blockOffset = 0;
- }
- else
- {
- m_blockOffset -= static_cast<int16_t>(len);
- }
+ size_t len = cryptoBuf.GetLength();
+ size_t blockOffset = m_stream.tellp() > m_blockOffset ? 0 : m_blockOffset;
+ if (len > blockOffset)
+ {
+ m_stream.write(reinterpret_cast<char*>(cryptoBuf.GetUnderlyingData() + blockOffset), len - blockOffset);
+ m_blockOffset = 0;
+ }
+ else
+ {
+ m_blockOffset -= static_cast<int16_t>(len);
+ }
}
return true;
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoStream.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoStream.cpp
index 7d46b9d9ea..2d645f7427 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoStream.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/CryptoStream.cpp
@@ -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/utils/crypto/CryptoStream.h>
namespace Aws
@@ -44,7 +44,7 @@ namespace Aws
void SymmetricCryptoStream::Finalize()
{
- assert(m_cryptoBuf);
+ assert(m_cryptoBuf);
m_cryptoBuf->Finalize();
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/EncryptionMaterials.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/EncryptionMaterials.cpp
index 7ea98027ff..d000c86baa 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/EncryptionMaterials.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/EncryptionMaterials.cpp
@@ -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/utils/crypto/EncryptionMaterials.h>
namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/KeyWrapAlgorithm.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/KeyWrapAlgorithm.cpp
index 9b9b5b144f..b9e098775c 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/KeyWrapAlgorithm.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/KeyWrapAlgorithm.cpp
@@ -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/utils/crypto/KeyWrapAlgorithm.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
@@ -18,9 +18,9 @@ namespace Aws
namespace KeyWrapAlgorithmMapper
{
static const int keyWrapAlgorithm_KMS_HASH = HashingUtils::HashString("kms");
- static const int keyWrapAlgorithm_KMS_CONTEXT_HASH = HashingUtils::HashString("kms+context");
+ static const int keyWrapAlgorithm_KMS_CONTEXT_HASH = HashingUtils::HashString("kms+context");
static const int keyWrapAlgorithm_KeyWrap_HASH = HashingUtils::HashString("AESWrap");
- static const int keyWrapAlgorithm_AES_GCM_HASH = HashingUtils::HashString("AES/GCM");
+ static const int keyWrapAlgorithm_AES_GCM_HASH = HashingUtils::HashString("AES/GCM");
KeyWrapAlgorithm GetKeyWrapAlgorithmForName(const Aws::String& name)
{
@@ -29,17 +29,17 @@ namespace Aws
{
return KeyWrapAlgorithm::KMS;
}
- else if (hashcode == keyWrapAlgorithm_KMS_CONTEXT_HASH)
- {
- return KeyWrapAlgorithm::KMS_CONTEXT;
- }
+ else if (hashcode == keyWrapAlgorithm_KMS_CONTEXT_HASH)
+ {
+ return KeyWrapAlgorithm::KMS_CONTEXT;
+ }
else if (hashcode == keyWrapAlgorithm_KeyWrap_HASH)
{
return KeyWrapAlgorithm::AES_KEY_WRAP;
- }
- else if (hashcode == keyWrapAlgorithm_AES_GCM_HASH)
- {
- return KeyWrapAlgorithm::AES_GCM;
+ }
+ else if (hashcode == keyWrapAlgorithm_AES_GCM_HASH)
+ {
+ return KeyWrapAlgorithm::AES_GCM;
}
assert(0);
return KeyWrapAlgorithm::NONE;
@@ -51,12 +51,12 @@ namespace Aws
{
case KeyWrapAlgorithm::KMS:
return "kms";
- case KeyWrapAlgorithm::KMS_CONTEXT:
- return "kms+context";
+ case KeyWrapAlgorithm::KMS_CONTEXT:
+ return "kms+context";
case KeyWrapAlgorithm::AES_KEY_WRAP:
return "AESWrap";
- case KeyWrapAlgorithm::AES_GCM:
- return "AES/GCM";
+ case KeyWrapAlgorithm::AES_GCM:
+ return "AES/GCM";
default:
assert(0);
}
@@ -65,4 +65,4 @@ namespace Aws
}//namespace KeyWrapAlgorithmMapper
}//namespace Crypto
}//namespace Utils
-}//namespace Aws
+}//namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/MD5.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/MD5.cpp
index 3a26004c79..bf14ace1ad 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/MD5.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/MD5.cpp
@@ -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/utils/crypto/MD5.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256.cpp
index a9a36e6b3b..178df00d37 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256.cpp
@@ -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/utils/crypto/Sha256.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256HMAC.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256HMAC.cpp
index a1a362bb9c..ecc1f06529 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256HMAC.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/Sha256HMAC.cpp
@@ -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/utils/crypto/Sha256HMAC.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/factory/Factories.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/factory/Factories.cpp
index 220968cffc..bff0382241 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/factory/Factories.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/factory/Factories.cpp
@@ -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/utils/crypto/Factories.h>
@@ -9,11 +9,11 @@
#include <aws/core/utils/crypto/HMAC.h>
#if ENABLE_BCRYPT_ENCRYPTION
- #error #include <aws/core/utils/crypto/bcrypt/CryptoImpl.h>
+ #error #include <aws/core/utils/crypto/bcrypt/CryptoImpl.h>
#elif ENABLE_OPENSSL_ENCRYPTION
#include <aws/core/utils/crypto/openssl/CryptoImpl.h>
#elif ENABLE_COMMONCRYPTO_ENCRYPTION
- #error #include <aws/core/utils/crypto/commoncrypto/CryptoImpl.h>
+ #error #include <aws/core/utils/crypto/commoncrypto/CryptoImpl.h>
#include <aws/core/utils/logging/LogMacros.h>
#else
// if you don't have any encryption you still need to pull in the interface definitions
@@ -29,60 +29,60 @@ using namespace Aws::Utils::Crypto;
static const char *s_allocationTag = "CryptoFactory";
-static std::shared_ptr<HashFactory>& GetMD5Factory()
-{
- static std::shared_ptr<HashFactory> s_MD5Factory(nullptr);
- return s_MD5Factory;
-}
-
-static std::shared_ptr<HashFactory>& GetSha256Factory()
-{
- static std::shared_ptr<HashFactory> s_Sha256Factory(nullptr);
- return s_Sha256Factory;
-}
-
-static std::shared_ptr<HMACFactory>& GetSha256HMACFactory()
-{
- static std::shared_ptr<HMACFactory> s_Sha256HMACFactory(nullptr);
- return s_Sha256HMACFactory;
-}
-
-static std::shared_ptr<SymmetricCipherFactory>& GetAES_CBCFactory()
-{
- static std::shared_ptr<SymmetricCipherFactory> s_AES_CBCFactory(nullptr);
- return s_AES_CBCFactory;
-}
-
-static std::shared_ptr<SymmetricCipherFactory>& GetAES_CTRFactory()
-{
- static std::shared_ptr<SymmetricCipherFactory> s_AES_CTRFactory(nullptr);
- return s_AES_CTRFactory;
-}
-
-static std::shared_ptr<SymmetricCipherFactory>& GetAES_GCMFactory()
-{
- static std::shared_ptr<SymmetricCipherFactory> s_AES_GCMFactory(nullptr);
- return s_AES_GCMFactory;
-}
-
-static std::shared_ptr<SymmetricCipherFactory>& GetAES_KeyWrapFactory()
-{
- static std::shared_ptr<SymmetricCipherFactory> s_AES_KeyWrapFactory(nullptr);
- return s_AES_KeyWrapFactory;
-}
-
-static std::shared_ptr<SecureRandomFactory>& GetSecureRandomFactory()
-{
- static std::shared_ptr<SecureRandomFactory> s_SecureRandomFactory(nullptr);
- return s_SecureRandomFactory;
-}
-
-static std::shared_ptr<SecureRandomBytes>& GetSecureRandom()
-{
- static std::shared_ptr<SecureRandomBytes> s_SecureRandom(nullptr);
- return s_SecureRandom;
-}
-
+static std::shared_ptr<HashFactory>& GetMD5Factory()
+{
+ static std::shared_ptr<HashFactory> s_MD5Factory(nullptr);
+ return s_MD5Factory;
+}
+
+static std::shared_ptr<HashFactory>& GetSha256Factory()
+{
+ static std::shared_ptr<HashFactory> s_Sha256Factory(nullptr);
+ return s_Sha256Factory;
+}
+
+static std::shared_ptr<HMACFactory>& GetSha256HMACFactory()
+{
+ static std::shared_ptr<HMACFactory> s_Sha256HMACFactory(nullptr);
+ return s_Sha256HMACFactory;
+}
+
+static std::shared_ptr<SymmetricCipherFactory>& GetAES_CBCFactory()
+{
+ static std::shared_ptr<SymmetricCipherFactory> s_AES_CBCFactory(nullptr);
+ return s_AES_CBCFactory;
+}
+
+static std::shared_ptr<SymmetricCipherFactory>& GetAES_CTRFactory()
+{
+ static std::shared_ptr<SymmetricCipherFactory> s_AES_CTRFactory(nullptr);
+ return s_AES_CTRFactory;
+}
+
+static std::shared_ptr<SymmetricCipherFactory>& GetAES_GCMFactory()
+{
+ static std::shared_ptr<SymmetricCipherFactory> s_AES_GCMFactory(nullptr);
+ return s_AES_GCMFactory;
+}
+
+static std::shared_ptr<SymmetricCipherFactory>& GetAES_KeyWrapFactory()
+{
+ static std::shared_ptr<SymmetricCipherFactory> s_AES_KeyWrapFactory(nullptr);
+ return s_AES_KeyWrapFactory;
+}
+
+static std::shared_ptr<SecureRandomFactory>& GetSecureRandomFactory()
+{
+ static std::shared_ptr<SecureRandomFactory> s_SecureRandomFactory(nullptr);
+ return s_SecureRandomFactory;
+}
+
+static std::shared_ptr<SecureRandomBytes>& GetSecureRandom()
+{
+ static std::shared_ptr<SecureRandomBytes> s_SecureRandom(nullptr);
+ return s_SecureRandom;
+}
+
static bool s_InitCleanupOpenSSLFlag(false);
class DefaultMD5Factory : public HashFactory
@@ -240,7 +240,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer&, const CryptoBuffer&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer&, const CryptoBuffer&) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
return Aws::MakeShared<AES_CBC_Cipher_BCrypt>(s_allocationTag, key, iv);
@@ -258,7 +258,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&&, CryptoBuffer&&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&&, CryptoBuffer&&) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
return Aws::MakeShared<AES_CBC_Cipher_BCrypt>(s_allocationTag, key, iv);
@@ -322,7 +322,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer&, const CryptoBuffer&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer&, const CryptoBuffer&) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
return Aws::MakeShared<AES_CTR_Cipher_BCrypt>(s_allocationTag, key, iv);
@@ -340,7 +340,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&&, CryptoBuffer&&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&&, CryptoBuffer&&) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
return Aws::MakeShared<AES_CTR_Cipher_BCrypt>(s_allocationTag, key, iv);
@@ -395,64 +395,64 @@ public:
#elif ENABLE_OPENSSL_ENCRYPTION
return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, key);
#elif ENABLE_COMMONCRYPTO_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key);
-#else
+ return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key);
+#else
AWS_UNREFERENCED_PARAM(key);
-
+
return nullptr;
-#endif
- }
-
- std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer* aad) const override
- {
-#if ENABLE_BCRYPT_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, key, aad);
-#elif ENABLE_OPENSSL_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, key, aad);
-#elif ENABLE_COMMONCRYPTO_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key, aad);
+#endif
+ }
+
+ std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer* aad) const override
+ {
+#if ENABLE_BCRYPT_ENCRYPTION
+ return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, key, aad);
+#elif ENABLE_OPENSSL_ENCRYPTION
+ return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, key, aad);
+#elif ENABLE_COMMONCRYPTO_ENCRYPTION
+ return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key, aad);
#else
AWS_UNREFERENCED_PARAM(key);
- AWS_UNREFERENCED_PARAM(aad);
+ AWS_UNREFERENCED_PARAM(aad);
return nullptr;
#endif
}
-
+
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer& aad) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer& aad) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, key, iv, tag, aad);
+ return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, key, iv, tag, aad);
#elif ENABLE_OPENSSL_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, key, iv, tag, aad);
+ return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, key, iv, tag, aad);
#elif ENABLE_COMMONCRYPTO_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key, iv, tag, aad);
+ return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, key, iv, tag, aad);
#else
AWS_UNREFERENCED_PARAM(key);
AWS_UNREFERENCED_PARAM(iv);
AWS_UNREFERENCED_PARAM(tag);
- AWS_UNREFERENCED_PARAM(aad);
+ AWS_UNREFERENCED_PARAM(aad);
return nullptr;
#endif
}
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&& aad) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&& aad) const override
{
#if ENABLE_BCRYPT_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
+ return Aws::MakeShared<AES_GCM_Cipher_BCrypt>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
#elif ENABLE_OPENSSL_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
+ return Aws::MakeShared<AES_GCM_Cipher_OpenSSL>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
#elif ENABLE_COMMONCRYPTO_ENCRYPTION
- return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
+ return Aws::MakeShared<AES_GCM_Cipher_CommonCrypto>(s_allocationTag, std::move(key), std::move(iv), std::move(tag), std::move(aad));
#else
AWS_UNREFERENCED_PARAM(key);
AWS_UNREFERENCED_PARAM(iv);
AWS_UNREFERENCED_PARAM(tag);
- AWS_UNREFERENCED_PARAM(aad);
+ AWS_UNREFERENCED_PARAM(aad);
return nullptr;
#endif
}
@@ -505,7 +505,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer&) const override
{
AWS_UNREFERENCED_PARAM(key);
AWS_UNREFERENCED_PARAM(iv);
@@ -515,7 +515,7 @@ public:
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
- std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&&) const override
+ std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&&) const override
{
AWS_UNREFERENCED_PARAM(key);
AWS_UNREFERENCED_PARAM(iv);
@@ -606,190 +606,190 @@ void Aws::Utils::Crypto::SetInitCleanupOpenSSLFlag(bool initCleanupFlag)
void Aws::Utils::Crypto::InitCrypto()
{
- if(GetMD5Factory())
+ if(GetMD5Factory())
{
- GetMD5Factory()->InitStaticState();
+ GetMD5Factory()->InitStaticState();
}
else
{
- GetMD5Factory() = Aws::MakeShared<DefaultMD5Factory>(s_allocationTag);
- GetMD5Factory()->InitStaticState();
+ GetMD5Factory() = Aws::MakeShared<DefaultMD5Factory>(s_allocationTag);
+ GetMD5Factory()->InitStaticState();
}
- if(GetSha256Factory())
+ if(GetSha256Factory())
{
- GetSha256Factory()->InitStaticState();
+ GetSha256Factory()->InitStaticState();
}
else
{
- GetSha256Factory() = Aws::MakeShared<DefaultSHA256Factory>(s_allocationTag);
- GetSha256Factory()->InitStaticState();
+ GetSha256Factory() = Aws::MakeShared<DefaultSHA256Factory>(s_allocationTag);
+ GetSha256Factory()->InitStaticState();
}
- if(GetSha256HMACFactory())
+ if(GetSha256HMACFactory())
{
- GetSha256HMACFactory()->InitStaticState();
+ GetSha256HMACFactory()->InitStaticState();
}
else
{
- GetSha256HMACFactory() = Aws::MakeShared<DefaultSHA256HmacFactory>(s_allocationTag);
- GetSha256HMACFactory()->InitStaticState();
+ GetSha256HMACFactory() = Aws::MakeShared<DefaultSHA256HmacFactory>(s_allocationTag);
+ GetSha256HMACFactory()->InitStaticState();
}
- if(GetAES_CBCFactory())
+ if(GetAES_CBCFactory())
{
- GetAES_CBCFactory()->InitStaticState();
+ GetAES_CBCFactory()->InitStaticState();
}
else
{
- GetAES_CBCFactory() = Aws::MakeShared<DefaultAES_CBCFactory>(s_allocationTag);
- GetAES_CBCFactory()->InitStaticState();
+ GetAES_CBCFactory() = Aws::MakeShared<DefaultAES_CBCFactory>(s_allocationTag);
+ GetAES_CBCFactory()->InitStaticState();
}
- if(GetAES_CTRFactory())
+ if(GetAES_CTRFactory())
{
- GetAES_CTRFactory()->InitStaticState();
+ GetAES_CTRFactory()->InitStaticState();
}
else
{
- GetAES_CTRFactory() = Aws::MakeShared<DefaultAES_CTRFactory>(s_allocationTag);
- GetAES_CTRFactory()->InitStaticState();
+ GetAES_CTRFactory() = Aws::MakeShared<DefaultAES_CTRFactory>(s_allocationTag);
+ GetAES_CTRFactory()->InitStaticState();
}
- if(GetAES_GCMFactory())
+ if(GetAES_GCMFactory())
{
- GetAES_GCMFactory()->InitStaticState();
+ GetAES_GCMFactory()->InitStaticState();
}
else
{
- GetAES_GCMFactory() = Aws::MakeShared<DefaultAES_GCMFactory>(s_allocationTag);
- GetAES_GCMFactory()->InitStaticState();
+ GetAES_GCMFactory() = Aws::MakeShared<DefaultAES_GCMFactory>(s_allocationTag);
+ GetAES_GCMFactory()->InitStaticState();
}
- if (!GetAES_KeyWrapFactory())
+ if (!GetAES_KeyWrapFactory())
{
- GetAES_KeyWrapFactory() = Aws::MakeShared<DefaultAES_KeyWrapFactory>(s_allocationTag);
+ GetAES_KeyWrapFactory() = Aws::MakeShared<DefaultAES_KeyWrapFactory>(s_allocationTag);
}
- GetAES_KeyWrapFactory()->InitStaticState();
+ GetAES_KeyWrapFactory()->InitStaticState();
- if(GetSecureRandomFactory())
+ if(GetSecureRandomFactory())
{
- GetSecureRandomFactory()->InitStaticState();
+ GetSecureRandomFactory()->InitStaticState();
}
else
{
- GetSecureRandomFactory() = Aws::MakeShared<DefaultSecureRandFactory>(s_allocationTag);
- GetSecureRandomFactory()->InitStaticState();
- }
-
- GetSecureRandom() = GetSecureRandomFactory()->CreateImplementation();
+ GetSecureRandomFactory() = Aws::MakeShared<DefaultSecureRandFactory>(s_allocationTag);
+ GetSecureRandomFactory()->InitStaticState();
+ }
+
+ GetSecureRandom() = GetSecureRandomFactory()->CreateImplementation();
}
void Aws::Utils::Crypto::CleanupCrypto()
{
- if(GetMD5Factory())
+ if(GetMD5Factory())
{
- GetMD5Factory()->CleanupStaticState();
- GetMD5Factory() = nullptr;
+ GetMD5Factory()->CleanupStaticState();
+ GetMD5Factory() = nullptr;
}
- if(GetSha256Factory())
+ if(GetSha256Factory())
{
- GetSha256Factory()->CleanupStaticState();
- GetSha256Factory() = nullptr;
+ GetSha256Factory()->CleanupStaticState();
+ GetSha256Factory() = nullptr;
}
- if(GetSha256HMACFactory())
+ if(GetSha256HMACFactory())
{
- GetSha256HMACFactory()->CleanupStaticState();
- GetSha256HMACFactory() = nullptr;
+ GetSha256HMACFactory()->CleanupStaticState();
+ GetSha256HMACFactory() = nullptr;
}
- if(GetAES_CBCFactory())
+ if(GetAES_CBCFactory())
{
- GetAES_CBCFactory()->CleanupStaticState();
- GetAES_CBCFactory() = nullptr;
+ GetAES_CBCFactory()->CleanupStaticState();
+ GetAES_CBCFactory() = nullptr;
}
- if(GetAES_CTRFactory())
+ if(GetAES_CTRFactory())
{
- GetAES_CTRFactory()->CleanupStaticState();
- GetAES_CTRFactory() = nullptr;
+ GetAES_CTRFactory()->CleanupStaticState();
+ GetAES_CTRFactory() = nullptr;
}
- if(GetAES_GCMFactory())
+ if(GetAES_GCMFactory())
{
- GetAES_GCMFactory()->CleanupStaticState();
- GetAES_GCMFactory() = nullptr;
+ GetAES_GCMFactory()->CleanupStaticState();
+ GetAES_GCMFactory() = nullptr;
}
- if(GetAES_KeyWrapFactory())
+ if(GetAES_KeyWrapFactory())
{
- GetAES_KeyWrapFactory()->CleanupStaticState();
- GetAES_KeyWrapFactory() = nullptr;
+ GetAES_KeyWrapFactory()->CleanupStaticState();
+ GetAES_KeyWrapFactory() = nullptr;
}
- if(GetSecureRandomFactory())
+ if(GetSecureRandomFactory())
{
- GetSecureRandom() = nullptr;
- GetSecureRandomFactory()->CleanupStaticState();
- GetSecureRandomFactory() = nullptr;
- }
+ GetSecureRandom() = nullptr;
+ GetSecureRandomFactory()->CleanupStaticState();
+ GetSecureRandomFactory() = nullptr;
+ }
}
void Aws::Utils::Crypto::SetMD5Factory(const std::shared_ptr<HashFactory>& factory)
{
- GetMD5Factory() = factory;
+ GetMD5Factory() = factory;
}
void Aws::Utils::Crypto::SetSha256Factory(const std::shared_ptr<HashFactory>& factory)
{
- GetSha256Factory() = factory;
+ GetSha256Factory() = factory;
}
void Aws::Utils::Crypto::SetSha256HMACFactory(const std::shared_ptr<HMACFactory>& factory)
{
- GetSha256HMACFactory() = factory;
+ GetSha256HMACFactory() = factory;
}
void Aws::Utils::Crypto::SetAES_CBCFactory(const std::shared_ptr<SymmetricCipherFactory>& factory)
{
- GetAES_CBCFactory() = factory;
+ GetAES_CBCFactory() = factory;
}
void Aws::Utils::Crypto::SetAES_CTRFactory(const std::shared_ptr<SymmetricCipherFactory>& factory)
{
- GetAES_CTRFactory() = factory;
+ GetAES_CTRFactory() = factory;
}
void Aws::Utils::Crypto::SetAES_GCMFactory(const std::shared_ptr<SymmetricCipherFactory>& factory)
{
- GetAES_GCMFactory() = factory;
+ GetAES_GCMFactory() = factory;
}
void Aws::Utils::Crypto::SetAES_KeyWrapFactory(const std::shared_ptr<SymmetricCipherFactory>& factory)
{
- GetAES_KeyWrapFactory() = factory;
+ GetAES_KeyWrapFactory() = factory;
}
void Aws::Utils::Crypto::SetSecureRandomFactory(const std::shared_ptr<SecureRandomFactory>& factory)
{
- GetSecureRandomFactory() = factory;
+ GetSecureRandomFactory() = factory;
}
std::shared_ptr<Hash> Aws::Utils::Crypto::CreateMD5Implementation()
{
- return GetMD5Factory()->CreateImplementation();
+ return GetMD5Factory()->CreateImplementation();
}
std::shared_ptr<Hash> Aws::Utils::Crypto::CreateSha256Implementation()
{
- return GetSha256Factory()->CreateImplementation();
+ return GetSha256Factory()->CreateImplementation();
}
std::shared_ptr<Aws::Utils::Crypto::HMAC> Aws::Utils::Crypto::CreateSha256HMACImplementation()
{
- return GetSha256HMACFactory()->CreateImplementation();
+ return GetSha256HMACFactory()->CreateImplementation();
}
#ifdef _WIN32
@@ -802,7 +802,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CBCImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CBCFactory()->CreateImplementation(key);
+ return GetAES_CBCFactory()->CreateImplementation(key);
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CBCImplementation(const CryptoBuffer& key, const CryptoBuffer& iv)
@@ -810,7 +810,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CBCImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CBCFactory()->CreateImplementation(key, iv);
+ return GetAES_CBCFactory()->CreateImplementation(key, iv);
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CBCImplementation(CryptoBuffer&& key, CryptoBuffer&& iv)
@@ -818,7 +818,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CBCImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CBCFactory()->CreateImplementation(std::move(key), std::move(iv));
+ return GetAES_CBCFactory()->CreateImplementation(std::move(key), std::move(iv));
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation(const CryptoBuffer& key)
@@ -826,7 +826,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CTRFactory()->CreateImplementation(key);
+ return GetAES_CTRFactory()->CreateImplementation(key);
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation(const CryptoBuffer& key, const CryptoBuffer& iv)
@@ -834,7 +834,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CTRFactory()->CreateImplementation(key, iv);
+ return GetAES_CTRFactory()->CreateImplementation(key, iv);
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation(CryptoBuffer&& key, CryptoBuffer&& iv)
@@ -842,7 +842,7 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_CTRImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_CTRFactory()->CreateImplementation(std::move(key), std::move(iv));
+ return GetAES_CTRFactory()->CreateImplementation(std::move(key), std::move(iv));
}
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(const CryptoBuffer& key)
@@ -850,39 +850,39 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_GCMFactory()->CreateImplementation(key);
+ return GetAES_GCMFactory()->CreateImplementation(key);
+}
+
+std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer* aad)
+{
+#ifdef NO_SYMMETRIC_ENCRYPTION
+ return nullptr;
+#endif
+ return GetAES_GCMFactory()->CreateImplementation(key, aad);
}
-std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer* aad)
+std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer& aad)
{
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_GCMFactory()->CreateImplementation(key, aad);
+ return GetAES_GCMFactory()->CreateImplementation(key, iv, tag, aad);
}
-std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag, const CryptoBuffer& aad)
+std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&& aad)
{
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_GCMFactory()->CreateImplementation(key, iv, tag, aad);
+ return GetAES_GCMFactory()->CreateImplementation(std::move(key), std::move(iv), std::move(tag), std::move(aad));
}
-std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag, CryptoBuffer&& aad)
-{
-#ifdef NO_SYMMETRIC_ENCRYPTION
- return nullptr;
-#endif
- return GetAES_GCMFactory()->CreateImplementation(std::move(key), std::move(iv), std::move(tag), std::move(aad));
-}
-
std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_KeyWrapImplementation(const CryptoBuffer& key)
{
#ifdef NO_SYMMETRIC_ENCRYPTION
return nullptr;
#endif
- return GetAES_KeyWrapFactory()->CreateImplementation(key);
+ return GetAES_KeyWrapFactory()->CreateImplementation(key);
}
#ifdef _WIN32
@@ -891,5 +891,5 @@ std::shared_ptr<SymmetricCipher> Aws::Utils::Crypto::CreateAES_KeyWrapImplementa
std::shared_ptr<SecureRandomBytes> Aws::Utils::Crypto::CreateSecureRandomBytesImplementation()
{
- return GetSecureRandom();
+ return GetSecureRandom();
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
index b76930d1fc..911838864b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
@@ -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 <cstring>
@@ -9,21 +9,21 @@
#include <aws/core/utils/crypto/openssl/CryptoImpl.h>
#include <aws/core/utils/Outcome.h>
#include <openssl/md5.h>
-
-#ifdef OPENSSL_IS_BORINGSSL
-#ifdef _MSC_VER
-AWS_SUPPRESS_WARNING_PUSH(4201)
-#else
-AWS_SUPPRESS_WARNING_PUSH("-Wpedantic")
-#endif
-#endif
-
+
+#ifdef OPENSSL_IS_BORINGSSL
+#ifdef _MSC_VER
+AWS_SUPPRESS_WARNING_PUSH(4201)
+#else
+AWS_SUPPRESS_WARNING_PUSH("-Wpedantic")
+#endif
+#endif
+
#include <openssl/sha.h>
-
-#ifdef OPENSSL_IS_BORINGSSL
-AWS_SUPPRESS_WARNING_POP
-#endif
-
+
+#ifdef OPENSSL_IS_BORINGSSL
+AWS_SUPPRESS_WARNING_POP
+#endif
+
#include <openssl/err.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <thread>
@@ -41,7 +41,7 @@ namespace Aws
{
/**
* openssl with OPENSSL_VERSION_NUMBER < 0x10100003L made data type details unavailable
- * libressl use openssl with data type details available, but mandatorily set
+ * libressl use openssl with data type details available, but mandatorily set
* OPENSSL_VERSION_NUMBER = 0x20000000L, insane!
* https://github.com/aws/aws-sdk-cpp/pull/507/commits/2c99f1fe0c4b4683280caeb161538d4724d6a179
*/
@@ -60,14 +60,14 @@ namespace Aws
void init_static_state()
{
-#if OPENSSL_VERSION_LESS_1_1 || defined(OPENSSL_IS_BORINGSSL)
- ERR_load_crypto_strings();
-#else
- OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS /*options*/ ,NULL /* OpenSSL init settings*/ );
-#endif
-#if !defined(OPENSSL_IS_BORINGSSL)
+#if OPENSSL_VERSION_LESS_1_1 || defined(OPENSSL_IS_BORINGSSL)
+ ERR_load_crypto_strings();
+#else
+ OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS /*options*/ ,NULL /* OpenSSL init settings*/ );
+#endif
+#if !defined(OPENSSL_IS_BORINGSSL)
OPENSSL_add_all_algorithms_noconf();
-#endif
+#endif
#if OPENSSL_VERSION_LESS_1_1
if (!CRYPTO_get_locking_callback())
{
@@ -122,22 +122,22 @@ namespace Aws
#endif
}
- static const char* OPENSSL_LOG_TAG = "OpenSSLCipher";
-
+ static const char* OPENSSL_LOG_TAG = "OpenSSLCipher";
+
void SecureRandomBytes_OpenSSLImpl::GetBytes(unsigned char* buffer, size_t bufferSize)
{
- if (!bufferSize)
- {
- return;
- }
-
- if (!buffer)
- {
- AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Secure Random Bytes generator can't generate: " << bufferSize << " bytes with nullptr buffer.");
- assert(buffer);
- return;
- }
-
+ if (!bufferSize)
+ {
+ return;
+ }
+
+ if (!buffer)
+ {
+ AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Secure Random Bytes generator can't generate: " << bufferSize << " bytes with nullptr buffer.");
+ assert(buffer);
+ return;
+ }
+
int success = RAND_bytes(buffer, static_cast<int>(bufferSize));
if (success != 1)
{
@@ -145,22 +145,22 @@ namespace Aws
}
}
- class OpensslCtxRAIIGuard
+ class OpensslCtxRAIIGuard
{
- public:
- OpensslCtxRAIIGuard()
+ public:
+ OpensslCtxRAIIGuard()
{
m_ctx = EVP_MD_CTX_create();
assert(m_ctx != nullptr);
}
- ~OpensslCtxRAIIGuard()
+ ~OpensslCtxRAIIGuard()
{
EVP_MD_CTX_destroy(m_ctx);
m_ctx = nullptr;
}
- EVP_MD_CTX* getResource()
+ EVP_MD_CTX* getResource()
{
return m_ctx;
}
@@ -172,9 +172,9 @@ namespace Aws
{
OpensslCtxRAIIGuard guard;
auto ctx = guard.getResource();
-#if !defined(OPENSSL_IS_BORINGSSL)
+#if !defined(OPENSSL_IS_BORINGSSL)
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
-#endif
+#endif
EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);
EVP_DigestUpdate(ctx, str.c_str(), str.size());
@@ -188,9 +188,9 @@ namespace Aws
{
OpensslCtxRAIIGuard guard;
auto ctx = guard.getResource();
-#if !defined(OPENSSL_IS_BORINGSSL)
+#if !defined(OPENSSL_IS_BORINGSSL)
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
-#endif
+#endif
EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);
auto currentPos = stream.tellg();
@@ -304,7 +304,7 @@ namespace Aws
unsigned int length = SHA256_DIGEST_LENGTH;
ByteBuffer digest(length);
memset(digest.GetUnderlyingData(), 0, length);
-
+
HMACRAIIGuard guard;
HMAC_CTX* m_ctx = guard.getResource();
@@ -381,11 +381,11 @@ namespace Aws
void OpenSSLCipher::Init()
{
- if (m_failure)
- {
- return;
- }
-
+ if (m_failure)
+ {
+ return;
+ }
+
if (!m_encryptor_ctx)
{
// EVP_CIPHER_CTX_init() will be called inside EVP_CIPHER_CTX_new().
@@ -406,7 +406,7 @@ namespace Aws
{ // _init is the same as _reset after openssl 1.1
EVP_CIPHER_CTX_init(m_decryptor_ctx);
}
- m_emptyPlaintext = false;
+ m_emptyPlaintext = false;
}
CryptoBuffer OpenSSLCipher::EncryptBuffer(const CryptoBuffer& unEncryptedData)
@@ -440,7 +440,7 @@ namespace Aws
{
if (m_failure)
{
- AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Cipher not properly initialized for encryption finalization. Aborting");
+ AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Cipher not properly initialized for encryption finalization. Aborting");
return CryptoBuffer();
}
@@ -475,10 +475,10 @@ namespace Aws
return CryptoBuffer();
}
- if (lengthWritten == 0)
- {
- m_emptyPlaintext = true;
- }
+ if (lengthWritten == 0)
+ {
+ m_emptyPlaintext = true;
+ }
if (static_cast<size_t>(lengthWritten) < decryptedText.GetLength())
{
return CryptoBuffer(decryptedText.GetUnderlyingData(), static_cast<size_t>(lengthWritten));
@@ -490,18 +490,18 @@ namespace Aws
{
if (m_failure)
{
- AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Cipher not properly initialized for decryption finalization. Aborting");
+ AWS_LOGSTREAM_FATAL(OPENSSL_LOG_TAG, "Cipher not properly initialized for decryption finalization. Aborting");
return CryptoBuffer();
}
CryptoBuffer finalBlock(GetBlockSizeBytes());
int writtenSize = static_cast<int>(finalBlock.GetLength());
- int ret = EVP_DecryptFinal_ex(m_decryptor_ctx, finalBlock.GetUnderlyingData(), &writtenSize);
-#if OPENSSL_VERSION_NUMBER > 0x1010104fL //1.1.1d
- if (ret <= 0)
-#else
- if (ret <= 0 && !m_emptyPlaintext) // see details why making exception for empty string at: https://github.com/aws/aws-sdk-cpp/issues/1413
-#endif
+ int ret = EVP_DecryptFinal_ex(m_decryptor_ctx, finalBlock.GetUnderlyingData(), &writtenSize);
+#if OPENSSL_VERSION_NUMBER > 0x1010104fL //1.1.1d
+ if (ret <= 0)
+#else
+ if (ret <= 0 && !m_emptyPlaintext) // see details why making exception for empty string at: https://github.com/aws/aws-sdk-cpp/issues/1413
+#endif
{
m_failure = true;
LogErrors();
@@ -519,18 +519,18 @@ namespace Aws
void OpenSSLCipher::Cleanup()
{
m_failure = false;
- if (m_encryptor_ctx) EVP_CIPHER_CTX_cleanup(m_encryptor_ctx);
- if (m_decryptor_ctx) EVP_CIPHER_CTX_cleanup(m_decryptor_ctx);
- }
+ if (m_encryptor_ctx) EVP_CIPHER_CTX_cleanup(m_encryptor_ctx);
+ if (m_decryptor_ctx) EVP_CIPHER_CTX_cleanup(m_decryptor_ctx);
+ }
- bool OpenSSLCipher::CheckKeyAndIVLength(size_t expectedKeyLength, size_t expectedIVLength)
- {
- if (!m_failure && ((m_key.GetLength() != expectedKeyLength) || m_initializationVector.GetLength() != expectedIVLength))
- {
- AWS_LOGSTREAM_ERROR(OPENSSL_LOG_TAG, "Expected Key size is: " << expectedKeyLength << " and expected IV size is: " << expectedIVLength);
- m_failure = true;
- }
- return !m_failure;
+ bool OpenSSLCipher::CheckKeyAndIVLength(size_t expectedKeyLength, size_t expectedIVLength)
+ {
+ if (!m_failure && ((m_key.GetLength() != expectedKeyLength) || m_initializationVector.GetLength() != expectedIVLength))
+ {
+ AWS_LOGSTREAM_ERROR(OPENSSL_LOG_TAG, "Expected Key size is: " << expectedKeyLength << " and expected IV size is: " << expectedIVLength);
+ m_failure = true;
+ }
+ return !m_failure;
}
size_t AES_CBC_Cipher_OpenSSL::BlockSizeBytes = 16;
@@ -557,11 +557,11 @@ namespace Aws
void AES_CBC_Cipher_OpenSSL::InitCipher()
{
- if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, BlockSizeBytes))
- {
- return;
- }
-
+ if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, BlockSizeBytes))
+ {
+ return;
+ }
+
if (!EVP_EncryptInit_ex(m_encryptor_ctx, EVP_aes_256_cbc(), nullptr, m_key.GetUnderlyingData(),
m_initializationVector.GetUnderlyingData()) ||
!EVP_DecryptInit_ex(m_decryptor_ctx, EVP_aes_256_cbc(), nullptr, m_key.GetUnderlyingData(),
@@ -582,12 +582,12 @@ namespace Aws
return KeyLengthBits;
}
- void AES_CBC_Cipher_OpenSSL::Reset()
- {
- OpenSSLCipher::Reset();
- InitCipher();
- }
-
+ void AES_CBC_Cipher_OpenSSL::Reset()
+ {
+ OpenSSLCipher::Reset();
+ InitCipher();
+ }
+
size_t AES_CTR_Cipher_OpenSSL::BlockSizeBytes = 16;
size_t AES_CTR_Cipher_OpenSSL::KeyLengthBits = 256;
static const char* CTR_LOG_TAG = "AES_CTR_Cipher_OpenSSL";
@@ -613,11 +613,11 @@ namespace Aws
void AES_CTR_Cipher_OpenSSL::InitCipher()
{
- if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, BlockSizeBytes))
- {
- return;
- }
-
+ if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, BlockSizeBytes))
+ {
+ return;
+ }
+
if (!(EVP_EncryptInit_ex(m_encryptor_ctx, EVP_aes_256_ctr(), nullptr, m_key.GetUnderlyingData(),
m_initializationVector.GetUnderlyingData())
&& EVP_CIPHER_CTX_set_padding(m_encryptor_ctx, 0)) ||
@@ -640,12 +640,12 @@ namespace Aws
return KeyLengthBits;
}
- void AES_CTR_Cipher_OpenSSL::Reset()
- {
- OpenSSLCipher::Reset();
- InitCipher();
- }
-
+ void AES_CTR_Cipher_OpenSSL::Reset()
+ {
+ OpenSSLCipher::Reset();
+ InitCipher();
+ }
+
size_t AES_GCM_Cipher_OpenSSL::BlockSizeBytes = 16;
size_t AES_GCM_Cipher_OpenSSL::KeyLengthBits = 256;
size_t AES_GCM_Cipher_OpenSSL::IVLengthBytes = 12;
@@ -653,62 +653,62 @@ namespace Aws
static const char* GCM_LOG_TAG = "AES_GCM_Cipher_OpenSSL";
- AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key)
- : OpenSSLCipher(key, IVLengthBytes)
+ AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key)
+ : OpenSSLCipher(key, IVLengthBytes)
+ {
+ InitCipher();
+ }
+
+ AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer* aad)
+ : OpenSSLCipher(key, IVLengthBytes), m_aad(*aad)
{
InitCipher();
}
- AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer* aad)
- : OpenSSLCipher(key, IVLengthBytes), m_aad(*aad)
- {
- InitCipher();
- }
-
AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector,
- CryptoBuffer&& tag, CryptoBuffer&& aad) :
- OpenSSLCipher(std::move(key), std::move(initializationVector), std::move(tag)), m_aad(std::move(aad))
+ CryptoBuffer&& tag, CryptoBuffer&& aad) :
+ OpenSSLCipher(std::move(key), std::move(initializationVector), std::move(tag)), m_aad(std::move(aad))
{
InitCipher();
}
- AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
- const CryptoBuffer& tag, const CryptoBuffer& aad) :
- OpenSSLCipher(key, initializationVector, tag), m_aad(std::move(aad))
+ AES_GCM_Cipher_OpenSSL::AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
+ const CryptoBuffer& tag, const CryptoBuffer& aad) :
+ OpenSSLCipher(key, initializationVector, tag), m_aad(std::move(aad))
{
InitCipher();
}
CryptoBuffer AES_GCM_Cipher_OpenSSL::FinalizeEncryption()
{
- if (m_failure)
- {
- AWS_LOGSTREAM_FATAL(GCM_LOG_TAG, "Cipher not properly initialized for encryption finalization. Aborting");
- return CryptoBuffer();
- }
-
- int writtenSize = 0;
- CryptoBuffer finalBlock(GetBlockSizeBytes());
- EVP_EncryptFinal_ex(m_encryptor_ctx, finalBlock.GetUnderlyingData(), &writtenSize);
-
+ if (m_failure)
+ {
+ AWS_LOGSTREAM_FATAL(GCM_LOG_TAG, "Cipher not properly initialized for encryption finalization. Aborting");
+ return CryptoBuffer();
+ }
+
+ int writtenSize = 0;
+ CryptoBuffer finalBlock(GetBlockSizeBytes());
+ EVP_EncryptFinal_ex(m_encryptor_ctx, finalBlock.GetUnderlyingData(), &writtenSize);
+
m_tag = CryptoBuffer(TagLengthBytes);
- if (!EVP_CIPHER_CTX_ctrl(m_encryptor_ctx, EVP_CTRL_GCM_GET_TAG, static_cast<int>(m_tag.GetLength()),
+ if (!EVP_CIPHER_CTX_ctrl(m_encryptor_ctx, EVP_CTRL_GCM_GET_TAG, static_cast<int>(m_tag.GetLength()),
m_tag.GetUnderlyingData()))
{
m_failure = true;
LogErrors(GCM_LOG_TAG);
}
- return CryptoBuffer();
+ return CryptoBuffer();
}
void AES_GCM_Cipher_OpenSSL::InitCipher()
{
- if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, IVLengthBytes))
- {
- return;
- }
-
+ if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, IVLengthBytes))
+ {
+ return;
+ }
+
if (!(EVP_EncryptInit_ex(m_encryptor_ctx, EVP_aes_256_gcm(), nullptr, nullptr, nullptr) &&
EVP_EncryptInit_ex(m_encryptor_ctx, nullptr, nullptr, m_key.GetUnderlyingData(),
m_initializationVector.GetUnderlyingData()) &&
@@ -723,29 +723,29 @@ namespace Aws
return;
}
- if (m_aad.GetLength() > 0)
- {
- int outLen = 0;
- if(!EVP_EncryptUpdate(m_encryptor_ctx, nullptr, &outLen, m_aad.GetUnderlyingData(), m_aad.GetLength())
- || !EVP_DecryptUpdate(m_decryptor_ctx, nullptr, &outLen, m_aad.GetUnderlyingData(), m_aad.GetLength()))
- {
- m_failure = true;
- LogErrors(GCM_LOG_TAG);
- return;
- }
- }
-
+ if (m_aad.GetLength() > 0)
+ {
+ int outLen = 0;
+ if(!EVP_EncryptUpdate(m_encryptor_ctx, nullptr, &outLen, m_aad.GetUnderlyingData(), m_aad.GetLength())
+ || !EVP_DecryptUpdate(m_decryptor_ctx, nullptr, &outLen, m_aad.GetUnderlyingData(), m_aad.GetLength()))
+ {
+ m_failure = true;
+ LogErrors(GCM_LOG_TAG);
+ return;
+ }
+ }
+
//tag should always be set in GCM decrypt mode
if (m_tag.GetLength() > 0)
{
if (m_tag.GetLength() < TagLengthBytes)
{
- AWS_LOGSTREAM_ERROR(GCM_LOG_TAG, "Illegal attempt to decrypt an AES GCM payload without a valid tag set: tag length=" << m_tag.GetLength());
+ AWS_LOGSTREAM_ERROR(GCM_LOG_TAG, "Illegal attempt to decrypt an AES GCM payload without a valid tag set: tag length=" << m_tag.GetLength());
m_failure = true;
return;
}
- if (!EVP_CIPHER_CTX_ctrl(m_decryptor_ctx, EVP_CTRL_GCM_SET_TAG, static_cast<int>(m_tag.GetLength()), m_tag.GetUnderlyingData()))
+ if (!EVP_CIPHER_CTX_ctrl(m_decryptor_ctx, EVP_CTRL_GCM_SET_TAG, static_cast<int>(m_tag.GetLength()), m_tag.GetUnderlyingData()))
{
m_failure = true;
LogErrors(GCM_LOG_TAG);
@@ -768,12 +768,12 @@ namespace Aws
return TagLengthBytes;
}
- void AES_GCM_Cipher_OpenSSL::Reset()
- {
- OpenSSLCipher::Reset();
- InitCipher();
- }
-
+ void AES_GCM_Cipher_OpenSSL::Reset()
+ {
+ OpenSSLCipher::Reset();
+ InitCipher();
+ }
+
size_t AES_KeyWrap_Cipher_OpenSSL::KeyLengthBits = 256;
size_t AES_KeyWrap_Cipher_OpenSSL::BlockSizeBytes = 8;
static const unsigned char INTEGRITY_VALUE = 0xA6;
@@ -788,10 +788,10 @@ namespace Aws
CryptoBuffer AES_KeyWrap_Cipher_OpenSSL::EncryptBuffer(const CryptoBuffer& plainText)
{
- if (!m_failure)
- {
- m_workingKeyBuffer = CryptoBuffer({&m_workingKeyBuffer, (CryptoBuffer*) &plainText});
- }
+ if (!m_failure)
+ {
+ m_workingKeyBuffer = CryptoBuffer({&m_workingKeyBuffer, (CryptoBuffer*) &plainText});
+ }
return CryptoBuffer();
}
@@ -811,7 +811,7 @@ namespace Aws
}
//the following is an in place implementation of
- //RFC 3394 using the alternate in-place implementation.
+ //RFC 3394 using the alternate in-place implementation.
//we use one in-place buffer instead of the copy at the end.
//the one letter variable names are meant to directly reflect the variables in the RFC
CryptoBuffer cipherText(m_workingKeyBuffer.GetLength() + BlockSizeBytes);
@@ -869,10 +869,10 @@ namespace Aws
CryptoBuffer AES_KeyWrap_Cipher_OpenSSL::DecryptBuffer(const CryptoBuffer& cipherText)
{
- if (!m_failure)
- {
- m_workingKeyBuffer = CryptoBuffer({&m_workingKeyBuffer, (CryptoBuffer*)&cipherText});
- }
+ if (!m_failure)
+ {
+ m_workingKeyBuffer = CryptoBuffer({&m_workingKeyBuffer, (CryptoBuffer*)&cipherText});
+ }
return CryptoBuffer();
}
@@ -961,11 +961,11 @@ namespace Aws
void AES_KeyWrap_Cipher_OpenSSL::InitCipher()
{
- if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, 0))
- {
- return;
- }
-
+ if (m_failure || !CheckKeyAndIVLength(KeyLengthBits/8, 0))
+ {
+ return;
+ }
+
if (!(EVP_EncryptInit_ex(m_encryptor_ctx, EVP_aes_256_ecb(), nullptr, m_key.GetUnderlyingData(), nullptr) &&
EVP_CIPHER_CTX_set_padding(m_encryptor_ctx, 0)) ||
!(EVP_DecryptInit_ex(m_decryptor_ctx, EVP_aes_256_ecb(), nullptr, m_key.GetUnderlyingData(), nullptr) &&
@@ -975,13 +975,13 @@ namespace Aws
LogErrors(KEY_WRAP_TAG);
}
}
-
- void AES_KeyWrap_Cipher_OpenSSL::Reset()
- {
- m_workingKeyBuffer = CryptoBuffer();
- OpenSSLCipher::Reset();
- InitCipher();
- }
+
+ void AES_KeyWrap_Cipher_OpenSSL::Reset()
+ {
+ m_workingKeyBuffer = CryptoBuffer();
+ OpenSSLCipher::Reset();
+ InitCipher();
+ }
}
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventDecoderStream.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventDecoderStream.cpp
index 16fc5e69d6..5ecd2d0444 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventDecoderStream.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventDecoderStream.cpp
@@ -1,22 +1,22 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-#include <aws/core/utils/event/EventDecoderStream.h>
-#include <iostream>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Event
- {
- EventDecoderStream::EventDecoderStream(EventStreamDecoder& decoder, size_t bufferSize) :
- Aws::IOStream(&m_eventStreamBuf),
- m_eventStreamBuf(decoder, bufferSize)
-
- {
- }
- }
- }
-}
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+#include <aws/core/utils/event/EventDecoderStream.h>
+#include <iostream>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Event
+ {
+ EventDecoderStream::EventDecoderStream(EventStreamDecoder& decoder, size_t bufferSize) :
+ Aws::IOStream(&m_eventStreamBuf),
+ m_eventStreamBuf(decoder, bufferSize)
+
+ {
+ }
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventEncoderStream.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventEncoderStream.cpp
index 08b791ed56..f8640f0e8c 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventEncoderStream.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventEncoderStream.cpp
@@ -1,28 +1,28 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
-#include <aws/core/utils/event/EventEncoderStream.h>
-#include <iostream>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Event
- {
- EventEncoderStream::EventEncoderStream(size_t bufferSize) :
- Aws::IOStream(&m_streambuf),
- m_streambuf(bufferSize)
- {
- }
-
- EventEncoderStream& EventEncoderStream::WriteEvent(const Aws::Utils::Event::Message& msg)
- {
- auto bits = m_encoder.EncodeAndSign(msg);
- write(reinterpret_cast<char*>(bits.data()), bits.size());
- return *this;
- }
- }
- }
-}
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+#include <aws/core/utils/event/EventEncoderStream.h>
+#include <iostream>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Event
+ {
+ EventEncoderStream::EventEncoderStream(size_t bufferSize) :
+ Aws::IOStream(&m_streambuf),
+ m_streambuf(bufferSize)
+ {
+ }
+
+ EventEncoderStream& EventEncoderStream::WriteEvent(const Aws::Utils::Event::Message& msg)
+ {
+ auto bits = m_encoder.EncodeAndSign(msg);
+ write(reinterpret_cast<char*>(bits.data()), bits.size());
+ return *this;
+ }
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventHeader.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventHeader.cpp
index b79dd2b4a5..c3c989bedb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventHeader.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventHeader.cpp
@@ -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.
*/
#include <aws/core/utils/event/EventHeader.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventMessage.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventMessage.cpp
index ed21d7d7d6..de8b904775 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventMessage.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventMessage.cpp
@@ -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.
*/
#include <aws/core/utils/event/EventMessage.h>
@@ -19,16 +19,16 @@ namespace Aws
const char MESSAGE_TYPE_HEADER[] = ":message-type";
const char ERROR_CODE_HEADER[] = ":error-code";
const char ERROR_MESSAGE_HEADER[] = ":error-message";
- const char EXCEPTION_TYPE_HEADER[] = ":exception-type";
+ const char EXCEPTION_TYPE_HEADER[] = ":exception-type";
static const int EVENT_HASH = HashingUtils::HashString("event");
static const int ERROR_HASH = HashingUtils::HashString("error");
- static const int EXCEPTION_HASH = HashingUtils::HashString("exception");
+ static const int EXCEPTION_HASH = HashingUtils::HashString("exception");
+
+ static const int CONTENT_TYPE_APPLICATION_OCTET_STREAM_HASH = HashingUtils::HashString("application/octet-stream");
+ static const int CONTENT_TYPE_APPLICATION_JSON_HASH = HashingUtils::HashString("application/json");
+ static const int CONTENT_TYPE_TEXT_PLAIN_HASH = HashingUtils::HashString("text/plain");
- static const int CONTENT_TYPE_APPLICATION_OCTET_STREAM_HASH = HashingUtils::HashString("application/octet-stream");
- static const int CONTENT_TYPE_APPLICATION_JSON_HASH = HashingUtils::HashString("application/json");
- static const int CONTENT_TYPE_TEXT_PLAIN_HASH = HashingUtils::HashString("text/plain");
-
Message::MessageType Message::GetMessageTypeForName(const Aws::String& name)
{
int hashCode = Aws::Utils::HashingUtils::HashString(name.c_str());
@@ -40,10 +40,10 @@ namespace Aws
{
return MessageType::REQUEST_LEVEL_ERROR;
}
- else if (hashCode == EXCEPTION_HASH)
- {
- return MessageType::REQUEST_LEVEL_EXCEPTION;
- }
+ else if (hashCode == EXCEPTION_HASH)
+ {
+ return MessageType::REQUEST_LEVEL_EXCEPTION;
+ }
else
{
return MessageType::UNKNOWN;
@@ -58,49 +58,49 @@ namespace Aws
return "event";
case MessageType::REQUEST_LEVEL_ERROR:
return "error";
- case MessageType::REQUEST_LEVEL_EXCEPTION:
- return "exception";
+ case MessageType::REQUEST_LEVEL_EXCEPTION:
+ return "exception";
+ default:
+ return "unknown";
+ }
+ }
+
+ Message::ContentType Message::GetContentTypeForName(const Aws::String& name)
+ {
+ int hashCode = Aws::Utils::HashingUtils::HashString(name.c_str());
+ if (hashCode == CONTENT_TYPE_APPLICATION_OCTET_STREAM_HASH)
+ {
+ return ContentType::APPLICATION_OCTET_STREAM;
+ }
+ else if (hashCode == CONTENT_TYPE_APPLICATION_JSON_HASH)
+ {
+ return ContentType::APPLICATION_JSON;
+ }
+ else if (hashCode == CONTENT_TYPE_TEXT_PLAIN_HASH)
+ {
+ return ContentType::TEXT_PLAIN;
+ }
+ else
+ {
+ return ContentType::UNKNOWN;
+ }
+ }
+
+ Aws::String Message::GetNameForContentType(ContentType value)
+ {
+ switch (value)
+ {
+ case ContentType::APPLICATION_OCTET_STREAM:
+ return "application/octet-stream";
+ case ContentType::APPLICATION_JSON:
+ return "application/json";
+ case ContentType::TEXT_PLAIN:
+ return "text/plain";
default:
return "unknown";
}
}
- Message::ContentType Message::GetContentTypeForName(const Aws::String& name)
- {
- int hashCode = Aws::Utils::HashingUtils::HashString(name.c_str());
- if (hashCode == CONTENT_TYPE_APPLICATION_OCTET_STREAM_HASH)
- {
- return ContentType::APPLICATION_OCTET_STREAM;
- }
- else if (hashCode == CONTENT_TYPE_APPLICATION_JSON_HASH)
- {
- return ContentType::APPLICATION_JSON;
- }
- else if (hashCode == CONTENT_TYPE_TEXT_PLAIN_HASH)
- {
- return ContentType::TEXT_PLAIN;
- }
- else
- {
- return ContentType::UNKNOWN;
- }
- }
-
- Aws::String Message::GetNameForContentType(ContentType value)
- {
- switch (value)
- {
- case ContentType::APPLICATION_OCTET_STREAM:
- return "application/octet-stream";
- case ContentType::APPLICATION_JSON:
- return "application/json";
- case ContentType::TEXT_PLAIN:
- return "text/plain";
- default:
- return "unknown";
- }
- }
-
void Message::Reset()
{
m_totalLength = 0;
@@ -111,21 +111,21 @@ namespace Aws
m_eventPayload.clear();
}
- void Message::WriteEventPayload(const unsigned char* data, size_t length)
- {
- std::copy(data, data + length, std::back_inserter(m_eventPayload));
- }
-
+ void Message::WriteEventPayload(const unsigned char* data, size_t length)
+ {
+ std::copy(data, data + length, std::back_inserter(m_eventPayload));
+ }
+
void Message::WriteEventPayload(const Aws::Vector<unsigned char>& bits)
{
std::copy(bits.cbegin(), bits.cend(), std::back_inserter(m_eventPayload));
}
- void Message::WriteEventPayload(const Aws::String& bits)
- {
- std::copy(bits.cbegin(), bits.cend(), std::back_inserter(m_eventPayload));
- }
-
+ void Message::WriteEventPayload(const Aws::String& bits)
+ {
+ std::copy(bits.cbegin(), bits.cend(), std::back_inserter(m_eventPayload));
+ }
+
} // namespace Event
} // namespace Utils
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamBuf.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamBuf.cpp
index 4c52368e07..6a1766bb9f 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamBuf.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamBuf.cpp
@@ -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.
*/
#include <aws/core/utils/event/EventStreamBuf.h>
#include <cassert>
@@ -11,8 +11,8 @@ namespace Aws
{
namespace Event
{
- const size_t DEFAULT_BUF_SIZE = 1024;
-
+ const size_t DEFAULT_BUF_SIZE = 1024;
+
EventStreamBuf::EventStreamBuf(EventStreamDecoder& decoder, size_t bufferLength) :
m_byteBuffer(bufferLength),
m_bufferLength(bufferLength),
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamDecoder.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamDecoder.cpp
index d0474f77eb..f70a6c88f6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamDecoder.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamDecoder.cpp
@@ -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.
*/
#include <aws/common/common.h>
@@ -9,7 +9,7 @@
#include <aws/core/utils/event/EventStreamDecoder.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/AWSMemory.h>
namespace Aws
{
@@ -21,8 +21,8 @@ namespace Aws
EventStreamDecoder::EventStreamDecoder(EventStreamHandler* handler) : m_eventStreamHandler(handler)
{
- aws_event_stream_streaming_decoder_init(&m_decoder,
- get_aws_allocator(),
+ aws_event_stream_streaming_decoder_init(&m_decoder,
+ get_aws_allocator(),
onPayloadSegment,
onPreludeReceived,
onHeaderReceived,
@@ -53,7 +53,7 @@ namespace Aws
void EventStreamDecoder::ResetEventStreamHandler(EventStreamHandler* handler)
{
- aws_event_stream_streaming_decoder_init(&m_decoder, get_aws_allocator(),
+ aws_event_stream_streaming_decoder_init(&m_decoder, get_aws_allocator(),
onPayloadSegment,
onPreludeReceived,
onHeaderReceived,
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamEncoder.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamEncoder.cpp
index 5380a793e1..ef7104e839 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamEncoder.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamEncoder.cpp
@@ -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.
*/
#include <aws/core/utils/event/EventHeader.h>
@@ -9,7 +9,7 @@
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/common/byte_order.h>
-#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/AWSMemory.h>
#include <cassert>
@@ -23,7 +23,7 @@ namespace Aws
static void EncodeHeaders(const Aws::Utils::Event::Message& msg, aws_array_list* headers)
{
- aws_array_list_init_dynamic(headers, get_aws_allocator(), msg.GetEventHeaders().size(), sizeof(aws_event_stream_header_value_pair));
+ aws_array_list_init_dynamic(headers, get_aws_allocator(), msg.GetEventHeaders().size(), sizeof(aws_event_stream_header_value_pair));
for (auto&& header : msg.GetEventHeaders())
{
const uint8_t headerKeyLen = static_cast<uint8_t>(header.first.length());
@@ -37,18 +37,18 @@ namespace Aws
aws_event_stream_add_bool_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsByte());
break;
case EventHeaderValue::EventHeaderType::INT16:
- aws_event_stream_add_int16_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt16());
+ aws_event_stream_add_int16_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt16());
break;
case EventHeaderValue::EventHeaderType::INT32:
- aws_event_stream_add_int32_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt32());
+ aws_event_stream_add_int32_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt32());
break;
case EventHeaderValue::EventHeaderType::INT64:
- aws_event_stream_add_int64_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt64());
+ aws_event_stream_add_int64_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsInt64());
break;
case EventHeaderValue::EventHeaderType::BYTE_BUF:
{
const auto& bytes = header.second.GetEventHeaderValueAsBytebuf();
- aws_event_stream_add_bytebuf_header(headers, header.first.c_str(), headerKeyLen, bytes.GetUnderlyingData(), static_cast<uint16_t>(bytes.GetLength()), 1 /*copy*/);
+ aws_event_stream_add_bytebuf_header(headers, header.first.c_str(), headerKeyLen, bytes.GetUnderlyingData(), static_cast<uint16_t>(bytes.GetLength()), 1 /*copy*/);
}
break;
case EventHeaderValue::EventHeaderType::STRING:
@@ -58,7 +58,7 @@ namespace Aws
}
break;
case EventHeaderValue::EventHeaderType::TIMESTAMP:
- aws_event_stream_add_timestamp_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsTimestamp());
+ aws_event_stream_add_timestamp_header(headers, header.first.c_str(), headerKeyLen, header.second.GetEventHeaderValueAsTimestamp());
break;
case EventHeaderValue::EventHeaderType::UUID:
{
@@ -104,16 +104,16 @@ namespace Aws
payload.allocator = nullptr;
aws_event_stream_message encoded;
- if(aws_event_stream_message_init(&encoded, get_aws_allocator(), &headers, &payload) == AWS_OP_ERR)
+ if(aws_event_stream_message_init(&encoded, get_aws_allocator(), &headers, &payload) == AWS_OP_ERR)
{
- AWS_LOGSTREAM_ERROR(TAG, "Error creating event-stream message from payload.");
- aws_event_stream_headers_list_cleanup(&headers);
+ AWS_LOGSTREAM_ERROR(TAG, "Error creating event-stream message from payload.");
+ aws_event_stream_headers_list_cleanup(&headers);
// GCC 4.9.4 issues a warning with -Wextra if we simply do
// return {};
aws_event_stream_message empty{nullptr, nullptr, 0};
return empty;
}
- aws_event_stream_headers_list_cleanup(&headers);
+ aws_event_stream_headers_list_cleanup(&headers);
return encoded;
}
@@ -143,16 +143,16 @@ namespace Aws
payload.allocator = nullptr;
aws_event_stream_message signedmsg;
- if(aws_event_stream_message_init(&signedmsg, get_aws_allocator(), &headers, &payload))
+ if(aws_event_stream_message_init(&signedmsg, get_aws_allocator(), &headers, &payload))
{
- AWS_LOGSTREAM_ERROR(TAG, "Error creating event-stream message from payload.");
- aws_event_stream_headers_list_cleanup(&headers);
+ AWS_LOGSTREAM_ERROR(TAG, "Error creating event-stream message from payload.");
+ aws_event_stream_headers_list_cleanup(&headers);
// GCC 4.9.4 issues a warning with -Wextra if we simply do
// return {};
aws_event_stream_message empty{nullptr, nullptr, 0};
return empty;
}
- aws_event_stream_headers_list_cleanup(&headers);
+ aws_event_stream_headers_list_cleanup(&headers);
return signedmsg;
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamErrors.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamErrors.cpp
index c8736b8ffa..836d0b47c5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamErrors.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/event/EventStreamErrors.cpp
@@ -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.
*/
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
index 3a4b34fa38..9b785d1995 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
@@ -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.
+ */
#include <aws/core/utils/json/JsonSerializer.h>
#include <iterator>
#include <algorithm>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
-#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/StringUtils.h>
using namespace Aws::Utils;
using namespace Aws::Utils::Json;
@@ -186,26 +186,26 @@ JsonValue& JsonValue::AsInteger(int value)
JsonValue& JsonValue::WithInt64(const char* key, long long value)
{
- if (!m_value)
- {
- m_value = cJSON_CreateObject();
- }
-
- const auto val = cJSON_CreateInt64(value);
- AddOrReplace(m_value, key, val);
- return *this;
+ if (!m_value)
+ {
+ m_value = cJSON_CreateObject();
+ }
+
+ const auto val = cJSON_CreateInt64(value);
+ AddOrReplace(m_value, key, val);
+ return *this;
}
JsonValue& JsonValue::WithInt64(const Aws::String& key, long long value)
{
- return WithInt64(key.c_str(), value);
+ return WithInt64(key.c_str(), value);
}
JsonValue& JsonValue::AsInt64(long long value)
{
- Destroy();
- m_value = cJSON_CreateInt64(value);
- return *this;
+ Destroy();
+ m_value = cJSON_CreateInt64(value);
+ return *this;
}
JsonValue& JsonValue::WithDouble(const char* key, double value)
@@ -449,30 +449,30 @@ int JsonView::AsInteger() const
int64_t JsonView::GetInt64(const Aws::String& key) const
{
- assert(m_value);
- auto item = cJSON_GetObjectItemCaseSensitive(m_value, key.c_str());
- assert(item);
- if (item->valuestring)
- {
- return Aws::Utils::StringUtils::ConvertToInt64(item->valuestring);
- }
- else
- {
- return static_cast<int64_t>(item->valuedouble);
- }
+ assert(m_value);
+ auto item = cJSON_GetObjectItemCaseSensitive(m_value, key.c_str());
+ assert(item);
+ if (item->valuestring)
+ {
+ return Aws::Utils::StringUtils::ConvertToInt64(item->valuestring);
+ }
+ else
+ {
+ return static_cast<int64_t>(item->valuedouble);
+ }
}
int64_t JsonView::AsInt64() const
{
assert(cJSON_IsNumber(m_value));
- if (m_value->valuestring)
- {
- return Aws::Utils::StringUtils::ConvertToInt64(m_value->valuestring);
- }
- else
- {
- return static_cast<int64_t>(m_value->valuedouble);
- }
+ if (m_value->valuestring)
+ {
+ return Aws::Utils::StringUtils::ConvertToInt64(m_value->valuestring);
+ }
+ else
+ {
+ return static_cast<int64_t>(m_value->valuedouble);
+ }
}
double JsonView::GetDouble(const Aws::String& key) const
@@ -498,7 +498,7 @@ JsonView JsonView::GetObject(const Aws::String& key) const
JsonView JsonView::AsObject() const
{
- assert(cJSON_IsObject(m_value) || cJSON_IsNull(m_value));
+ assert(cJSON_IsObject(m_value) || cJSON_IsNull(m_value));
return m_value;
}
@@ -592,11 +592,11 @@ bool JsonView::IsIntegerType() const
return false;
}
- if (m_value->valuestring)
- {
- Aws::String valueString = m_value->valuestring;
- return std::all_of(valueString.begin(), valueString.end(), [](unsigned char c){ return ::isdigit(c) || c == '+' || c == '-'; });
- }
+ if (m_value->valuestring)
+ {
+ Aws::String valueString = m_value->valuestring;
+ return std::all_of(valueString.begin(), valueString.end(), [](unsigned char c){ return ::isdigit(c) || c == '+' || c == '-'; });
+ }
return m_value->valuedouble == static_cast<long long>(m_value->valuedouble);
}
@@ -607,11 +607,11 @@ bool JsonView::IsFloatingPointType() const
return false;
}
- if (m_value->valuestring)
- {
- Aws::String valueString = m_value->valuestring;
- return std::any_of(valueString.begin(), valueString.end(), [](unsigned char c){ return !::isdigit(c) && c != '+' && c != '-'; });
- }
+ if (m_value->valuestring)
+ {
+ Aws::String valueString = m_value->valuestring;
+ return std::any_of(valueString.begin(), valueString.end(), [](unsigned char c){ return !::isdigit(c) && c != '+' && c != '-'; });
+ }
return m_value->valuedouble != static_cast<long long>(m_value->valuedouble);
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/AWSLogging.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/AWSLogging.cpp
index c872c1cf64..fc1b9fcc2e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/AWSLogging.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/AWSLogging.cpp
@@ -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/utils/logging/AWSLogging.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/ConsoleLogSystem.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/ConsoleLogSystem.cpp
index c166c6dfca..dec7cef82f 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/ConsoleLogSystem.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/ConsoleLogSystem.cpp
@@ -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/utils/logging/ConsoleLogSystem.h>
@@ -15,8 +15,8 @@ void ConsoleLogSystem::ProcessFormattedStatement(Aws::String&& statement)
{
std::cout << statement;
}
-
-void ConsoleLogSystem::Flush()
-{
- std::cout.flush();
-}
+
+void ConsoleLogSystem::Flush()
+{
+ std::cout.flush();
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/DefaultLogSystem.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/DefaultLogSystem.cpp
index 21cbf2e0dd..7286bb6378 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/DefaultLogSystem.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/DefaultLogSystem.cpp
@@ -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/utils/logging/DefaultLogSystem.h>
@@ -17,7 +17,7 @@ using namespace Aws::Utils::Logging;
static const char* AllocationTag = "DefaultLogSystem";
static const int BUFFERED_MSG_COUNT = 100;
-static std::shared_ptr<Aws::OFStream> MakeDefaultLogFile(const Aws::String& filenamePrefix)
+static std::shared_ptr<Aws::OFStream> MakeDefaultLogFile(const Aws::String& filenamePrefix)
{
Aws::String newFileName = filenamePrefix + DateTime::CalculateGmtTimestampAsString("%Y-%m-%d-%H") + ".log";
return Aws::MakeShared<Aws::OFStream>(AllocationTag, newFileName.c_str(), Aws::OFStream::out | Aws::OFStream::app);
@@ -32,7 +32,7 @@ static void LogThread(DefaultLogSystem::LogSynchronizationData* syncData, const
for(;;)
{
std::unique_lock<std::mutex> locker(syncData->m_logQueueMutex);
- syncData->m_queueSignal.wait(locker, [&](){ return syncData->m_stopLogging == true || syncData->m_queuedLogMessages.size() > 0; } );
+ syncData->m_queueSignal.wait(locker, [&](){ return syncData->m_stopLogging == true || syncData->m_queuedLogMessages.size() > 0; } );
if (syncData->m_stopLogging && syncData->m_queuedLogMessages.size() == 0)
{
@@ -87,7 +87,7 @@ DefaultLogSystem::~DefaultLogSystem()
{
{
std::lock_guard<std::mutex> locker(m_syncData.m_logQueueMutex);
- m_syncData.m_stopLogging = true;
+ m_syncData.m_stopLogging = true;
}
m_syncData.m_queueSignal.notify_one();
@@ -110,8 +110,8 @@ void DefaultLogSystem::ProcessFormattedStatement(Aws::String&& statement)
}
}
-void DefaultLogSystem::Flush()
-{
- m_syncData.m_queueSignal.notify_one();
-}
-
+void DefaultLogSystem::Flush()
+{
+ m_syncData.m_queueSignal.notify_one();
+}
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/FormattedLogSystem.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/FormattedLogSystem.cpp
index ba5d759e02..41c4d7e09c 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/FormattedLogSystem.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/FormattedLogSystem.cpp
@@ -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/utils/logging/FormattedLogSystem.h>
@@ -52,7 +52,7 @@ static Aws::String CreateLogPrefixLine(LogLevel logLevel, const char* tag)
break;
}
- ss << DateTime::Now().CalculateGmtTimeWithMsPrecision() << " " << tag << " [" << std::this_thread::get_id() << "] ";
+ ss << DateTime::Now().CalculateGmtTimeWithMsPrecision() << " " << tag << " [" << std::this_thread::get_id() << "] ";
return ss.str();
}
@@ -95,5 +95,5 @@ void FormattedLogSystem::Log(LogLevel logLevel, const char* tag, const char* for
void FormattedLogSystem::LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &message_stream)
{
- ProcessFormattedStatement(CreateLogPrefixLine(logLevel, tag) + message_stream.str() + "\n");
+ ProcessFormattedStatement(CreateLogPrefixLine(logLevel, tag) + message_stream.str() + "\n");
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/LogLevel.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/LogLevel.cpp
index 1a83275cd2..9ff1bf3126 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/LogLevel.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/logging/LogLevel.cpp
@@ -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/utils/logging/LogLevel.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/AWSMemory.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/AWSMemory.cpp
index 0b6d273f21..96d339d385 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/AWSMemory.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/AWSMemory.cpp
@@ -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.
+ */
#include <aws/core/utils/memory/AWSMemory.h>
#include <aws/core/utils/memory/MemorySystemInterface.h>
-#include <aws/common/common.h>
+#include <aws/common/common.h>
#include <atomic>
@@ -98,37 +98,37 @@ void Free(void* memoryPtr)
}
}
-static void* MemAcquire(aws_allocator* allocator, size_t size)
-{
- (void)allocator; // unused;
- return Aws::Malloc("MemAcquire", size);
-}
-
-static void MemRelease(aws_allocator* allocator, void* ptr)
-{
- (void)allocator; // unused;
- return Aws::Free(ptr);
-}
-
-static aws_allocator create_aws_allocator()
-{
-#if (__GNUC__ == 4) && !defined(__clang__)
- AWS_SUPPRESS_WARNING("-Wmissing-field-initializers", aws_allocator wrapper{};);
-#else
- aws_allocator wrapper{};
-#endif
- wrapper.mem_acquire = MemAcquire;
- wrapper.mem_release = MemRelease;
- wrapper.mem_realloc = nullptr;
- return wrapper;
-}
-
-aws_allocator* get_aws_allocator()
-{
- static aws_allocator wrapper = create_aws_allocator();
- return &wrapper;
-}
-
+static void* MemAcquire(aws_allocator* allocator, size_t size)
+{
+ (void)allocator; // unused;
+ return Aws::Malloc("MemAcquire", size);
+}
+
+static void MemRelease(aws_allocator* allocator, void* ptr)
+{
+ (void)allocator; // unused;
+ return Aws::Free(ptr);
+}
+
+static aws_allocator create_aws_allocator()
+{
+#if (__GNUC__ == 4) && !defined(__clang__)
+ AWS_SUPPRESS_WARNING("-Wmissing-field-initializers", aws_allocator wrapper{};);
+#else
+ aws_allocator wrapper{};
+#endif
+ wrapper.mem_acquire = MemAcquire;
+ wrapper.mem_release = MemRelease;
+ wrapper.mem_realloc = nullptr;
+ return wrapper;
+}
+
+aws_allocator* get_aws_allocator()
+{
+ static aws_allocator wrapper = create_aws_allocator();
+ return &wrapper;
+}
+
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp
index 945c345c63..4662749872 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp
@@ -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/utils/memory/stl/SimpleStringStream.h>
@@ -20,7 +20,7 @@ SimpleStringStream::SimpleStringStream(const Aws::String& value) :
{
}
-void SimpleStringStream::str(const Aws::String& value)
+void SimpleStringStream::str(const Aws::String& value)
{
m_streamBuffer.str(value);
}
@@ -39,7 +39,7 @@ SimpleIStringStream::SimpleIStringStream(const Aws::String& value) :
{
}
-void SimpleIStringStream::str(const Aws::String& value)
+void SimpleIStringStream::str(const Aws::String& value)
{
m_streamBuffer.str(value);
}
@@ -58,9 +58,9 @@ SimpleOStringStream::SimpleOStringStream(const Aws::String& value) :
{
}
-void SimpleOStringStream::str(const Aws::String& value)
+void SimpleOStringStream::str(const Aws::String& value)
{
m_streamBuffer.str(value);
}
-} // namespace Aws
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ConcurrentStreamBuf.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ConcurrentStreamBuf.cpp
index bbfc27da99..3f59dbe96d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ConcurrentStreamBuf.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ConcurrentStreamBuf.cpp
@@ -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.
*/
#include <aws/core/utils/stream/ConcurrentStreamBuf.h>
#include <aws/core/utils/logging/LogMacros.h>
@@ -42,11 +42,11 @@ namespace Aws
// scope the lock
{
std::unique_lock<std::mutex> lock(m_lock);
- m_signal.wait(lock, [this, bitslen]{ return m_eof || bitslen <= (m_backbuf.capacity() - m_backbuf.size()); });
- if (m_eof)
- {
- return;
- }
+ m_signal.wait(lock, [this, bitslen]{ return m_eof || bitslen <= (m_backbuf.capacity() - m_backbuf.size()); });
+ if (m_eof)
+ {
+ return;
+ }
std::copy(pbase(), pptr(), std::back_inserter(m_backbuf));
}
m_signal.notify_one();
@@ -104,16 +104,16 @@ namespace Aws
}
FlushPutArea();
- {
- std::unique_lock<std::mutex> lock(m_lock);
- if (m_eof)
- {
- return eof;
- }
- *pptr() = static_cast<char>(ch);
- pbump(1);
- return ch;
- }
+ {
+ std::unique_lock<std::mutex> lock(m_lock);
+ if (m_eof)
+ {
+ return eof;
+ }
+ *pptr() = static_cast<char>(ch);
+ pbump(1);
+ return ch;
+ }
}
int ConcurrentStreamBuf::sync()
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/PreallocatedStreamBuf.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/PreallocatedStreamBuf.cpp
index 94f23c3f2f..f656fc8613 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/PreallocatedStreamBuf.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/PreallocatedStreamBuf.cpp
@@ -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.
+ */
#include <aws/core/utils/stream/PreallocatedStreamBuf.h>
#include <cassert>
@@ -13,7 +13,7 @@ namespace Aws
{
namespace Stream
{
- PreallocatedStreamBuf::PreallocatedStreamBuf(unsigned char* buffer, uint64_t lengthToRead) :
+ PreallocatedStreamBuf::PreallocatedStreamBuf(unsigned char* buffer, uint64_t lengthToRead) :
m_underlyingBuffer(buffer), m_lengthToRead(lengthToRead)
{
char* end = reinterpret_cast<char*>(m_underlyingBuffer + m_lengthToRead);
@@ -36,11 +36,11 @@ namespace Aws
{
if(which == std::ios_base::in)
{
- return seekpos((gptr() - reinterpret_cast<char*>(m_underlyingBuffer)) + off, which);
+ return seekpos((gptr() - reinterpret_cast<char*>(m_underlyingBuffer)) + off, which);
}
else
{
- return seekpos((pptr() - reinterpret_cast<char*>(m_underlyingBuffer)) + off, which);
+ return seekpos((pptr() - reinterpret_cast<char*>(m_underlyingBuffer)) + off, which);
}
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ResponseStream.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ResponseStream.cpp
index b31b20fcb2..6d1f90ed12 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ResponseStream.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/ResponseStream.cpp
@@ -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/utils/stream/ResponseStream.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp
index b70968cbb4..6e42994744 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp
@@ -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.
+ */
#include <aws/core/utils/stream/SimpleStreamBuf.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Executor.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Executor.cpp
index 6b9a979a05..4a3c4209c4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Executor.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Executor.cpp
@@ -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/utils/threading/Executor.h>
#include <aws/core/utils/threading/ThreadTask.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ReaderWriterLock.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ReaderWriterLock.cpp
index a7846cddaf..ddb5860563 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ReaderWriterLock.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ReaderWriterLock.cpp
@@ -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.
*/
#include <aws/core/utils/threading/ReaderWriterLock.h>
@@ -10,7 +10,7 @@
using namespace Aws::Utils::Threading;
-static const int64_t MaxReaders = (std::numeric_limits<std::int32_t>::max)();
+static const int64_t MaxReaders = (std::numeric_limits<std::int32_t>::max)();
ReaderWriterLock::ReaderWriterLock() :
m_readers(0),
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Semaphore.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Semaphore.cpp
index 74a0bc2c08..86dabc9acf 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Semaphore.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/Semaphore.cpp
@@ -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.
*/
#include <aws/core/utils/threading/Semaphore.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ThreadTask.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ThreadTask.cpp
index 7120275542..a899fe045d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ThreadTask.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/threading/ThreadTask.cpp
@@ -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/utils/threading/ThreadTask.h>
#include <aws/core/utils/threading/Executor.h>
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
index 9c8c54c277..c06befaf9b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
@@ -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/utils/xml/XmlSerializer.h>
@@ -56,8 +56,8 @@ void XmlNode::SetName(const Aws::String& name)
const Aws::String XmlNode::GetAttributeValue(const Aws::String& name) const
{
- auto pointer = m_node->ToElement()->Attribute(name.c_str(), nullptr);
- return pointer ? pointer : "";
+ auto pointer = m_node->ToElement()->Attribute(name.c_str(), nullptr);
+ return pointer ? pointer : "";
}
void XmlNode::SetAttributeValue(const Aws::String& name, const Aws::String& value)
@@ -158,106 +158,106 @@ static const char* XML_SERIALIZER_ALLOCATION_TAG = "XmlDocument";
XmlDocument::XmlDocument()
{
- m_doc = nullptr;
+ m_doc = nullptr;
}
-XmlDocument::XmlDocument(const XmlDocument& doc)
-{
- if (doc.m_doc == nullptr)
- {
- m_doc = nullptr;
- }
- else
- {
- InitDoc();
- doc.m_doc->DeepCopy(m_doc);
- }
-}
-
-XmlDocument::XmlDocument(XmlDocument&& doc) : m_doc{ doc.m_doc } // take the innards
+XmlDocument::XmlDocument(const XmlDocument& doc)
+{
+ if (doc.m_doc == nullptr)
+ {
+ m_doc = nullptr;
+ }
+ else
+ {
+ InitDoc();
+ doc.m_doc->DeepCopy(m_doc);
+ }
+}
+
+XmlDocument::XmlDocument(XmlDocument&& doc) : m_doc{ doc.m_doc } // take the innards
{
doc.m_doc = nullptr; // leave nothing behind
}
-XmlDocument& XmlDocument::operator=(const XmlDocument& other)
-{
- if (this == &other)
- {
- return *this;
- }
-
- if (other.m_doc == nullptr)
- {
- if (m_doc != nullptr)
- {
- m_doc->Clear();
- m_doc = nullptr;
- }
- }
- else
- {
- if (m_doc == nullptr)
- {
- InitDoc();
- }
- else
- {
- m_doc->Clear();
- }
- other.m_doc->DeepCopy(m_doc);
- }
-
- return *this;
-}
-
-XmlDocument& XmlDocument::operator=(XmlDocument&& other)
-{
- if (this == &other)
- {
- return *this;
- }
-
- std::swap(m_doc, other.m_doc);
- return *this;
-}
-
+XmlDocument& XmlDocument::operator=(const XmlDocument& other)
+{
+ if (this == &other)
+ {
+ return *this;
+ }
+
+ if (other.m_doc == nullptr)
+ {
+ if (m_doc != nullptr)
+ {
+ m_doc->Clear();
+ m_doc = nullptr;
+ }
+ }
+ else
+ {
+ if (m_doc == nullptr)
+ {
+ InitDoc();
+ }
+ else
+ {
+ m_doc->Clear();
+ }
+ other.m_doc->DeepCopy(m_doc);
+ }
+
+ return *this;
+}
+
+XmlDocument& XmlDocument::operator=(XmlDocument&& other)
+{
+ if (this == &other)
+ {
+ return *this;
+ }
+
+ std::swap(m_doc, other.m_doc);
+ return *this;
+}
+
XmlDocument::~XmlDocument()
{
- if (m_doc)
- {
- Aws::Delete(m_doc);
- }
+ if (m_doc)
+ {
+ Aws::Delete(m_doc);
+ }
+}
+
+void XmlDocument::InitDoc()
+{
+ m_doc = Aws::New<Aws::External::tinyxml2::XMLDocument>(XML_SERIALIZER_ALLOCATION_TAG, true, Aws::External::tinyxml2::Whitespace::PRESERVE_WHITESPACE);
}
-void XmlDocument::InitDoc()
-{
- m_doc = Aws::New<Aws::External::tinyxml2::XMLDocument>(XML_SERIALIZER_ALLOCATION_TAG, true, Aws::External::tinyxml2::Whitespace::PRESERVE_WHITESPACE);
-}
-
XmlNode XmlDocument::GetRootElement() const
{
- if (m_doc)
- {
- return XmlNode(m_doc->FirstChildElement(), *this);
- }
- else
- {
- return XmlNode(nullptr, *this);
- }
-
+ if (m_doc)
+ {
+ return XmlNode(m_doc->FirstChildElement(), *this);
+ }
+ else
+ {
+ return XmlNode(nullptr, *this);
+ }
+
}
bool XmlDocument::WasParseSuccessful() const
{
- if (m_doc)
- {
- return !m_doc->Error();
- }
- else
- {
- return true;
- }
-
+ if (m_doc)
+ {
+ return !m_doc->Error();
+ }
+ else
+ {
+ return true;
+ }
+
}
Aws::String XmlDocument::GetErrorMessage() const
@@ -267,8 +267,8 @@ Aws::String XmlDocument::GetErrorMessage() const
Aws::String XmlDocument::ConvertToString() const
{
- if (!m_doc) return "";
-
+ if (!m_doc) return "";
+
Aws::External::tinyxml2::XMLPrinter printer;
printer.PushHeader(false, true);
m_doc->Accept(&printer);
@@ -285,7 +285,7 @@ XmlDocument XmlDocument::CreateFromXmlStream(Aws::IOStream& xmlStream)
XmlDocument XmlDocument::CreateFromXmlString(const Aws::String& xmlText)
{
XmlDocument xmlDocument;
- xmlDocument.InitDoc();
+ xmlDocument.InitDoc();
xmlDocument.m_doc->Parse(xmlText.c_str(), xmlText.size());
return xmlDocument;
}
@@ -293,7 +293,7 @@ XmlDocument XmlDocument::CreateFromXmlString(const Aws::String& xmlText)
XmlDocument XmlDocument::CreateWithRootNode(const Aws::String& rootNodeName)
{
XmlDocument xmlDocument;
- xmlDocument.InitDoc();
+ xmlDocument.InitDoc();
Aws::External::tinyxml2::XMLElement* rootNode = xmlDocument.m_doc->NewElement(rootNodeName.c_str());
xmlDocument.m_doc->LinkEndChild(rootNode);
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/ya.make b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/ya.make
index 3f5deaf8b4..d6b0823d45 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/ya.make
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/ya.make
@@ -7,7 +7,7 @@ OWNER(
shindo
g:cpp-contrib
)
-
+
LICENSE(
Apache-2.0 AND
MIT AND
@@ -19,8 +19,8 @@ LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
PEERDIR(
contrib/libs/curl
contrib/libs/openssl
- contrib/restricted/aws/aws-c-common
- contrib/restricted/aws/aws-c-event-stream
+ contrib/restricted/aws/aws-c-common
+ contrib/restricted/aws/aws-c-event-stream
)
ADDINCL(
@@ -32,26 +32,26 @@ NO_COMPILER_WARNINGS()
NO_UTIL()
CFLAGS(
- -DAWS_CAL_USE_IMPORT_EXPORT
- -DAWS_CHECKSUMS_USE_IMPORT_EXPORT
- -DAWS_COMMON_USE_IMPORT_EXPORT
+ -DAWS_CAL_USE_IMPORT_EXPORT
+ -DAWS_CHECKSUMS_USE_IMPORT_EXPORT
+ -DAWS_COMMON_USE_IMPORT_EXPORT
-DAWS_EVENT_STREAM_USE_IMPORT_EXPORT
- -DAWS_IO_USE_IMPORT_EXPORT
+ -DAWS_IO_USE_IMPORT_EXPORT
-DAWS_SDK_VERSION_MAJOR=1
- -DAWS_SDK_VERSION_MINOR=8
- -DAWS_SDK_VERSION_PATCH=113
- -DAWS_USE_EPOLL
+ -DAWS_SDK_VERSION_MINOR=8
+ -DAWS_SDK_VERSION_PATCH=113
+ -DAWS_USE_EPOLL
-DCURL_HAS_H2
- -DCURL_HAS_TLS_PROXY
+ -DCURL_HAS_TLS_PROXY
-DENABLE_CURL_CLIENT
- -DENABLE_CURL_LOGGING
+ -DENABLE_CURL_LOGGING
-DENABLE_OPENSSL_ENCRYPTION
-DHAS_PATHCONF
-DHAS_UMASK
- -DS2N_ADX
- -DS2N_CPUID_AVAILABLE
- -DS2N_HAVE_EXECINFO
- -DS2N_SIKEP434R2_ASM
+ -DS2N_ADX
+ -DS2N_CPUID_AVAILABLE
+ -DS2N_HAVE_EXECINFO
+ -DS2N_SIKEP434R2_ASM
)
SRCS(
@@ -60,21 +60,21 @@ SRCS(
source/AmazonWebServiceRequest.cpp
source/Aws.cpp
source/Globals.cpp
- source/Region.cpp
+ source/Region.cpp
source/Version.cpp
source/auth/AWSAuthSigner.cpp
source/auth/AWSAuthSignerProvider.cpp
source/auth/AWSCredentialsProvider.cpp
source/auth/AWSCredentialsProviderChain.cpp
- source/auth/STSCredentialsProvider.cpp
+ source/auth/STSCredentialsProvider.cpp
source/client/AWSClient.cpp
source/client/AWSErrorMarshaller.cpp
source/client/AsyncCallerContext.cpp
source/client/ClientConfiguration.cpp
source/client/CoreErrors.cpp
source/client/DefaultRetryStrategy.cpp
- source/client/RetryStrategy.cpp
- source/client/SpecifiedRetryableErrorsRetryStrategy.cpp
+ source/client/RetryStrategy.cpp
+ source/client/SpecifiedRetryableErrorsRetryStrategy.cpp
source/config/AWSProfileConfigLoader.cpp
source/external/cjson/cJSON.cpp
source/external/tinyxml2/tinyxml2.cpp
@@ -99,7 +99,7 @@ SRCS(
source/platform/linux-shared/OSVersionInfo.cpp
source/platform/linux-shared/Security.cpp
source/platform/linux-shared/Time.cpp
- source/utils/ARN.cpp
+ source/utils/ARN.cpp
source/utils/Array.cpp
source/utils/DNS.cpp
source/utils/DateTimeCommon.cpp
@@ -124,8 +124,8 @@ SRCS(
source/utils/crypto/Sha256HMAC.cpp
source/utils/crypto/factory/Factories.cpp
source/utils/crypto/openssl/CryptoImpl.cpp
- source/utils/event/EventDecoderStream.cpp
- source/utils/event/EventEncoderStream.cpp
+ source/utils/event/EventDecoderStream.cpp
+ source/utils/event/EventEncoderStream.cpp
source/utils/event/EventHeader.cpp
source/utils/event/EventMessage.cpp
source/utils/event/EventStreamBuf.cpp