aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Crypto/Macaroon/Verifier.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto/Macaroon/Verifier.hs')
-rw-r--r--src/Crypto/Macaroon/Verifier.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Crypto/Macaroon/Verifier.hs b/src/Crypto/Macaroon/Verifier.hs
index a739437..4fc6aff 100644
--- a/src/Crypto/Macaroon/Verifier.hs
+++ b/src/Crypto/Macaroon/Verifier.hs
@@ -23,11 +23,13 @@ module Crypto.Macaroon.Verifier (
23) where 23) where
24 24
25 25
26import Control.Monad 26import Control.Applicative
27import Control.Monad hiding (forM)
27import Control.Monad.IO.Class 28import Control.Monad.IO.Class
28import Data.Attoparsec.ByteString 29import Data.Attoparsec.ByteString
29import Data.Attoparsec.ByteString.Char8 30import Data.Attoparsec.ByteString.Char8
30import Data.Bool 31import Data.Bool
32import Data.Traversable
31import qualified Data.ByteString as BS 33import qualified Data.ByteString as BS
32import Data.Either.Combinators 34import Data.Either.Combinators
33 35
@@ -68,7 +70,7 @@ import Crypto.Macaroon.Verifier.Internal
68-- caveat, parsed it and invalidated it; 70-- caveat, parsed it and invalidated it;
69-- * 'Just' ('Right' '()') if the verifier has successfully verified the 71-- * 'Just' ('Right' '()') if the verifier has successfully verified the
70-- given caveat 72-- given caveat
71verify :: MonadIO m => Secret -> [Caveat -> m (Maybe (Either ValidationError ()))] -> Macaroon -> m (Either ValidationError Macaroon) 73verify :: (Functor m, MonadIO m) => Secret -> [Caveat -> m (Maybe (Either ValidationError ()))] -> Macaroon -> m (Either ValidationError Macaroon)
72verify secret verifiers m = join <$> forM (verifySig secret m) (verifyCavs verifiers) 74verify secret verifiers m = join <$> forM (verifySig secret m) (verifyCavs verifiers)
73 75
74 76