saml2-web-sso-0.20: Library and example web app for the SAML Web-based SSO profile.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 Source #

Methods

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

SPStoreIdP SimpleError TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

SPStoreID Assertion TestSP Source # 
Instance details

Defined in SAML2.WebSSO.Test.Util.TestSP

SPStoreID 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 :: (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 :: (MonadIO m, MonadReader (MVar ctx) m) => Lens' ctx (Map (ID a) Time) -> ID a -> m () Source #

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

withapp :: forall (api :: Type). HasServer api '[] => 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.

verbose :: Ctx -> Ctx Source #

Use this to see more output on a per-test basis.

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.