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
|
-- | Used for uniquely storing ExternalUser entries per user and source
|
||||||
data AuthSourceIdent
|
data AuthSourceIdent
|
||||||
= AuthSourceIdAzure
|
= AuthSourceIdAzure
|
||||||
{ authSourceIdAzureClientId :: UUID
|
{ authSourceIdAzureClientId :: UUID -- FIXME: use tenant id instead
|
||||||
}
|
}
|
||||||
| AuthSourceIdLdap
|
| AuthSourceIdLdap
|
||||||
{ authSourceIdLdapHost :: Text -- normally either just the hostname, or hostname and port
|
{ 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
|
-- | UserAuthConfNoSource -- ^ allow no external sources at all -- TODO: either this, or make user-auth in settings.yml optional
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
|
mkAuthSourceIdent :: AuthSourceConf -> AuthSourceIdent
|
||||||
|
mkAuthSourceIdent = \case
|
||||||
|
AuthSourceConfAzureAdV2 AzureConf{..} -> AuthSourceIdAzure azureConfClientId
|
||||||
|
AuthSourceConfLdap LdapConf{..} -> AuthSourceIdLdap ldapConfSourceId
|
||||||
|
|
||||||
data LmsConf = LmsConf
|
data LmsConf = LmsConf
|
||||||
{ lmsUploadHeader :: Bool
|
{ lmsUploadHeader :: Bool
|
||||||
, lmsUploadDelimiter :: Maybe Char
|
, lmsUploadDelimiter :: Maybe Char
|
||||||
|
|||||||
Reference in New Issue
Block a user