Remove unused dependencies, bump reqwest-middleware

This commit is contained in:
asonix 2022-11-22 10:15:14 -06:00
parent 1573372778
commit cefea4b7ec
2 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,7 @@
[package] [package]
name = "http-signature-normalization-reqwest" name = "http-signature-normalization-reqwest"
description = "An HTTP Signatures library that leaves the signing to you" description = "An HTTP Signatures library that leaves the signing to you"
version = "0.6.0" version = "0.7.0"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
license-file = "LICENSE" license-file = "LICENSE"
readme = "README.md" readme = "README.md"
@ -23,11 +23,9 @@ required-features = ["sha-2"]
[dependencies] [dependencies]
base64 = { version = "0.13", optional = true } base64 = { version = "0.13", optional = true }
bytes = "1"
http = "0.2.0"
http-signature-normalization = { version = "0.6.0", path = ".." } http-signature-normalization = { version = "0.6.0", path = ".." }
reqwest = { version = "0.11", default-features = false, features = ["json"] } reqwest = { version = "0.11", default-features = false, features = ["json"] }
reqwest-middleware = { version = "0.1.2", optional = true } reqwest-middleware = { version = "0.2.0", optional = true }
sha2 = { version = "0.10", optional = true } sha2 = { version = "0.10", optional = true }
sha3 = { version = "0.10", optional = true } sha3 = { version = "0.10", optional = true }
thiserror = "1.0" thiserror = "1.0"

View file

@ -1,9 +1,11 @@
use std::time::SystemTime;
use http_signature_normalization_reqwest::prelude::*; use http_signature_normalization_reqwest::prelude::*;
use httpdate::HttpDate; use httpdate::HttpDate;
use reqwest::{header::DATE, Client}; use reqwest::{
header::{ACCEPT, DATE, USER_AGENT},
Client,
};
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
use std::time::SystemTime;
async fn request(config: Config) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { async fn request(config: Config) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let digest = Sha256::new(); let digest = Sha256::new();
@ -12,8 +14,8 @@ async fn request(config: Config) -> Result<(), Box<dyn std::error::Error + Send
let request = client let request = client
.post("http://127.0.0.1:8010/") .post("http://127.0.0.1:8010/")
.header("User-Agent", "Reqwest") .header(USER_AGENT, "Reqwest")
.header("Accept", "text/plain") .header(ACCEPT, "text/plain")
.header(DATE, HttpDate::from(SystemTime::now()).to_string()) .header(DATE, HttpDate::from(SystemTime::now()).to_string())
.signature_with_digest(config, "my-key-id", digest, "Hewwo-owo", |s| { .signature_with_digest(config, "my-key-id", digest, "Hewwo-owo", |s| {
println!("Signing String\n{}", s); println!("Signing String\n{}", s);