From cea64da34dc462c5388f44ecc55d9dbd86b37ba3 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 19 Mar 2024 16:27:57 +0100 Subject: [PATCH] chore(oauth2): downgrade yesod-auth-oauth2 to v0.6.3.4 --- src/Application.hs | 6 +++--- src/Auth/OAuth2.hs | 10 +++++----- stack.yaml | 2 +- stack.yaml.lock | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index bc1ea2bec..fca9e7038 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -61,7 +61,7 @@ import Jobs import qualified Data.Text.Encoding as Text -import Yesod.Auth.OAuth2.AzureADv2 (oauth2AzureADv2Scoped) +import Yesod.Auth.OAuth2.AzureAD (oauth2AzureADScoped) import Yesod.Auth.Util.PasswordStore import qualified Data.ByteString.Lazy as LBS @@ -349,7 +349,7 @@ makeFoundation appSettings''@AppSettings{..} = do #ifdef DEVELOPMENT oauth2Plugins <- liftIO $ sequence [ (azureMockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT" - , return $ oauth2AzureADv2Scoped ["openid", "profile", "offline_access"] "42" "42" "shhh" + , return $ oauth2AzureADScoped ["openid", "profile", "offline_access"] "42" "shhh" ] #else let -- Auth Plugins @@ -366,7 +366,7 @@ makeFoundation appSettings''@AppSettings{..} = do -> error "Tenant ID missing!" oauth2Plugins | UserAuthConfSingleSource (AuthSourceConfAzure AzureConf{..}) appUserAuthConf - -> singleton $ oauth2AzureADv2Scoped (Set.toList azureConfScopes) azureConfTenantId azureConfClientId azureConfClientSecret + -> singleton $ oauth2AzureADScoped (Set.toList azureConfScopes) azureConfClientId azureConfClientSecret | otherwise -> mempty #endif diff --git a/src/Auth/OAuth2.hs b/src/Auth/OAuth2.hs index 97495c1d7..88bcff790 100644 --- a/src/Auth/OAuth2.hs +++ b/src/Auth/OAuth2.hs @@ -118,15 +118,15 @@ instance FromJSON UserID where azureMockServer :: YesodAuth m => String -> AuthPlugin m azureMockServer port = let oa = OAuth2 - { oauth2ClientId = "42" - , oauth2ClientSecret = Just "shhh" - , oauth2AuthorizeEndpoint = fromString (mockServerURL <> "/auth") + { oauthClientId = "42" + , oauthClientSecret = Just "shhh" + , oauthOAuthorizeEndpoint = fromString (mockServerURL <> "/auth") `withQuery` [ scopeParam " " ["openid", "profile", "email", "offline_access"] -- TODO read scopes from config , ("response_type", "code id_token") , ("nonce", "Foo") -- TODO generate meaningful value ] - , oauth2TokenEndpoint = fromString $ mockServerURL <> "/token" - , oauth2RedirectUri = Nothing + , oauthAccessTokenEndpoint = fromString $ mockServerURL <> "/token" + , oauthCallback = Nothing } mockServerURL = "http://localhost:" <> fromString port profileSrc = fromString $ mockServerURL <> "/users/me" diff --git a/stack.yaml b/stack.yaml index 4d8ca60f8..7346e8392 100644 --- a/stack.yaml +++ b/stack.yaml @@ -89,7 +89,7 @@ extra-deps: - yesod-websockets - git: https://github.com/freckle/yesod-auth-oauth2 - commit: 11948a65c405f1a99ccb327d328d416e492542a1 + commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66 - git: https://gitlab.uniworx.de/haskell/cryptonite.git commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f diff --git a/stack.yaml.lock b/stack.yaml.lock index 17f701258..40712391d 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -416,15 +416,15 @@ packages: git: https://gitlab.uniworx.de/haskell/yesod.git subdir: yesod-websockets - completed: - commit: 11948a65c405f1a99ccb327d328d416e492542a1 + commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66 git: https://github.com/freckle/yesod-auth-oauth2 name: yesod-auth-oauth2 pantry-tree: - sha256: a68ec51e1008c315dd15e81cc3ac1f4e2adfd3db623259395757ecae2787cef2 - size: 4277 - version: 0.7.1.3 + sha256: 22e8be5c8128e2f0fb976cb904ac93cefb49e6feef6bcadb7746641be11dcb13 + size: 3054 + version: 0.6.3.4 original: - commit: 11948a65c405f1a99ccb327d328d416e492542a1 + commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66 git: https://github.com/freckle/yesod-auth-oauth2 - completed: commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f