mig-extra-0.1.1.0: Extra utils for Mig core library
Safe HaskellSafe-Inferred
LanguageGHC2021

Mig.Extra.Plugin.Auth

Description

Plugin to handle authorization. Just a sketch for now.

Synopsis

Documentation

data WithAuth m token resp Source #

Authorization plugin interface

Constructors

WithAuth 

Fields

  • isValid :: token -> m Bool

    check that token is valid

  • authFail :: token -> m resp

    how to respond on failure

withHeaderAuth :: forall m token resp. (IsResp resp, MonadIO m) => WithAuth m token resp -> Header "auth" token -> Plugin m Source #

Creates plugin that applies check of auth credentials which are passed as HTTP Header with name auth.