chore(auth): mockPluginName->apAzureMock

This commit is contained in:
Sarah Vaupel 2024-02-01 20:51:31 +01:00
parent 1d7b46b4a4
commit a85a5be4cd

View File

@ -9,8 +9,8 @@ module Auth.OAuth2
, azurePrimaryKey, azureUserPrincipalName, azureUserDisplayName, azureUserGivenName, azureUserSurname, azureUserMail, azureUserTelephone, azureUserMobile, azureUserPreferredLanguage
, azureUser, azureUser'
, AzureUserException(..), _AzureUserError, _AzureUserNoResult, _AzureUserAmbiguous
, apAzureMock
, oauth2MockServer
, mockPluginName
) where
import qualified Data.CaseInsensitive as CI
@ -79,8 +79,8 @@ azureUser' conf User{userIdent}
---- OAuth2 development auth plugin ----
----------------------------------------
mockPluginName :: Text
mockPluginName = "uniworx_dev"
apAzureMock :: Text
apAzureMock = "uniworx_dev"
newtype UserID = UserID Text
instance FromJSON UserID where
@ -98,10 +98,10 @@ oauth2MockServer =
}
mockServerURL = "0.0.0.0/"
profileSrc = fromString $ mockServerURL <> "/foo"
in authOAuth2 mockPluginName oa $ \manager token -> do
(UserID userID, userResponse) <- authGetProfile mockPluginName manager token profileSrc
in authOAuth2 apAzureMock oa $ \manager token -> do
(UserID userID, userResponse) <- authGetProfile apAzureMock manager token profileSrc
return Creds
{ credsPlugin = mockPluginName
{ credsPlugin = apAzureMock
, credsIdent = userID
, credsExtra = setExtra token userResponse
}