aboutsummaryrefslogblamecommitdiffhomepage
path: root/Crypto-Macaroon-Verifier.html
blob: b58f97c0e82dd78da8b81eddd76c2b4debcfc014 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Crypto.Macaroon.Verifier</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Crypto-Macaroon-Verifier.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hmacaroons-0.5.0.0: Haskell implementation of macaroons</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>(c) 2015 Julien Tanguy</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>julien.tanguy@jhome.fr</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Crypto.Macaroon.Verifier</p></div><div id="description"><p class="caption">Description</p><div class="doc empty">&nbsp;</div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:verify">verify</a> :: (<a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Functor.html#t:Functor">Functor</a> m, <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) =&gt; <a href="Crypto-Macaroon.html#t:Secret">Secret</a> -&gt; [<a href="Crypto-Macaroon.html#t:Caveat">Caveat</a> -&gt; m <a href="Crypto-Macaroon-Verifier.html#t:VerifierResult">VerifierResult</a>] -&gt; <a href="Crypto-Macaroon.html#t:Macaroon">Macaroon</a> -&gt; m (<a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a> <a href="Crypto-Macaroon.html#t:Macaroon">Macaroon</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:VerifierResult">VerifierResult</a><ul class="subs"><li>= <a href="#v:Verified">Verified</a></li><li>| <a href="#v:Refused">Refused</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a></li><li>| <a href="#v:Unrelated">Unrelated</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:ValidationError">ValidationError</a><ul class="subs"><li>= <a href="#v:ParseError">ParseError</a> <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-String.html#t:String">String</a></li><li>| <a href="#v:ValidatorError">ValidatorError</a> <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-String.html#t:String">String</a></li></ul></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:verify" class="def">verify</a> :: (<a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Functor.html#t:Functor">Functor</a> m, <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) =&gt; <a href="Crypto-Macaroon.html#t:Secret">Secret</a> -&gt; [<a href="Crypto-Macaroon.html#t:Caveat">Caveat</a> -&gt; m <a href="Crypto-Macaroon-Verifier.html#t:VerifierResult">VerifierResult</a>] -&gt; <a href="Crypto-Macaroon.html#t:Macaroon">Macaroon</a> -&gt; m (<a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a> <a href="Crypto-Macaroon.html#t:Macaroon">Macaroon</a>)</p><div class="doc"><p>Verify a Macaroon's signature and caveats, given the corresponding Secret
 and verifiers.</p><p>A verifier is a function of type
 <code><code><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a></code> m =&gt; <code><a href="Crypto-Macaroon.html#t:Caveat">Caveat</a></code> -&gt; m VerifierResult</code>.</p><p>It should return:</p><ul><li><code><a href="Crypto-Macaroon-Verifier.html#v:Unrelated">Unrelated</a></code> if the caveat is not related to the verifier
 (for instance a time verifier is given an action caveat);</li><li><code><a href="Crypto-Macaroon-Verifier.html#v:Refused">Refused</a></code> (<code><a href="Crypto-Macaroon-Verifier.html#v:ParseError">ParseError</a></code> reason) if the verifier  is related to the
 caveat, but failed to parse it completely;</li><li><code><a href="Crypto-Macaroon-Verifier.html#v:Refused">Refused</a></code> (<code><a href="Crypto-Macaroon-Verifier.html#v:ValidatorError">ValidatorError</a></code> reason) if the verifier is related to the
 caveat, parsed it and invalidated it;</li><li><code><a href="Crypto-Macaroon-Verifier.html#v:Verified">Verified</a></code> if the verifier has successfully verified the
 given caveat</li></ul></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:VerifierResult" class="def">VerifierResult</a></p><div class="doc"><p>Type representing the result of a validator</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Verified" class="def">Verified</a></td><td class="doc"><p>The caveat is correctly parsed and verified</p></td></tr><tr><td class="src"><a name="v:Refused" class="def">Refused</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a></td><td class="doc"><p>The caveat is refused (Either a parse error or a validation error</p></td></tr><tr><td class="src"><a name="v:Unrelated" class="def">Unrelated</a></td><td class="doc"><p>The given verifier does not verify the caveat</p></td></tr></table></div><div class="subs instances"><p id="control.i:VerifierResult" class="caption collapser" onclick="toggleSection('i:VerifierResult')">Instances</p><div id="section.i:VerifierResult" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Crypto-Macaroon-Verifier.html#t:VerifierResult">VerifierResult</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Text-Show.html#t:Show">Show</a> <a href="Crypto-Macaroon-Verifier.html#t:VerifierResult">VerifierResult</a></span></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ValidationError" class="def">ValidationError</a></p><div class="doc"><p>Type representing different validation errors.
 Only <code><a href="Crypto-Macaroon-Verifier.html#v:ParseError">ParseError</a></code> and <code><a href="Crypto-Macaroon-Verifier.html#v:ValidatorError">ValidatorError</a></code> are exported, <code>SigMismatch</code> and
 <code>NoVerifier</code> are used internally and should not be used by the user</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ParseError" class="def">ParseError</a> <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>A verifier had a parse error</p></td></tr><tr><td class="src"><a name="v:ValidatorError" class="def">ValidatorError</a> <a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>A verifier failed</p></td></tr></table></div><div class="subs instances"><p id="control.i:ValidationError" class="caption collapser" onclick="toggleSection('i:ValidationError')">Instances</p><div id="section.i:ValidationError" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Text-Show.html#t:Show">Show</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Crypto-Macaroon-Verifier.html#t:ValidationError">ValidationError</a></span></td><td class="doc"><p>The <code><a href="file:///opt/ghc/7.10.2/share/doc/ghc/html/libraries/base-4.8.1.0/Data-Monoid.html#t:Monoid">Monoid</a></code> instance is written so <code>SigMismatch</code> is an annihilator,
 and <code>NoVerifier</code> is the identity element</p></td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>