From 77a9100b2ebbc79a7ff13b070aa2c5535f7c6dfd Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 7 Mar 2024 05:36:03 +0100 Subject: [PATCH] chore(auth): refactor; add util function --- src/Model/Types/Auth.hs | 2 +- src/Settings.hs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/Types/Auth.hs b/src/Model/Types/Auth.hs index add176291..c1704c7bc 100644 --- a/src/Model/Types/Auth.hs +++ b/src/Model/Types/Auth.hs @@ -75,7 +75,7 @@ type UserEduPersonPrincipalName = Text -- | Used for uniquely storing ExternalUser entries per user and source data AuthSourceIdent = AuthSourceIdAzure - { authSourceIdAzureClientId :: UUID + { authSourceIdAzureClientId :: UUID -- FIXME: use tenant id instead } | AuthSourceIdLdap { authSourceIdLdapHost :: Text -- normally either just the hostname, or hostname and port diff --git a/src/Settings.hs b/src/Settings.hs index 9aa46f6b1..238d21791 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -155,6 +155,11 @@ data UserAuthConf = -- | UserAuthConfNoSource -- ^ allow no external sources at all -- TODO: either this, or make user-auth in settings.yml optional deriving (Show) +mkAuthSourceIdent :: AuthSourceConf -> AuthSourceIdent +mkAuthSourceIdent = \case + AuthSourceConfAzureAdV2 AzureConf{..} -> AuthSourceIdAzure azureConfClientId + AuthSourceConfLdap LdapConf{..} -> AuthSourceIdLdap ldapConfSourceId + data LmsConf = LmsConf { lmsUploadHeader :: Bool , lmsUploadDelimiter :: Maybe Char