Refactor and verify http signature on personnal inbox
Verify signature on personnal inbox Reduce code duplication Put Headers in plume-models
This commit is contained in:
@@ -128,6 +128,15 @@ pub enum SignatureValidity {
|
||||
Absent,
|
||||
}
|
||||
|
||||
impl SignatureValidity {
|
||||
pub fn is_secure(&self) -> bool {
|
||||
match self {
|
||||
SignatureValidity::Valid => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn verify_http_headers<S: sign::Signer+::std::fmt::Debug>(sender: &S, all_headers: HeaderMap, data: String) -> SignatureValidity{
|
||||
if let Some(sig_header) = all_headers.get_one("Signature") {
|
||||
let mut _key_id = None;
|
||||
|
||||
Reference in New Issue
Block a user