Struct aws_sdk_rust::aws::common::signature::SignedRequest
[−]
[src]
pub struct SignedRequest<'a> { // some fields omitted }
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.
Methods
impl<'a> SignedRequest<'a>
[src]
fn new(method: &str, service: &str, region: Region, bucket: &str, path: &str, signature: &Signature) -> SignedRequest<'a>
Default constructor
fn set_content_type(&mut self, content_type: String)
fn set_signature(&mut self, signature: Signature)
Allows for overriding inital Signature
used when struct was created.
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_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 set_ssl(&mut self, ssl: bool)
Sets the ssl
flag used for formatting the default Endpoint
.
Mainly used with proxies and inside firewalls where certificates may not be used
(non AWS environments).
Default is true
.
fn ssl(&self) -> bool
Returns the ssl
bool flag. Mainly used for inside firewalls where proxies are used.
Default is true
.
fn bucket(&self) -> &str
Returns the bucket
name.
fn method(&self) -> &str
Returns the HTTP Verb: GET, POST, DELETE, HEAD.
fn signature(&self) -> &Signature
Returns the Signature
enum value: V2 or V4.
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 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>
Adds to the Params
Vec.
fn sign(&mut self, creds: &AwsCredentials)
Called by Requests
and determines which signature function to use.