saml2-web-sso-0.20: Library and example web app for the SAML Web-based SSO profile.
Safe HaskellNone
LanguageGHC2021

SAML2.WebSSO.Test.Util.TestSP

Synopsis

Documentation

newtype TestSP a Source #

FUTUREWORK: we already have SimpleSP; is there a good reason why we need both types?

Constructors

TestSP 

Instances

Instances details
MonadIO TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

liftIO :: IO a -> TestSP a #

Applicative TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

pure :: a -> TestSP a #

(<*>) :: TestSP (a -> b) -> TestSP a -> TestSP b #

liftA2 :: (a -> b -> c) -> TestSP a -> TestSP b -> TestSP c #

(*>) :: TestSP a -> TestSP b -> TestSP b #

(<*) :: TestSP a -> TestSP b -> TestSP a #

Functor TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

fmap :: (a -> b) -> TestSP a -> TestSP b #

(<$) :: a -> TestSP b -> TestSP a #

Monad TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

(>>=) :: TestSP a -> (a -> TestSP b) -> TestSP b #

(>>) :: TestSP a -> TestSP b -> TestSP b #

return :: a -> TestSP a #

HasConfig TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

HasCreateUUID TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

HasLogger TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

logger :: Level -> String -> TestSP () Source #

HasNow TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

MonadError SimpleError TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

MonadReader CtxV TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

ask :: TestSP CtxV #

local :: (CtxV -> CtxV) -> TestSP a -> TestSP a #

reader :: (CtxV -> a) -> TestSP a #

GetAllIdPs SimpleError TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

SPHandler SimpleError TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Associated Types

type NTCTX TestSP 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Methods

nt :: NTCTX TestSP -> TestSP x -> Handler x Source #

SPStoreIdP SimpleError TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

Associated Types

type IdPConfigExtra TestSP 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

type IdPConfigSPId TestSP 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

SPStoreAssertion Assertion TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

SPStoreRequest AuthnRequest TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

type IdPConfigExtra TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

type IdPConfigSPId TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

type NTCTX TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

simpleStoreID :: forall {k} m ctx (a :: k). (MonadIO m, MonadReader (MVar ctx) m) => Lens' ctx (Map (ID a) Time) -> ID a -> Time -> m () Source #

These helpers are very similar to the ones in SAML2.WebSSO.API.Example. Exercise to the reader: implement only once, use twice. (Some hints: None of the "lens through IORefMVaretc" libraries took off. There's http://hackage.haskell.org/package/monad-var but I haven't looked at it. You might also want to read ekmett's comments at https://www.reddit.com/r/haskell/comments/8gc8p0/extensible_monadic_lenses/. Don't ask me about monadic lenses though, I'm really clueless.)

simpleUnStoreID :: forall {k} m ctx (a :: k). (MonadIO m, MonadReader (MVar ctx) m) => Lens' ctx (Map (ID a) Time) -> ID a -> m () Source #

simpleIsAliveID :: forall {k} m ctx (a :: k). (MonadIO m, MonadReader (MVar ctx) m, SP m) => Lens' ctx (Map (ID a) Time) -> ID a -> m Bool Source #

withapp :: HasServer api ('[] :: [Type]) => Proxy api -> ServerT api TestSP -> IO CtxV -> SpecWith (CtxV, Application) -> Spec Source #

runtest :: (CtxV -> WaiSession () a) -> (CtxV, Application) -> IO a Source #

makeTestIdPConfig :: (MonadIO m, MonadRandom m) => m (IdPConfig (), SampleIdP) Source #

construct a hypothetical idp configuration from sample metadata and credentials, without actually registering it.

modifyCtx :: (HasCallStack, MonadIO m, MonadReader CtxV m) => (Ctx -> (Ctx, a)) -> m a Source #

timeTravel :: (HasCallStack, MonadIO m, MonadReader CtxV m) => NominalDiffTime -> m a -> m a Source #

Run an action at a time specified relative to now. This does NOT support hspec's parallel.