Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Jan 29, 2024
1 parent 9547a9f commit 73a314e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/signature_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ impl std::fmt::Display for SignatureBase {
#[cfg(test)]
mod test {
use super::*;
use crate::{message_component::HttpMessageComponentId, signature_params};
use crate::signature_params::HttpSignatureParams;

/// BuilderかSignerか何かでSignatureParamsを、verify時はreqか、sign時は内部に持つ生成フラグから内部的に生成できるようにする。
/// こんな感じでSignatureBaseをParamsとかComponentLinesから直接作るのは避ける。
#[test]
fn test_signature_base_directly_instantiated() {
const SIGPARA: &str = r##";created=1704972031;alg="ed25519";keyid="gjrE7ACMxgzYfFHgabgf4kLTg1eKIdsJ94AiFTFj1is""##;
let values = (r##""@method" "@path" "date" "content-digest""##, SIGPARA);
let signature_params =
signature_params::HttpSignatureParams::try_from(format!("({}){}", values.0, values.1).as_str()).unwrap();
let signature_params = HttpSignatureParams::try_from(format!("({}){}", values.0, values.1).as_str()).unwrap();

let component_lines = vec![
HttpMessageComponent::from_serialized_str("\"@method\": GET").unwrap(),
Expand Down

0 comments on commit 73a314e

Please sign in to comment.