Unverified Commit 67704a27 authored by Alex van de Sandt's avatar Alex van de Sandt Committed by GitHub
Browse files

Derive `Clone` for `SigningSettings` (#3538)

Resolves #3533

`SigningSettings` and some of its fields didn't implement
`Clone`/`Copy`, even though they could. This made it cumbersome to store
and re-use a value of `SigningSettings`.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent c2e50d0c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -22,3 +22,9 @@ message = "Upgraded MSRV to Rust 1.75"
references = ["smithy-rs#3553"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "all"}
author = "jdisanti"

[[aws-sdk-rust]]
message = "Make `SigningSettings` and its fields implement `Clone` and `Copy`"
references = ["smithy-rs#3533"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "avandesa"
+1 −1
Original line number Diff line number Diff line
[package]
name = "aws-sigv4"
version = "1.2.0"
version = "1.2.1"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "David Barsky <me@davidbarsky.com>"]
description = "SigV4 signer for HTTP requests and Event Stream messages."
edition = "2021"
+5 −5
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ use std::time::Duration;
const HEADER_NAME_X_RAY_TRACE_ID: &str = "x-amzn-trace-id";

/// HTTP-specific signing settings
#[derive(Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct SigningSettings {
    /// Specifies how to encode the request URL when signing. Some services do not decode
@@ -45,7 +45,7 @@ pub struct SigningSettings {

/// HTTP payload checksum type
#[non_exhaustive]
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PayloadChecksumKind {
    /// Add x-amz-checksum-sha256 to the canonical request
    ///
@@ -64,7 +64,7 @@ pub enum PayloadChecksumKind {
/// do not decode the path prior to checking the signature, requiring clients to actually
/// _double-encode_ the URI in creating the canonical request in order to pass a signature check.
#[non_exhaustive]
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PercentEncodingMode {
    /// Re-encode the resulting URL (e.g. %30 becomes `%2530)
    Double,
@@ -78,7 +78,7 @@ pub enum PercentEncodingMode {
///
/// URI path normalization is performed based on <https://www.rfc-editor.org/rfc/rfc3986>.
#[non_exhaustive]
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum UriPathNormalizationMode {
    /// Normalize the URI path according to RFC3986
    Enabled,
@@ -100,7 +100,7 @@ impl From<bool> for UriPathNormalizationMode {
/// Config value to specify whether X-Amz-Security-Token should be part of the canonical request.
/// <http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html#temporary-security-credentials>
#[non_exhaustive]
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum SessionTokenMode {
    /// Include in the canonical request before calculating the signature.
    Include,