From a37d4b369a2b8cb169c6de67b3fb482fdbfa8c50 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Wed, 21 Feb 2024 07:14:18 +0100 Subject: [PATCH] chore(application): rename conf constructors --- src/Application.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index 9535c36c7..85db6bf07 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -314,14 +314,14 @@ makeFoundation appSettings''@AppSettings{..} = do -- TODO: reintroduce failover once UserDbFailover is implemented (see above) ldapPool <- fmap join . forM appLdapPoolConf $ \ResourcePoolConf{..} -> if - | UserSourceConfSingleSource{..} <- appUserSourceConf - , UserSourceLdap conf@LdapConf{..} <- usersrcSingleSource + | UserAuthConfSingleSource{..} <- appUserAuthConf + , AuthSourceConfLdap conf@LdapConf{..} <- userAuthConfSingleSource -> do -- set up a singleton ldap pool with no failover - let ldapLabel = case ldapHost of - Ldap.Plain str -> pack str <> ":" <> tshow ldapPort - Ldap.Tls str _ -> pack str <> ":" <> tshow ldapPort + let ldapLabel = case ldapConfHost of + Ldap.Plain str -> pack str <> ":" <> tshow ldapConfPort + Ldap.Tls str _ -> pack str <> ":" <> tshow ldapConfPort $logDebugS "setup" $ "LDAP-Pool " <> ldapLabel - Just . (conf,) <$> createLdapPool ldapHost ldapPort poolStripes poolTimeout ldapTimeout poolLimit + Just . (conf,) <$> createLdapPool ldapConfHost ldapConfPort poolStripes poolTimeout ldapConfTimeout poolLimit | otherwise -- No LDAP pool to be initialized -> return Nothing @@ -356,7 +356,7 @@ makeFoundation appSettings''@AppSettings{..} = do return . uncurry p $ fromJust mArgs appAuthPlugins <- liftIO $ sequence [ - (oauth2MockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT" + (azureMockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT" , loadPlugin (oauth2AzureADv2Scoped ["openid", "profile", "offline_access"] tenantID) "AZURE_ADV2" ] @@ -803,7 +803,7 @@ db' = handler' . runDB addPWEntry :: User -> Text {-^ Password -} -> IO () -addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do +addPWEntry User{ userPasswordHash = _, ..} (Text.encodeUtf8 -> pw) = db' $ do PWHashConf{..} <- getsYesod $ view _appAuthPWHash - (AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength + (Just . Text.decodeUtf8 -> userPasswordHash) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength void $ insert User{..}