chore(auth): refactor; add util function
This commit is contained in:
parent
bb03d28b7d
commit
77a9100b2e
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user