Struct aws_sdk_rust::aws::common::signature::SignedRequest
[−]
[src]
pub struct SignedRequest<'a> { pub method: String, pub service: String, pub region: Region, pub path: String, pub headers: BTreeMap<String, Vec<Vec<u8>>>, pub params: Params, pub bucket: String, pub hostname: Option<String>, pub payload: Option<&'a [u8]>, pub content_type: Option<String>, pub path_options: Option<String>, pub canonical_query_string: String, pub canonical_uri: String, pub endpoint: &'a Endpoint, }
A data structure for all the elements of an HTTP request that are involved in the Amazon Signature Version 4 signing process version - represents the Signature version. The default is 4 but it can also be set to 2 for older environments.
Fields
method: String
service: String
region: Region
path: String
headers: BTreeMap<String, Vec<Vec<u8>>>
params: Params
bucket: String
hostname: Option<String>
payload: Option<&'a [u8]>
content_type: Option<String>
path_options: Option<String>
canonical_query_string: String
canonical_uri: String
endpoint: &'a Endpoint
Methods
impl<'a> SignedRequest<'a>
[src]
fn new(
method: &str,
service: &str,
region: Region,
bucket: &str,
path: &str,
endpoint: &'a Endpoint
) -> SignedRequest<'a>
method: &str,
service: &str,
region: Region,
bucket: &str,
path: &str,
endpoint: &'a Endpoint
) -> SignedRequest<'a>
Default constructor
fn set_content_type(&mut self, content_type: String)
fn set_bucket(&mut self, bucket: &str)
Allows for overriding inital bucket name used when struct was created.
fn set_hostname(&mut self, hostname: Option<String>)
Use this for adding an actual endpoint such as s3.us-east-1.amazon.com or one of your choice. hostname in this context means the FQDN less the bucket name if using Virtual Buckets.
fn set_path_options(&mut self, path_options: Option<String>)
Sets the path_options which allows you to prepend a query path option to the normal query path string but not have it included in the signature. Only certain third party products use this.
fn set_endpoint_prefix(&mut self, endpoint_prefix: String)
fn set_payload(&mut self, payload: Option<&'a [u8]>)
Allows you to set the UTF8 payload in bytes.
fn set_params(&mut self, params: Params)
Sets a new set of Params
.
fn bucket(&self) -> &str
Returns the bucket
name.
fn method(&self) -> &str
Returns the HTTP Verb: GET, POST, DELETE, HEAD.
fn endpoint(&self) -> &Endpoint
fn endpoint_scheme(&self) -> &str
fn path(&self) -> &str
Returns the path (uri)
used for calculating signature.
fn canonical_uri(&self) -> &str
Returns the Canonical URI used by the signature process.
fn canonical_query_string(&self) -> &str
Returns the Canonical Query used by the signature process.
fn payload(&self) -> Option<&'a [u8]>
Returns the UTF8 byte slice of the payload.
fn headers(&'a self) -> &'a BTreeMap<String, Vec<Vec<u8>>>
Returns the Vec of headers
.
fn hostname(&self) -> String
Returns hostname
value or builds a new one based on the AWS S3 service and Region.
fn path_options(&self) -> Option<String>
Returns the path_options which allows you to prepend a query path option to the normal query path string but not have it included in the signature. Only certain third party products use this.
fn remove_header(&mut self, key: &str)
If the header key exists in headers, set it to blank/unoccupied:
fn add_header(&mut self, key: &str, value: &str)
Add a value to the array of headers for the specified key. Headers are kept sorted by key name for use at signing (BTreeMap)
fn update_header(&mut self, key: &str, value: &str)
Removes header if exists and then adds new one.
fn get_header(&mut self, key: &str) -> String
fn add_param<S>(&mut self, key: S, value: S) where
S: Into<String>,
S: Into<String>,
Adds to the Params
Vec.
fn sign(&mut self, creds: &AwsCredentials)
Called by Requests
and determines which signature function to use.