]> git.immae.eu Git - github/fretlink/hmacaroons.git/blob - test/Crypto/Macaroon/Verifier/Tests.hs
Merge branch 'verification'
[github/fretlink/hmacaroons.git] / test / Crypto / Macaroon / Verifier / Tests.hs
1 {-# LANGUAGE OverloadedStrings #-}
2 {-|
3 Copyright : (c) 2015 Julien Tanguy
4 License : BSD3
5
6 Maintainer : julien.tanguy@jhome.fr
7
8
9 This test suite is based on the pymacaroons test suite:
10 <https://github.com/ecordell/pymacaroons>
11 -}
12 module Crypto.Macaroon.Verifier.Tests where
13
14
15 import qualified Data.ByteString.Char8 as B8
16 import Data.Either
17 import Data.List
18 import Test.Tasty
19 import Test.Tasty.HUnit
20 import Test.Tasty.QuickCheck
21
22 import Crypto.Macaroon
23 import Crypto.Macaroon.Verifier
24
25 import Crypto.Macaroon.Instances
26
27 tests :: TestTree
28 tests = testGroup "Crypto.Macaroon.Verifier" [ ]
29
30 {-
31 - Test fixtures
32 -}
33 sec = B8.pack "this is our super secret key; only we should know it"
34
35 m :: Macaroon
36 m = create sec key loc
37 where
38 key = B8.pack "we used our sec key"
39 loc = B8.pack "http://mybank/"
40
41 m2 :: Macaroon
42 m2 = addFirstPartyCaveat "test = caveat" m
43
44 m3 :: Macaroon
45 m3 = addFirstPartyCaveat "value = 42" m2
46
47 {-
48 - Tests
49 -}
50
51 -- TODO