AWS SDK for C++  1.9.66
AWS SDK for C++
Public Types | Public Member Functions | Protected Attributes | List of all members
Aws::Client::AWSAuthV4Signer Class Reference

#include <AWSAuthSigner.h>

+ Inheritance diagram for Aws::Client::AWSAuthV4Signer:

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 &region, 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
 
- Public Member Functions inherited from Aws::Client::AWSAuthSigner
 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
 
- Protected Attributes inherited from Aws::Client::AWSAuthSigner
std::atomic< std::chrono::milliseconds > m_clockSkew
 

Additional Inherited Members

- Protected Member Functions inherited from Aws::Client::AWSAuthSigner
virtual std::chrono::milliseconds GetClockSkewOffset () const
 

Detailed Description

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.

Member Enumeration Documentation

◆ PayloadSigningPolicy

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.

Constructor & Destructor Documentation

◆ AWSAuthV4Signer()

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()

◆ ~AWSAuthV4Signer()

virtual Aws::Client::AWSAuthV4Signer::~AWSAuthV4Signer ( )
virtual

Member Function Documentation

◆ GenerateSignature()

Aws::String Aws::Client::AWSAuthV4Signer::GenerateSignature ( const Aws::Auth::AWSCredentials credentials,
const Aws::String stringToSign,
const Aws::String simpleDate 
) const

◆ GetName()

const char* Aws::Client::AWSAuthV4Signer::GetName ( ) 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.

◆ GetRegion()

Aws::String Aws::Client::AWSAuthV4Signer::GetRegion ( ) const
inline

Definition at line 275 of file AWSAuthSigner.h.

◆ GetServiceName()

Aws::String Aws::Client::AWSAuthV4Signer::GetServiceName ( ) const
inline

Definition at line 274 of file AWSAuthSigner.h.

◆ PresignRequest() [1/3]

bool Aws::Client::AWSAuthV4Signer::PresignRequest ( Aws::Http::HttpRequest request,
const char *  region,
const char *  serviceName,
long long  expirationInSeconds = 0 
) const
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.

◆ PresignRequest() [2/3]

bool Aws::Client::AWSAuthV4Signer::PresignRequest ( Aws::Http::HttpRequest request,
const char *  region,
long long  expirationInSeconds = 0 
) const
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.

◆ PresignRequest() [3/3]

bool Aws::Client::AWSAuthV4Signer::PresignRequest ( Aws::Http::HttpRequest request,
long long  expirationInSeconds = 0 
) const
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.

◆ ShouldSignHeader()

bool Aws::Client::AWSAuthV4Signer::ShouldSignHeader ( const Aws::String header) const

◆ SignRequest() [1/4]

bool Aws::Client::AWSAuthV4Signer::SignRequest ( Aws::Http::HttpRequest request) 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.

◆ SignRequest() [2/4]

bool Aws::Client::AWSAuthV4Signer::SignRequest ( Aws::Http::HttpRequest request,
bool  signBody 
) const
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.

◆ SignRequest() [3/4]

bool Aws::Client::AWSAuthV4Signer::SignRequest ( Aws::Http::HttpRequest request,
const char *  region,
bool  signBody 
) const
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.

◆ SignRequest() [4/4]

bool Aws::Client::AWSAuthV4Signer::SignRequest ( Aws::Http::HttpRequest request,
const char *  region,
const char *  serviceName,
bool  signBody 
) const
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.

Member Data Documentation

◆ m_includeSha256HashHeader

bool Aws::Client::AWSAuthV4Signer::m_includeSha256HashHeader
protected

Definition at line 281 of file AWSAuthSigner.h.


The documentation for this class was generated from the following file: