AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
S3ExpressSigner.h
1
6#pragma once
7
8#include <aws/s3/S3_EXPORTS.h>
9#include <aws/s3/S3Request.h>
10#include <aws/s3/S3Errors.h>
11#include <aws/s3/S3ExpressIdentityProvider.h>
12#include <aws/core/client/AWSClient.h>
13#include <aws/core/utils/ConcurrentCache.h>
14#include <aws/core/http/HttpRequest.h>
15
16namespace Aws {
17 namespace S3 {
19 public:
20 S3ExpressSigner(std::shared_ptr<S3ExpressIdentityProvider> S3ExpressIdentityProvider,
21 const std::shared_ptr<Auth::AWSCredentialsProvider> &credentialsProvider,
22 const Aws::String &serviceName,
23 const Aws::String &region,
24 PayloadSigningPolicy signingPolicy = PayloadSigningPolicy::RequestDependent,
25 bool urlEscapePath = true,
26 Aws::Auth::AWSSigningAlgorithm signingAlgorithm = Aws::Auth::AWSSigningAlgorithm::SIGV4);
27
28 virtual ~S3ExpressSigner() {};
29
30 const char *GetName() const override;
31
33 const char *region,
34 const char *serviceName,
35 bool signBody
36 ) const override;
37
39 const char* region,
40 const char* serviceName,
41 long long expirationInSeconds
42 ) const override;
43
44 Aws::Auth::AWSCredentials GetCredentials(const std::shared_ptr<Aws::Http::ServiceSpecificParameters> &serviceSpecificParameters) const override;
45
46 protected:
47 bool ServiceRequireUnsignedPayload(const String &serviceName) const override;
48
49 private:
50 inline bool hasRequestId(const Aws::String &requestId) const {
51 std::lock_guard<std::mutex> lock(m_requestProcessing);
52 return m_requestsProcessing.find(requestId) != m_requestsProcessing.end();
53 }
54
55 inline void putRequestId(const Aws::String &requestId) const {
56 std::lock_guard<std::mutex> lock(m_requestProcessing);
57 m_requestsProcessing.insert(requestId);
58 }
59
60 inline void deleteRequestId(const Aws::String &requestId) const {
61 std::lock_guard<std::mutex> lock(m_requestProcessing);
62 m_requestsProcessing.erase(requestId);
63 }
64
65 std::shared_ptr<S3ExpressIdentityProvider> m_S3ExpressIdentityProvider;
66 std::shared_ptr<Auth::AWSCredentialsProvider> m_credentialsProvider;
67 mutable std::set<Aws::String> m_requestsProcessing;
68 mutable std::mutex m_requestProcessing;
69 const Aws::String m_serviceName;
70 const Aws::String m_region;
71 const Aws::String m_endpoint;
72 };
73 }
74}
bool PresignRequest(Aws::Http::HttpRequest &request, const char *region, const char *serviceName, long long expirationInSeconds) const override
S3ExpressSigner(std::shared_ptr< S3ExpressIdentityProvider > S3ExpressIdentityProvider, const std::shared_ptr< Auth::AWSCredentialsProvider > &credentialsProvider, const Aws::String &serviceName, const Aws::String &region, PayloadSigningPolicy signingPolicy=PayloadSigningPolicy::RequestDependent, bool urlEscapePath=true, Aws::Auth::AWSSigningAlgorithm signingAlgorithm=Aws::Auth::AWSSigningAlgorithm::SIGV4)
const char * GetName() const override
Aws::Auth::AWSCredentials GetCredentials(const std::shared_ptr< Aws::Http::ServiceSpecificParameters > &serviceSpecificParameters) const override
bool ServiceRequireUnsignedPayload(const String &serviceName) const override
bool SignRequest(Aws::Http::HttpRequest &request, const char *region, const char *serviceName, bool signBody) const override
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String