Implement constructors for ServerPadlockGenerator/UserServerKeyGenerator

This commit is contained in:
Xiretza 2024-02-10 12:52:17 +00:00
parent d37c09d8d9
commit c7ed275138

View file

@ -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<UserAuthenticator>,
padlock_generator: Arc<ServerPadlockGenerator>,
) -> Self {
Self {
user_authenticator,
padlock_generator,
}
}
#[instrument]