Struct rusoto_signature::signature::SignedRequest [−][src]
pub struct SignedRequest {
pub method: String,
pub service: String,
pub region: Region,
pub path: String,
pub headers: BTreeMap<String, Vec<Vec<u8>>>,
pub params: Params,
pub scheme: Option<String>,
pub hostname: Option<String>,
pub payload: Option<SignedRequestPayload>,
pub canonical_query_string: String,
pub canonical_uri: String,
}
Expand description
A data structure for all the elements of an HTTP request that are involved in the Amazon Signature Version 4 signing process
Fields
method: String
The HTTP Method
service: String
The AWS Service
region: Region
The AWS Region
path: String
The HTTP request path
headers: BTreeMap<String, Vec<Vec<u8>>>
The HTTP Request Headers
params: Params
The HTTP request paramaters
scheme: Option<String>
The HTTP/HTTPS protocol
hostname: Option<String>
The AWS hostname
payload: Option<SignedRequestPayload>
The HTTP Content
canonical_query_string: String
The Standardised query string
canonical_uri: String
The Standardised URI
Implementations
Default constructor
Sets the value of the “content-type” header.
Sets the target hostname
Sets the target hostname using the current service type and region
See the implementation of build_hostname to see how this is done
Sets the new body (payload)
Sets the new body (payload) as a stream
Computes and sets the Content-MD5 header based on the current payload.
Has no effect if the payload is not set, or is not a buffer. Will not
override an existing value for the Content-MD5
header.
Invokes canonical_uri(path)
to return a canonical path
Returns the current canonical URI
Returns the current query string
Converts a paramater such as “example param”: “examplekey” into “&example+param=examplekey”
Modify the region used for signing if needed, such as for AWS Organizations
Converts hostname to String if it exists, else it invokes build_hostname()
If the key exists in headers, set it to blank/unoccupied:
Add a value to the array of headers for the specified key. Headers are kept sorted by key name for use at signing (BTreeMap)
Adds parameter to the HTTP Request
Sets paramaters with a given variable of Params
type
pub fn generate_presigned_url(
&mut self,
creds: &AwsCredentials,
expires_in: &Duration,
should_sha256_sign_payload: bool
) -> String
pub fn generate_presigned_url(
&mut self,
creds: &AwsCredentials,
expires_in: &Duration,
should_sha256_sign_payload: bool
) -> String
Generate a Presigned URL for AWS
See the documentation for more information.
Complement SignedRequest by ensuring the following HTTP headers are set accordingly:
- host
- content-type
- content-length (if applicable)
Signs the request using Amazon Signature version 4 to verify identity. Authorization header uses AWS4-HMAC-SHA256 for signing.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SignedRequest
impl Send for SignedRequest
impl !Sync for SignedRequest
impl Unpin for SignedRequest
impl !UnwindSafe for SignedRequest
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more