diff options
Diffstat (limited to 'webhook/src/handler/handler.rs')
| -rw-r--r-- | webhook/src/handler/handler.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/webhook/src/handler/handler.rs b/webhook/src/handler/handler.rs index 74a1762..a07f995 100644 --- a/webhook/src/handler/handler.rs +++ b/webhook/src/handler/handler.rs @@ -19,12 +19,14 @@ use std::{ task::{Context, Poll}, time::Duration, }; +use ed25519_dalek::PublicKey; /// Hyper service used to handle the discord webhooks #[derive(Clone)] pub struct HandlerService { pub config: Arc<Config>, pub nats: Arc<Connection>, + pub public_key: Arc<PublicKey> } impl HandlerService { @@ -38,7 +40,7 @@ impl HandlerService { let contatenated_data = [timestamp.as_bytes().to_vec(), data.to_vec()].concat(); if let Ok(signature_str) = &signature.to_str() { if validate_signature( - &self.config.discord.public_key, + &self.public_key, &contatenated_data, signature_str, ) { |
