diff --git a/Cargo.toml b/Cargo.toml index 184bb19..fe58eb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" [workspace.package] edition = "2021" -version = "0.0.10" +version = "0.0.11" authors = ["Jun Kurihara"] homepage = "https://github.com/junkurihara/httpsig-rs" repository = "https://github.com/junkurihara/httpsig-rs" diff --git a/httpsig-hyper/Cargo.toml b/httpsig-hyper/Cargo.toml index 2c85bbd..d3d0268 100644 --- a/httpsig-hyper/Cargo.toml +++ b/httpsig-hyper/Cargo.toml @@ -13,7 +13,7 @@ rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -httpsig = { path = "../httpsig", version = "0.0.10" } +httpsig = { path = "../httpsig", version = "0.0.11" } thiserror = { version = "1.0.57" } tracing = { version = "0.1.40" } diff --git a/httpsig-hyper/src/hyper_http.rs b/httpsig-hyper/src/hyper_http.rs index f668eb3..2246696 100644 --- a/httpsig-hyper/src/hyper_http.rs +++ b/httpsig-hyper/src/hyper_http.rs @@ -41,6 +41,9 @@ pub trait RequestMessageSignature { /// Extract all key ids for signature bases contained in the request headers fn get_key_ids(&self) -> Result, Self::Error>; + /// Extract all signature params used to generate signature bases contained in the request headers + fn get_signature_params(&self) -> Result, Self::Error>; + /// Extract all signature bases contained in the request headers fn extract_signatures(&self) -> Result, Self::Error>; } @@ -134,6 +137,16 @@ where Ok(res) } + /// Extract all signature params used to generate signature bases contained in the request headers + fn get_signature_params(&self) -> Result, Self::Error> { + let signature_headers_map = extract_signature_headers_with_name(self)?; + let res = signature_headers_map + .iter() + .map(|(_, headers)| headers.signature_params().clone()) + .collect::>(); + Ok(res) + } + /// Extract all signature bases contained in the request headers fn extract_signatures(&self) -> Result, Self::Error> { let signature_headers_map = extract_signature_headers_with_name(self)?;