chore: undo nix build changes (use old oauth2 dep checkout)

This commit is contained in:
Sarah Vaupel 2024-06-23 04:32:19 +02:00
parent 71772cc73a
commit 0655889045
8 changed files with 25 additions and 42 deletions

View File

@ -516,7 +516,6 @@
"serversession": "serversession", "serversession": "serversession",
"xss-sanitize": "xss-sanitize", "xss-sanitize": "xss-sanitize",
"yesod": "yesod", "yesod": "yesod",
"yesod-auth-oauth2": "yesod-auth-oauth2",
"zip-stream": "zip-stream" "zip-stream": "zip-stream"
} }
}, },
@ -602,23 +601,6 @@
"url": "https://gitlab.uniworx.de/haskell/yesod.git" "url": "https://gitlab.uniworx.de/haskell/yesod.git"
} }
}, },
"yesod-auth-oauth2": {
"flake": false,
"locked": {
"lastModified": 1717165233,
"narHash": "sha256-j12y/Tjqv6aqQDqjlXElECmormeAgnjZ8WIfnEGZHvU=",
"ref": "ghc-8.10.4",
"rev": "1a67089e5c075ca9474a647bbf26c3354c49036a",
"revCount": 416,
"type": "git",
"url": "https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git"
},
"original": {
"ref": "ghc-8.10.4",
"type": "git",
"url": "https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git"
}
},
"zip-stream": { "zip-stream": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@ -76,10 +76,11 @@
url = "git+https://gitlab.uniworx.de/haskell/yesod.git?ref=uni2work"; url = "git+https://gitlab.uniworx.de/haskell/yesod.git?ref=uni2work";
flake = false; flake = false;
}; };
yesod-auth-oauth2 = { # TODO: does not function due to missing dependencies in snapshot
url = "git+https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git?ref=ghc-8.10.4"; # yesod-auth-oauth2 = {
flake = false; # url = "git+https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git?ref=ghc-8.10.4";
}; # flake = false;
# };
cryptonite = { cryptonite = {
url = "git+https://gitlab.uniworx.de/haskell/cryptonite.git?ref=uni2work"; url = "git+https://gitlab.uniworx.de/haskell/cryptonite.git?ref=uni2work";
flake = false; flake = false;

View File

@ -7,7 +7,7 @@
with prev.lib; with prev.lib;
let let
haskellInputs = ["encoding" "memcached-binary" "conduit-resumablesink" "HaskellNet-SSL" "ldap-client" "serversession" "xss-sanitize" "colonnade" "minio-hs" "cryptoids" "zip-stream" "yesod" "cryptonite" "esqueleto" "yesod-auth-oauth2"]; haskellInputs = ["encoding" "memcached-binary" "conduit-resumablesink" "HaskellNet-SSL" "ldap-client" "serversession" "xss-sanitize" "colonnade" "minio-hs" "cryptoids" "zip-stream" "yesod" "cryptonite" "esqueleto"];
in { in {
uniworx = final.haskell-nix.stackProject { uniworx = final.haskell-nix.stackProject {
src = prev.stdenv.mkDerivation { src = prev.stdenv.mkDerivation {
@ -54,7 +54,6 @@ in {
yesod-form.src = "${inputs.yesod}/yesod-form"; yesod-form.src = "${inputs.yesod}/yesod-form";
yesod-auth.src = "${inputs.yesod}/yesod-auth"; yesod-auth.src = "${inputs.yesod}/yesod-auth";
yesod-test.src = "${inputs.yesod}/yesod-test"; yesod-test.src = "${inputs.yesod}/yesod-test";
yesod-auth-oauth2.src = inputs.yesod-auth-oauth2;
cryptonite.src = inputs.cryptonite; cryptonite.src = inputs.cryptonite;
esqueleto.src = inputs.esqueleto; esqueleto.src = inputs.esqueleto;
}; };

View File

@ -101,7 +101,7 @@ import UnliftIO.Pool
import qualified Web.ServerSession.Backend.Acid as Acid import qualified Web.ServerSession.Backend.Acid as Acid
import Web.ServerSession.Core (StorageException(..)) import Web.ServerSession.Core (StorageException(..))
import Yesod.Auth.OAuth2.AzureADv2 (oauth2AzureADv2Scoped) import Yesod.Auth.OAuth2.AzureAD (oauth2AzureADScoped)
import Yesod.Auth.Util.PasswordStore import Yesod.Auth.Util.PasswordStore
import qualified Yesod.Core.Types as Yesod (Logger(..)) import qualified Yesod.Core.Types as Yesod (Logger(..))
@ -328,7 +328,7 @@ makeFoundation appSettings''@AppSettings{..} = do
#ifdef DEVELOPMENT #ifdef DEVELOPMENT
oauth2Plugins <- liftIO $ sequence oauth2Plugins <- liftIO $ sequence
[ (azureMockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT" [ (azureMockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT"
, return $ oauth2AzureADv2Scoped ["openid", "profile", "offline_access"] "42" "42" "shhh" , return $ oauth2AzureADScoped ["openid", "profile", "offline_access"] "42" "shhh"
] ]
#else #else
-- let -- Auth Plugins -- let -- Auth Plugins
@ -346,7 +346,7 @@ makeFoundation appSettings''@AppSettings{..} = do
oauth2Plugins <- if oauth2Plugins <- if
| UserAuthConfSingleSource (AuthSourceConfAzureAdV2 AzureConf{..}) <- appUserAuthConf -> do | UserAuthConfSingleSource (AuthSourceConfAzureAdV2 AzureConf{..}) <- appUserAuthConf -> do
$logInfoS "OAuth2" "Successfully parsed OAuth2 config from AppSettings" $logInfoS "OAuth2" "Successfully parsed OAuth2 config from AppSettings"
return . singleton $ oauth2AzureADv2Scoped (Set.toList azureConfScopes) (tshow azureConfClientId) azureConfClientSecret return . singleton $ oauth2AzureADScoped (Set.toList azureConfScopes) (tshow azureConfClientId) azureConfClientSecret
| otherwise -> do | otherwise -> do
when appSingleSignOn $ do when appSingleSignOn $ do
$logErrorS "OAuth2" "SingleSignOn via AzureADv2 is enabled, but user-auth config could not be parsed!" $logErrorS "OAuth2" "SingleSignOn via AzureADv2 is enabled, but user-auth config could not be parsed!"

View File

@ -122,15 +122,15 @@ instance FromJSON UserID where
azureMockServer :: YesodAuth m => String -> AuthPlugin m azureMockServer :: YesodAuth m => String -> AuthPlugin m
azureMockServer port = azureMockServer port =
let oa = OAuth2 let oa = OAuth2
{ oauth2ClientId = "42" { oauthClientId = "42"
, oauth2ClientSecret = Just "shhh" , oauthClientSecret = Just "shhh"
, oauth2AuthorizeEndpoint = fromString (mockServerURL <> "/auth") , oauthOAuthorizeEndpoint = fromString (mockServerURL <> "/auth")
`withQuery` [ scopeParam " " ["openid", "profile", "email", "offline_access"] -- TODO read scopes from config `withQuery` [ scopeParam " " ["openid", "profile", "email", "offline_access"] -- TODO read scopes from config
, ("response_type", "code id_token") , ("response_type", "code id_token")
, ("nonce", "Foo") -- TODO generate meaningful value , ("nonce", "Foo") -- TODO generate meaningful value
] ]
, oauth2TokenEndpoint = fromString $ mockServerURL <> "/token" , oauthAccessTokenEndpoint = fromString $ mockServerURL <> "/token"
, oauth2RedirectUri = Nothing -- TODO use approot as redirect uri? , oauthCallback = Nothing -- TODO use approot as redirect uri?
} }
mockServerURL = "http://localhost:" <> fromString port mockServerURL = "http://localhost:" <> fromString port
profileSrc = fromString $ mockServerURL <> "/users/me" profileSrc = fromString $ mockServerURL <> "/users/me"

View File

@ -45,7 +45,6 @@ extra-deps:
- @yesod@/yesod-auth - @yesod@/yesod-auth
- @yesod@/yesod-test - @yesod@/yesod-test
- @yesod@/yesod - @yesod@/yesod
- @yesod-auth-oauth2@
- @cryptonite@ - @cryptonite@
- @esqueleto@ - @esqueleto@
@ -56,6 +55,8 @@ extra-deps:
subdirs: subdirs:
- gearhash - gearhash
- fastcdc - fastcdc
- git: https://github.com/freckle/yesod-auth-oauth2.git
commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66
- classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330 - classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330
- acid-state-0.16.0.1@sha256:d43f6ee0b23338758156c500290c4405d769abefeb98e9bc112780dae09ece6f,6207 - acid-state-0.16.0.1@sha256:d43f6ee0b23338758156c500290c4405d769abefeb98e9bc112780dae09ece6f,6207

View File

@ -88,8 +88,8 @@ extra-deps:
- yesod-eventsource - yesod-eventsource
- yesod-websockets - yesod-websockets
- git: https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git - git: https://github.com/freckle/yesod-auth-oauth2
commit: da676b530887306b645d0170f82e7dd0611d9601 commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66
- git: https://gitlab.uniworx.de/haskell/cryptonite.git - git: https://gitlab.uniworx.de/haskell/cryptonite.git
commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f

View File

@ -416,16 +416,16 @@ packages:
git: https://gitlab.uniworx.de/haskell/yesod.git git: https://gitlab.uniworx.de/haskell/yesod.git
subdir: yesod-websockets subdir: yesod-websockets
- completed: - completed:
commit: da676b530887306b645d0170f82e7dd0611d9601 commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66
git: https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git git: https://github.com/freckle/yesod-auth-oauth2
name: yesod-auth-oauth2 name: yesod-auth-oauth2
pantry-tree: pantry-tree:
sha256: cac5ec87651ea76e9052742b0a05598f7133ce405a8052c813c81741b3b2d667 sha256: 22e8be5c8128e2f0fb976cb904ac93cefb49e6feef6bcadb7746641be11dcb13
size: 4652 size: 3054
version: 0.7.3.0 version: 0.6.3.4
original: original:
commit: da676b530887306b645d0170f82e7dd0611d9601 commit: 342dac80e40b10f07694a7e9aa8bab6d03ed6d66
git: https://gitlab.uniworx.de/haskell/yesod-auth-oauth2.git git: https://github.com/freckle/yesod-auth-oauth2
- completed: - completed:
commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f commit: 71a630edaf5f22c464e24fac8d9d310f4055ea1f
git: https://gitlab.uniworx.de/haskell/cryptonite.git git: https://gitlab.uniworx.de/haskell/cryptonite.git