summaryrefslogtreecommitdiff
path: root/webhook/src/handler/signature.rs
diff options
context:
space:
mode:
authorMatthieu <matthieu@developershouse.xyz>2021-10-18 10:44:53 +0400
committerMatthieu <matthieu@developershouse.xyz>2021-10-18 10:44:53 +0400
commitbeacbc6c79c2543bf5ed7386554e3ac6b2d1b9a0 (patch)
tree9a09183e1a512e8677cb922af71c9c68f031ce45 /webhook/src/handler/signature.rs
parente58e816ceb8caa3c77dd98a952761b7e7f05b6cb (diff)
fix tests and adapt webhook
Diffstat (limited to 'webhook/src/handler/signature.rs')
-rw-r--r--webhook/src/handler/signature.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/webhook/src/handler/signature.rs b/webhook/src/handler/signature.rs
index c12f9e8..e4c7d53 100644
--- a/webhook/src/handler/signature.rs
+++ b/webhook/src/handler/signature.rs
@@ -8,16 +8,16 @@ lazy_static::lazy_static! {
&["signature"]
).unwrap();
- static ref SIGNATURE_BODY_COUNTER: Counter = register_counter!(opts!(
- "nova_webhook_",
- "",
+ static ref SIGNATURE_COUNTER: Counter = register_counter!(opts!(
+ "nova_webhook_signatures_verify",
+ "number of signatures verification issued by the service",
labels! {"handler" => "webhook_main"}
)).unwrap();
}
/// Checks the signature of a given data using the hex signature and the public key.
pub fn validate_signature(hex_public_key: &str, data: &Vec<u8>, hex_signature: &str) -> bool {
- SIGNATURE_BODY_COUNTER.inc();
+ SIGNATURE_COUNTER.inc();
let timer = SIGNATURE_TIME_HISTOGRAM.with_label_values(&["webhook_main"]).start_timer();
// First, we need to check if the signature & private key is valid base64.