AWS SDK for C++

AWS SDK for C++ Version 1.11.929

Loading...
Searching...
No Matches
Aws::Client::AWSAuthV4Signer Class Reference

#include <AWSAuthV4Signer.h>

Inheritance diagram for Aws::Client::AWSAuthV4Signer:
[legend]

Public Types

enum class  PayloadSigningPolicy { RequestDependent , Always , 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, Aws::Auth::AWSSigningAlgorithm signingAlgorithm=Aws::Auth::AWSSigningAlgorithm::SIGV4)
 
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
 
bool PresignRequest (Aws::Http::HttpRequest &request, const Aws::Auth::AWSCredentials &creds, const char *region, const char *serviceName, long long expirationInSeconds=0) const
 
virtual Aws::Auth::AWSCredentials GetCredentials (const std::shared_ptr< Aws::Http::ServiceSpecificParameters > &serviceSpecificParameters) const
 
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 Member Functions

virtual bool ServiceRequireUnsignedPayload (const Aws::String &serviceName) const
 
void UpdateUserAgentWithCredentialFeatures (Aws::Http::HttpRequest &request, const Aws::Auth::CredentialsResolutionContext &context) const
 
- Protected Member Functions inherited from Aws::Client::AWSAuthSigner
virtual std::chrono::milliseconds GetClockSkewOffset () const
 

Protected Attributes

bool m_includeSha256HashHeader
 
- Protected Attributes inherited from Aws::Client::AWSAuthSigner
std::atomic< std::chrono::milliseconds > m_clockSkew
 

Friends

class smithy::AwsSigV4Signer
 

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 57 of file AWSAuthV4Signer.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 64 of file AWSAuthV4Signer.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,
Aws::Auth::AWSSigningAlgorithm signingAlgorithm = Aws::Auth::AWSSigningAlgorithm::SIGV4 )

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

◆ GetCredentials()

virtual Aws::Auth::AWSCredentials Aws::Client::AWSAuthV4Signer::GetCredentials ( const std::shared_ptr< Aws::Http::ServiceSpecificParameters > & serviceSpecificParameters) const
virtual

◆ 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 98 of file AWSAuthV4Signer.h.

◆ GetRegion()

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

Definition at line 188 of file AWSAuthV4Signer.h.

◆ GetServiceName()

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

Definition at line 187 of file AWSAuthV4Signer.h.

◆ PresignRequest() [1/4]

bool Aws::Client::AWSAuthV4Signer::PresignRequest ( Aws::Http::HttpRequest & request,
const Aws::Auth::AWSCredentials & creds,
const char * region,
const char * serviceName,
long long expirationInSeconds = 0 ) const

Takes a request and signs the URI based on request, region, servicename, expiration and credentials. 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.

◆ PresignRequest() [2/4]

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() [3/4]

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() [4/4]

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.

◆ ServiceRequireUnsignedPayload()

virtual bool Aws::Client::AWSAuthV4Signer::ServiceRequireUnsignedPayload ( const Aws::String & serviceName) const
protectedvirtual

◆ 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 114 of file AWSAuthV4Signer.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 124 of file AWSAuthV4Signer.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 134 of file AWSAuthV4Signer.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.

◆ UpdateUserAgentWithCredentialFeatures()

void Aws::Client::AWSAuthV4Signer::UpdateUserAgentWithCredentialFeatures ( Aws::Http::HttpRequest & request,
const Aws::Auth::CredentialsResolutionContext & context ) const
protected

Friends And Related Symbol Documentation

◆ smithy::AwsSigV4Signer

friend class smithy::AwsSigV4Signer
friend

Definition at line 213 of file AWSAuthV4Signer.h.

Member Data Documentation

◆ m_includeSha256HashHeader

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

Definition at line 196 of file AWSAuthV4Signer.h.


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