Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TestSP a = TestSP {}
- simpleStoreID :: (MonadIO m, MonadReader (MVar ctx) m) => Lens' ctx (Map (ID a) Time) -> ID a -> Time -> m ()
- simpleUnStoreID :: (MonadIO m, MonadReader (MVar ctx) m) => Lens' ctx (Map (ID a) Time) -> ID a -> m ()
- simpleIsAliveID :: (MonadIO m, MonadReader (MVar ctx) m, SP m) => Lens' ctx (Map (ID a) Time) -> ID a -> m Bool
- readIdPs :: TestSP [IdPConfig_]
- handlerFromTestSP :: CtxV -> TestSP a -> Handler a
- ioFromTestSP :: CtxV -> TestSP a -> IO a
- withapp :: forall (api :: Type). HasServer api '[] => Proxy api -> ServerT api TestSP -> IO CtxV -> SpecWith (CtxV, Application) -> Spec
- capture' :: HasCallStack => IO a -> IO a
- captureApplication :: HasCallStack => Application -> Application
- runtest :: (CtxV -> WaiSession () a) -> (CtxV, Application) -> IO a
- runtest' :: WaiSession () a -> (CtxV, Application) -> IO a
- mkTestCtxSimple :: MonadIO m => m CtxV
- mkTestCtxWithIdP :: MonadIO m => m CtxV
- makeTestIdPConfig :: (MonadIO m, MonadRandom m) => m (IdPConfig (), SampleIdP)
- makeSampleIdPMetadata :: HasCallStack => (MonadIO m, MonadRandom m) => m SampleIdP
- makeIssuer :: MonadIO m => m Issuer
- mkTestSPMetadata :: (Monad m, HasConfig m) => m SPMetadata
- verbose :: Ctx -> Ctx
- timeLongAgo :: Time
- timeInALongTime :: Time
- timeNow :: Time
- timeIn5seconds :: Time
- timeIn10seconds :: Time
- timeIn10minutes :: Time
- timeIn20minutes :: Time
- modifyCtx :: (HasCallStack, MonadIO m, MonadReader CtxV m) => (Ctx -> (Ctx, a)) -> m a
- modifyCtx_ :: (HasCallStack, MonadIO m, MonadReader CtxV m) => (Ctx -> Ctx) -> m ()
- timeTravel :: (HasCallStack, MonadIO m, MonadReader CtxV m) => NominalDiffTime -> m a -> m a
Documentation
FUTUREWORK: we already have SimpleSP
; is there a good reason why we need both types?
Instances
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 #
readIdPs :: TestSP [IdPConfig_] 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 #
runtest' :: WaiSession () a -> (CtxV, Application) -> IO a Source #
mkTestCtxSimple :: MonadIO m => m CtxV Source #
mkTestCtxWithIdP :: MonadIO m => m CtxV Source #
makeTestIdPConfig :: (MonadIO m, MonadRandom m) => m (IdPConfig (), SampleIdP) Source #
construct a hypothetical idp configuration from sample metadata and credentials, without actually registering it.
makeSampleIdPMetadata :: HasCallStack => (MonadIO m, MonadRandom m) => m SampleIdP Source #
makeIssuer :: MonadIO m => m Issuer Source #
mkTestSPMetadata :: (Monad m, HasConfig m) => m SPMetadata Source #
timeLongAgo :: Time Source #
modifyCtx :: (HasCallStack, MonadIO m, MonadReader CtxV m) => (Ctx -> (Ctx, a)) -> m a Source #
modifyCtx_ :: (HasCallStack, MonadIO m, MonadReader CtxV m) => (Ctx -> Ctx) -> m () 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
.