pub struct CanonicalRequest { /* private fields */ }
unstable
only.Expand description
A canonicalized request for AWS SigV4.
This is mainly used internally for generating the canonical request for signing, but is exposed for testing and debugging purposes.
The stability of this struct is not guaranteed. The fields and methods are subject to change in minor/patch versions.
Implementations§
Source§impl CanonicalRequest
impl CanonicalRequest
Sourcepub fn from_request_parts(
parts: Parts,
body: Bytes,
options: SignatureOptions,
) -> Result<(Self, Parts, Bytes), SignatureError>
pub fn from_request_parts( parts: Parts, body: Bytes, options: SignatureOptions, ) -> Result<(Self, Parts, Bytes), SignatureError>
Sourcepub fn request_method(&self) -> &str
pub fn request_method(&self) -> &str
Retrieve the HTTP request method.
Sourcepub fn canonical_path(&self) -> &str
pub fn canonical_path(&self) -> &str
Retrieve the canonicalized URI path from the request.
Sourcepub fn query_parameters(&self) -> &HashMap<String, Vec<String>>
pub fn query_parameters(&self) -> &HashMap<String, Vec<String>>
Retrieve the query parameters from the request. Values are ordered as they appear in the URL, followed by any
values in the request body if the request body is of type application/x-www-form-urlencoded
. Values are
normalized to be percent-encoded.
Sourcepub fn headers(&self) -> &HashMap<String, Vec<Vec<u8>>>
pub fn headers(&self) -> &HashMap<String, Vec<Vec<u8>>>
Retrieve the headers from the request. Values are ordered as they appear in the HTTP request.
Sourcepub fn body_sha256(&self) -> &str
pub fn body_sha256(&self) -> &str
Retrieve the SHA-256 hash of the request body.
Sourcepub fn canonical_query_string(&self) -> String
pub fn canonical_query_string(&self) -> String
Get the canonical query string from the request.
Sourcepub fn canonical_request(&self, signed_headers: &Vec<String>) -> Vec<u8> ⓘ
pub fn canonical_request(&self, signed_headers: &Vec<String>) -> Vec<u8> ⓘ
Get the canonical request to hash for the request.
Sourcepub fn canonical_request_sha256(&self, signed_headers: &Vec<String>) -> [u8; 32]
pub fn canonical_request_sha256(&self, signed_headers: &Vec<String>) -> [u8; 32]
Get the SHA-256 hash of the canonical request.
Sourcepub fn get_authenticator<S>(
&self,
signed_header_requirements: &S,
) -> Result<SigV4Authenticator, SignatureError>where
S: SignedHeaderRequirements,
pub fn get_authenticator<S>(
&self,
signed_header_requirements: &S,
) -> Result<SigV4Authenticator, SignatureError>where
S: SignedHeaderRequirements,
Create a SigV4Authenticator for the request. This performs steps 1-8 from the AWS Auth Error Ordering workflow.
Sourcepub fn get_authenticator_from_auth_parameters(
&self,
auth_params: AuthParams,
) -> Result<SigV4Authenticator, SignatureError>
pub fn get_authenticator_from_auth_parameters( &self, auth_params: AuthParams, ) -> Result<SigV4Authenticator, SignatureError>
Create an authenticator based on the provided AuthParams
.
Sourcepub fn get_auth_parameters<S>(
&self,
signed_header_requirements: &S,
) -> Result<AuthParams, SignatureError>where
S: SignedHeaderRequirements,
pub fn get_auth_parameters<S>(
&self,
signed_header_requirements: &S,
) -> Result<AuthParams, SignatureError>where
S: SignedHeaderRequirements,
Create an AuthParams structure, either from the Authorization
header or the query strings as appropriate.
This performs step 5 and either performs steps 6a-6d or 7a-7d from the AWS Auth Error Ordering workflow.
Sourcepub fn get_auth_parameters_from_auth_header<'a>(
&'a self,
auth_header: &'a [u8],
) -> Result<AuthParams, SignatureError>
pub fn get_auth_parameters_from_auth_header<'a>( &'a self, auth_header: &'a [u8], ) -> Result<AuthParams, SignatureError>
Create an AuthParams
structure from the Authorization
header. This performs steps 6a-6d of the AWS Auth
Error Ordering workflow.
Sourcepub fn get_auth_parameters_from_query_parameters(
&self,
query_alg: &str,
) -> Result<AuthParams, SignatureError>
pub fn get_auth_parameters_from_query_parameters( &self, query_alg: &str, ) -> Result<AuthParams, SignatureError>
Create an AuthParams
structure from the query parameters. This performs steps 7a-7d of the AWS Auth
Error Ordering workflow.
Trait Implementations§
Source§impl Clone for CanonicalRequest
impl Clone for CanonicalRequest
Source§fn clone(&self) -> CanonicalRequest
fn clone(&self) -> CanonicalRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more