From c7ed27513819b81fa2378af572b572d9fe8d1206 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 10 Feb 2024 12:52:17 +0000 Subject: [PATCH] Implement constructors for ServerPadlockGenerator/UserServerKeyGenerator --- src/auth.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 7d38afd..1a1eb51 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -82,8 +82,8 @@ pub struct ServerPadlockGenerator { } impl ServerPadlockGenerator { - pub fn new(/* secret */) -> Self { - todo!() + pub fn new(secret: PadlockGenerationSecret) -> Self { + Self { secret } } #[instrument] @@ -99,8 +99,14 @@ pub struct UserServerKeyGenerator { } impl UserServerKeyGenerator { - pub fn new(/* UserAuthenticator, ServerPadlockGenerator? */) -> Self { - todo!() + pub fn new( + user_authenticator: Arc, + padlock_generator: Arc, + ) -> Self { + Self { + user_authenticator, + padlock_generator, + } } #[instrument]