Unverified Commit 68956a38 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Merge changes from rcoh/sigv4 into aws-sigv4 (#646)

* Merge aws-sigv4 changes from rcoh/sigv4

* Remove readme

* Use aws-sigv4 package in smithy-rs instead of rcoh/sigv4
parent e20ce0ce
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -9,8 +9,7 @@ license = "Apache-2.0"

[dependencies]
http = "0.2.2"
# Renaming to clearly indicate that this is not a permanent signing solution
aws-sigv4-poc = { package = "aws-sigv4", git = "https://github.com/rcoh/sigv4", rev = "66b1646a7ab119c73be966ca70ee5f556bd8379b"}
aws-sigv4 = { path = "../aws-sigv4" }
aws-auth = { path = "../aws-auth" }
aws-types = { path = "../aws-types" }
smithy-http = { path = "../../../rust-runtime/smithy-http" }
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@

use crate::signer::{OperationSigningConfig, RequestConfig, SigV4Signer, SigningError};
use aws_auth::Credentials;
use aws_sigv4_poc::SignableBody;
use aws_sigv4::SignableBody;
use aws_types::region::SigningRegion;
use aws_types::SigningService;
use smithy_http::middleware::MapRequest;
+4 −4
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 */

use aws_auth::Credentials;
use aws_sigv4_poc::{PayloadChecksumKind, SigningSettings, UriEncoding};
use aws_sigv4::{PayloadChecksumKind, SigningSettings, UriEncoding};
use aws_types::region::SigningRegion;
use aws_types::SigningService;
use http::header::HeaderName;
@@ -13,7 +13,7 @@ use std::error::Error;
use std::fmt;
use std::time::SystemTime;

pub use aws_sigv4_poc::SignableBody;
pub use aws_sigv4::SignableBody;

#[derive(Eq, PartialEq, Clone, Copy)]
pub enum SigningAlgorithm {
@@ -126,7 +126,7 @@ impl SigV4Signer {
        } else {
            PayloadChecksumKind::NoHeader
        };
        let sigv4_config = aws_sigv4_poc::Config {
        let sigv4_config = aws_sigv4::Config {
            access_key: credentials.access_key_id(),
            secret_key: credentials.secret_access_key(),
            security_token: credentials.session_token(),
@@ -150,7 +150,7 @@ impl SigV4Signer {
                    .map(SignableBody::Bytes)
                    .unwrap_or(SignableBody::UnsignedPayload)
            });
        for (key, value) in aws_sigv4_poc::sign_core(request, signable_body, &sigv4_config)? {
        for (key, value) in aws_sigv4::sign_core(request, signable_body, &sigv4_config)? {
            request
                .headers_mut()
                .append(HeaderName::from_static(key), value);
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ serde_urlencoded = "0.7"
bytes = "1"
hex = "0.4"
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
percent-encoding = "2.1"

[dev-dependencies]
pretty_assertions = "0.6"
+0 −3
Original line number Diff line number Diff line
## SigV4

This crates implements an incomplete, poorly documented implementation of SigV4 signing. Use at your own risk!
 No newline at end of file
Loading