diff options
author | metamuffin <metamuffin@disroot.org> | 2024-05-29 23:44:14 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-05-29 23:44:14 +0200 |
commit | 29c48afafb4a6a0a0636774f9b56423881fb1703 (patch) | |
tree | fa610555a33c25a1aaeb98242099c2010ac243b0 /src/main.rs | |
parent | 886a18e0c67624d0882f04c7f6659bcfee6b4d8d (diff) | |
download | gnix-29c48afafb4a6a0a0636774f9b56423881fb1703.tar gnix-29c48afafb4a6a0a0636774f9b56423881fb1703.tar.bz2 gnix-29c48afafb4a6a0a0636774f9b56423881fb1703.tar.zst |
implement cookie base auth.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 7c74f70..5a88ad1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ pub mod helper; #[cfg(feature = "mond")] pub mod reporting; +use aes_gcm_siv::{aead::generic_array::GenericArray, Aes256GcmSiv, KeyInit}; use anyhow::{anyhow, Context, Result}; use config::{setup_file_watch, Config, NODE_KINDS}; use error::ServiceError; @@ -46,6 +47,7 @@ use tokio::{ use tokio_rustls::TlsAcceptor; pub struct State { + pub crypto_key: Aes256GcmSiv, pub config: RwLock<Arc<Config>>, pub access_logs: RwLock<HashMap<String, BufWriter<File>>>, pub l_incoming: Semaphore, @@ -81,6 +83,7 @@ async fn main() -> anyhow::Result<()> { } }; let state = Arc::new(State { + crypto_key: aes_gcm_siv::Aes256GcmSiv::new(GenericArray::from_slice(&config.private_key)), l_incoming: Semaphore::new(config.limits.max_incoming_connections), l_outgoing: Semaphore::new(config.limits.max_outgoing_connections), #[cfg(feature = "mond")] |