AWS SDK for C++
1.9.1
AWS SDK for C++
|
#include <AWSAuthSigner.h>
Public Types | |
enum | PayloadSigningPolicy { PayloadSigningPolicy::RequestDependent, PayloadSigningPolicy::Always, PayloadSigningPolicy::Never } |
Public Member Functions | |
AWSAuthV4Signer (const std::shared_ptr< Auth::AWSCredentialsProvider > &credentialsProvider, const char *serviceName, const Aws::String ®ion, PayloadSigningPolicy signingPolicy=PayloadSigningPolicy::RequestDependent, bool urlEscapePath=true) | |
virtual | ~AWSAuthV4Signer () |
const char * | GetName () const override |
bool | SignRequest (Aws::Http::HttpRequest &request) const override |
bool | SignRequest (Aws::Http::HttpRequest &request, bool signBody) const override |
bool | SignRequest (Aws::Http::HttpRequest &request, const char *region, bool signBody) const override |
bool | SignRequest (Aws::Http::HttpRequest &request, const char *region, const char *serviceName, bool signBody) const override |
bool | PresignRequest (Aws::Http::HttpRequest &request, long long expirationInSeconds=0) const override |
bool | PresignRequest (Aws::Http::HttpRequest &request, const char *region, long long expirationInSeconds=0) const override |
bool | PresignRequest (Aws::Http::HttpRequest &request, const char *region, const char *serviceName, long long expirationInSeconds=0) const override |
Aws::String | GetServiceName () const |
Aws::String | GetRegion () const |
Aws::String | GenerateSignature (const Aws::Auth::AWSCredentials &credentials, const Aws::String &stringToSign, const Aws::String &simpleDate) const |
bool | ShouldSignHeader (const Aws::String &header) const |
![]() | |
AWSAuthSigner () | |
virtual | ~AWSAuthSigner ()=default |
virtual bool | SignEventMessage (Aws::Utils::Event::Message &, Aws::String &) const |
virtual void | SetClockSkew (const std::chrono::milliseconds &clockSkew) |
virtual Aws::Utils::DateTime | GetSigningTimestamp () const |
Protected Attributes | |
bool | m_includeSha256HashHeader |
![]() | |
std::atomic< std::chrono::milliseconds > | m_clockSkew |
Additional Inherited Members | |
![]() | |
virtual std::chrono::milliseconds | GetClockSkewOffset () const |
AWS Auth v4 Signer implementation of the AWSAuthSigner interface. More information on AWS Auth v4 Can be found here: http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html
Definition at line 167 of file AWSAuthSigner.h.
Even though different payload signing polices, HTTP will force payload signing to be on.
Enumerator | |
---|---|
RequestDependent | Sign the request based on the value returned by AmazonWebServiceRequest::SignBody() |
Always | Always sign the body of the request. |
Never | Never sign the body of the request |
Definition at line 174 of file AWSAuthSigner.h.
Aws::Client::AWSAuthV4Signer::AWSAuthV4Signer | ( | const std::shared_ptr< Auth::AWSCredentialsProvider > & | credentialsProvider, |
const char * | serviceName, | ||
const Aws::String & | region, | ||
PayloadSigningPolicy | signingPolicy = PayloadSigningPolicy::RequestDependent , |
||
bool | urlEscapePath = true |
||
) |
credentialsProvider, source of AWS Credentials to sign requests with serviceName, canonical service name to sign with region, region string to use in signature signPayloads, if Always, the payload will have a sha256 computed on the body of the request. If this is set to Never, the sha256 will not be computed on the body. This is only useful for Amazon S3 over Https. If Https is not used then this flag will be ignored. If set to RequestDependent, compute or not is based on the value from AmazonWebServiceRequest::SignBody()
|
virtual |
Aws::String Aws::Client::AWSAuthV4Signer::GenerateSignature | ( | const Aws::Auth::AWSCredentials & | credentials, |
const Aws::String & | stringToSign, | ||
const Aws::String & | simpleDate | ||
) | const |
|
inlineoverridevirtual |
AWSAuthV4signer's implementation of virtual function from base class Return Auth Signer's name, here the value is specified in Aws::Auth::DEFAULT_AUTHV4_SIGNER.
Implements Aws::Client::AWSAuthSigner.
Definition at line 208 of file AWSAuthSigner.h.
|
inline |
Definition at line 275 of file AWSAuthSigner.h.
|
inline |
Definition at line 274 of file AWSAuthSigner.h.
|
overridevirtual |
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_serviceName by default if parameter serviceName is nullptr.
Implements Aws::Client::AWSAuthSigner.
|
overridevirtual |
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.
Implements Aws::Client::AWSAuthSigner.
|
overridevirtual |
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. Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. expirationInSeconds defaults to 0 which provides a URI good for 7 days.
Implements Aws::Client::AWSAuthSigner.
bool Aws::Client::AWSAuthV4Signer::ShouldSignHeader | ( | const Aws::String & | header | ) | const |
|
inlineoverridevirtual |
Signs the request itself based on info in the request and uri. Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
Implements Aws::Client::AWSAuthSigner.
Definition at line 214 of file AWSAuthSigner.h.
|
inlineoverridevirtual |
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.
Reimplemented from Aws::Client::AWSAuthSigner.
Definition at line 224 of file AWSAuthSigner.h.
|
inlineoverridevirtual |
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.
Reimplemented from Aws::Client::AWSAuthSigner.
Definition at line 234 of file AWSAuthSigner.h.
|
overridevirtual |
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.
Reimplemented from Aws::Client::AWSAuthSigner.
|
protected |
Definition at line 281 of file AWSAuthSigner.h.