From 27d5a3a43c7d736f8cd842f14f3178d532de9152 Mon Sep 17 00:00:00 2001 From: Julien Tanguy Date: Mon, 17 Aug 2015 19:39:05 +0200 Subject: Modify exports & haddock --- src/Crypto/Macaroon.hs | 12 +++++++----- src/Crypto/Macaroon/Verifier/Internal.hs | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Crypto/Macaroon.hs b/src/Crypto/Macaroon.hs index c9c8c21..86d8eb7 100644 --- a/src/Crypto/Macaroon.hs +++ b/src/Crypto/Macaroon.hs @@ -43,16 +43,20 @@ module Crypto.Macaroon ( , inspect , addFirstPartyCaveat -- , addThirdPartyCaveat + -- * Serialize + , module Crypto.Macaroon.Serializer.Base64 + -- * Verify + , module Crypto.Macaroon.Verifier ) where -- import Crypto.Cipher.AES import Crypto.Hash import Data.Byteable -import qualified Data.ByteString as BS -import qualified Data.ByteString.Base64.URL as B64 -import qualified Data.ByteString.Char8 as B8 +import qualified Data.ByteString as BS import Crypto.Macaroon.Internal +import Crypto.Macaroon.Serializer.Base64 +import Crypto.Macaroon.Verifier -- | Create a Macaroon from its key, identifier and location create :: Secret -> Key -> Location -> Macaroon @@ -78,5 +82,3 @@ addFirstPartyCaveat ident m = addCaveat (location m) ident BS.empty m -- addThirdPartyCaveat key cid loc m = addCaveat loc cid vid m -- where -- vid = encryptECB (initAES (signature m)) key - - diff --git a/src/Crypto/Macaroon/Verifier/Internal.hs b/src/Crypto/Macaroon/Verifier/Internal.hs index 5126b2e..b3ad7f2 100644 --- a/src/Crypto/Macaroon/Verifier/Internal.hs +++ b/src/Crypto/Macaroon/Verifier/Internal.hs @@ -30,16 +30,16 @@ import Data.Monoid import Crypto.Macaroon.Internal -- | Type representing different validation errors. --- Only 'ParseError' and 'ValidatorError' are exported, 'SigMismatch' and --- 'NoVerifier' are used internally and should not be used by the user +-- Only 'ParseError' and 'ValidatorError' are exported, @SigMismatch@ and +-- @NoVerifier@ are used internally and should not be used by the user data ValidationError = SigMismatch -- ^ Signatures do not match | NoVerifier -- ^ No verifier can handle a given caveat | ParseError String -- ^ A verifier had a parse error | ValidatorError String -- ^ A verifier failed deriving (Show,Eq) --- | The 'Monoid' instance is written so 'SigMismatch' is an annihilator, --- and 'NoVerifier' is the identity element +-- | The 'Monoid' instance is written so @SigMismatch@ is an annihilator, +-- and @NoVerifier@ is the identity element instance Monoid ValidationError where mempty = NoVerifier NoVerifier `mappend` e = e -- cgit v1.2.3