Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions httpsig-hyper/examples/hyper-request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn sender_ed25519(req: &mut Request<BoxBody>) {

// set signature with custom signature name
req
.set_message_signature(&signature_params, &secret_key, Some("siged25519"))
.set_message_signature(signature_params, &secret_key, Some("siged25519"))
.await
.unwrap();
}
Expand All @@ -70,7 +70,7 @@ async fn sender_hs256(req: &mut Request<BoxBody>) {
signature_params.set_random_nonce();

req
.set_message_signature(&signature_params, &shared_key, Some("sighs256"))
.set_message_signature(signature_params, &shared_key, Some("sighs256"))
.await
.unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions httpsig-hyper/examples/hyper-response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async fn sender_ed25519(res: &mut Response<BoxBody>, received_req: &Request<BoxB

// set signature with custom signature name
res
.set_message_signature(&signature_params, &secret_key, Some("siged25519"), Some(received_req))
.set_message_signature(signature_params, &secret_key, Some("siged25519"), Some(received_req))
.await
.unwrap();
}
Expand All @@ -82,7 +82,7 @@ async fn sender_hs256(res: &mut Response<BoxBody>, received_req: &Request<BoxBod
signature_params.set_random_nonce();

res
.set_message_signature(&signature_params, &shared_key, Some("sighs256"), Some(received_req))
.set_message_signature(signature_params, &shared_key, Some("sighs256"), Some(received_req))
.await
.unwrap();
}
Expand Down
8 changes: 5 additions & 3 deletions httpsig-hyper/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::borrow::Cow;

use httpsig::prelude::HttpSigError;
use thiserror::Error;

Expand All @@ -9,7 +11,7 @@ pub type HyperSigResult<T> = std::result::Result<T, HyperSigError>;
pub enum HyperSigError {
/// No signature headers found
#[error("No signature headers found: {0}")]
NoSignatureHeaders(String),
NoSignatureHeaders(&'static str),

/// Failed to parse signature headers
#[error("Failed to stringify signature headers: {0}")]
Expand All @@ -21,15 +23,15 @@ pub enum HyperSigError {

/// Invalid component name
#[error("Invalid component name: {0}")]
InvalidComponentName(String),
InvalidComponentName(Cow<'static, str>),

/// Invalid component param
#[error("Invalid component param: {0}")]
InvalidComponentParam(String),

/// Invalid signature
#[error("Invalid signature: {0}")]
InvalidSignature(String),
InvalidSignature(&'static str),

/// Inherited from HttpSigError
#[error("HttpSigError: {0}")]
Expand Down
Loading