Skip to content

Commit d36a79e

Browse files
committed
Weird rebase problem
1 parent fde7d6e commit d36a79e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

services/spar/src/Spar/Scim.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ import qualified SAML2.WebSSO as SAML
7373
import Servant
7474
import Servant.API.Generic
7575
import Servant.Server.Generic (AsServerT)
76-
import Spar.App (Spar (..), runSparInSem, throwSparSem)
76+
import Spar.App (sparToServerErrorWithLogging, throwSparSem)
7777
import Spar.Error
7878
( SparCustomError (SparScimError),
7979
SparError,
80-
sparToServerErrorWithLogging,
8180
)
8281
import Spar.Scim.Auth
8382
import Spar.Scim.User
@@ -87,6 +86,7 @@ import qualified Spar.Sem.IdP as IdPEffect
8786
import Spar.Sem.Logger (Logger)
8887
import Spar.Sem.Now (Now)
8988
import Spar.Sem.Random (Random)
89+
import Spar.Sem.Reporter (Reporter)
9090
import Spar.Sem.SAMLUserStore (SAMLUserStore)
9191
import Spar.Sem.ScimExternalIdStore (ScimExternalIdStore)
9292
import Spar.Sem.ScimTokenStore (ScimTokenStore)
@@ -124,13 +124,14 @@ apiScim ::
124124
ScimExternalIdStore,
125125
ScimUserTimesStore,
126126
ScimTokenStore,
127+
Reporter,
127128
IdPEffect.IdP,
128129
-- TODO(sandy): Only necessary for 'fromExceptionSem'. But can these errors even happen?
129130
Final IO,
130131
SAMLUserStore
131132
]
132133
r =>
133-
ServerT APIScim (Spar r)
134+
ServerT APIScim (Sem r)
134135
apiScim =
135136
hoistScim (toServant (server configuration))
136137
:<|> apiScimToken
@@ -146,10 +147,10 @@ apiScim =
146147
-- Let's hope that SCIM clients can handle non-SCIM-formatted errors
147148
-- properly. See <https://github.com/haskell-servant/servant/issues/1022>
148149
-- for why it's hard to catch impure exceptions.
149-
wrapScimErrors :: Spar r a -> Spar r a
150-
wrapScimErrors act = Spar $ do
150+
wrapScimErrors :: Sem r a -> Sem r a
151+
wrapScimErrors act = do
151152
result :: Either SomeException (Either SparError a) <-
152-
runError $ fromExceptionSem @SomeException $ raise $ try @SparError $ runSparInSem act
153+
runError $ fromExceptionSem @SomeException $ raise $ try @SparError act
153154
case result of
154155
Left someException -> do
155156
-- We caught an exception that's not a Spar exception at all. It is wrapped into
@@ -162,7 +163,7 @@ apiScim =
162163
Right (Left sparError) -> do
163164
-- We caught some other Spar exception. It is rendered and wrapped into a scim error
164165
-- with the same status and message, and no scim error type.
165-
err :: ServerError <- undefined -- embedFinal @IO $ sparToServerErrorWithLogging undefined sparError
166+
err :: ServerError <- sparToServerErrorWithLogging sparError
166167
throw . SAML.CustomError . SparScimError $
167168
Scim.ScimError
168169
{ schemas = [Scim.Schema.Error20],

0 commit comments

Comments
 (0)