From 26d38f73993db56811d198a3e0b5c710722dd472 Mon Sep 17 00:00:00 2001 From: Julien Tanguy Date: Tue, 14 Apr 2015 17:47:05 +0200 Subject: [PATCH] Disable third party caveats --- README.md | 1 + src/Crypto/Macaroon.hs | 2 +- test/Crypto/Macaroon/Tests.hs | 30 +++++++++++++++--------------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 97fc53e..ea1a1e6 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Implementations TODO ==== +- Third party caveats - Verify Macaroons - Discharge Macaroons - JSON serialization diff --git a/src/Crypto/Macaroon.hs b/src/Crypto/Macaroon.hs index 36aecf9..f955ab8 100644 --- a/src/Crypto/Macaroon.hs +++ b/src/Crypto/Macaroon.hs @@ -41,7 +41,7 @@ module Crypto.Macaroon ( , create , inspect , addFirstPartyCaveat - , addThirdPartyCaveat + -- , addThirdPartyCaveat ) where import Crypto.Cipher.AES diff --git a/test/Crypto/Macaroon/Tests.hs b/test/Crypto/Macaroon/Tests.hs index 6fa6504..244ec50 100644 --- a/test/Crypto/Macaroon/Tests.hs +++ b/test/Crypto/Macaroon/Tests.hs @@ -24,7 +24,7 @@ tests :: TestTree tests = testGroup "Crypto.Macaroon" [ basic , minted , minted2 - , minted3 + -- , minted3 ] @@ -93,20 +93,20 @@ mint2Trimmed = testCase "Serialization" $ mint2Des = testCase "Deserialization" $ Right m3 @=? (deserialize . serialize) m3 -m4 :: Macaroon -m4 = addThirdPartyCaveat caveat_key caveat_id caveat_loc n - where - n = addFirstPartyCaveat "account = 3735928559" $ create sec key loc - key = B8.pack "we used our other secret key" - loc = B8.pack "http://mybank/" - sec = B8.pack "this is a different super-secret key; never use the same secret twice" - caveat_key = B8.pack "4; guaranteed random by a fair toss of the dice" - caveat_id = B8.pack "this was how we remind auth of key/pred" - caveat_loc = B8.pack "http://auth.mybank/" +-- m4 :: Macaroon +-- m4 = addThirdPartyCaveat caveat_key caveat_id caveat_loc n +-- where +-- n = addFirstPartyCaveat "account = 3735928559" $ create sec key loc +-- key = B8.pack "we used our other secret key" +-- loc = B8.pack "http://mybank/" +-- sec = B8.pack "this is a different super-secret key; never use the same secret twice" +-- caveat_key = B8.pack "4; guaranteed random by a fair toss of the dice" +-- caveat_id = B8.pack "this was how we remind auth of key/pred" +-- caveat_loc = B8.pack "http://auth.mybank/" -minted3 :: TestTree -minted3 = testGroup "Macaroon with first and third party caveats" [ mint3sig ] +-- minted3 :: TestTree +-- minted3 = testGroup "Macaroon with first and third party caveats" [ mint3sig ] -mint3sig = testCase "Signature" $ - "6B99EDB2EC6D7A4382071D7D41A0BF7DFA27D87D2F9FEA86E330D7850FFDA2B2" @=? (hex . signature) m4 +-- mint3sig = testCase "Signature" $ +-- "6B99EDB2EC6D7A4382071D7D41A0BF7DFA27D87D2F9FEA86E330D7850FFDA2B2" @=? (hex . signature) m4 -- 2.41.0