diff options
author | Andrew Cady <d@jerkface.net> | 2016-01-20 19:43:11 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-01-20 19:43:11 -0500 |
commit | 7fe2488ce345f261c2d99746788e4037069fe9bb (patch) | |
tree | 46283ee64777a9e18b3c407e16437b2767247d2e | |
parent | 439edb4f1d86df776844495a552fd8656bc4b2f9 (diff) |
minor fix: type sig unifies two functions
-rw-r--r-- | acme.hs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -11,7 +11,7 @@ module Main where | |||
11 | import Control.Lens hiding ((.=)) | 11 | import Control.Lens hiding ((.=)) |
12 | import Control.Monad | 12 | import Control.Monad |
13 | import Crypto.Number.Serialize (i2osp) | 13 | import Crypto.Number.Serialize (i2osp) |
14 | import Data.Aeson (ToJSON (..), encode, object, (.=)) | 14 | import Data.Aeson (ToJSON (..), encode, object, (.=), Value) |
15 | import Data.Aeson.Lens hiding (key) | 15 | import Data.Aeson.Lens hiding (key) |
16 | import qualified Data.Aeson.Lens as JSON | 16 | import qualified Data.Aeson.Lens as JSON |
17 | import Data.ByteString (ByteString) | 17 | import Data.ByteString (ByteString) |
@@ -107,10 +107,12 @@ go (CmdOpts privKeyFile domain challengeDir email termOverride) = do | |||
107 | 107 | ||
108 | r <- challengeRequest domain >>= statusReport | 108 | r <- challengeRequest domain >>= statusReport |
109 | let | 109 | let |
110 | |||
111 | httpChallenge :: (Value -> Const (Endo s) Value) -> Response LC.ByteString -> Const (Endo s) (Response LC.ByteString) | ||
110 | httpChallenge = responseBody . JSON.key "challenges" . to universe . traverse . (filtered . has $ ix "type" . only "http-01") | 112 | httpChallenge = responseBody . JSON.key "challenges" . to universe . traverse . (filtered . has $ ix "type" . only "http-01") |
111 | httpChallenge' = responseBody . JSON.key "challenges" . to universe . traverse . (filtered . has $ ix "type" . only "http-01") | 113 | |
112 | token = r ^?! httpChallenge . JSON.key "token" . _String . to encodeUtf8 | 114 | token = r ^?! httpChallenge . JSON.key "token" . _String . to encodeUtf8 |
113 | crUri = r ^?! httpChallenge' . JSON.key "uri" . _String . to T.unpack | 115 | crUri = r ^?! httpChallenge . JSON.key "uri" . _String . to T.unpack |
114 | thumb = thumbprint (JWK (rsaE pub) "RSA" (rsaN pub)) | 116 | thumb = thumbprint (JWK (rsaE pub) "RSA" (rsaN pub)) |
115 | thumbtoken = toStrict (LB.fromChunks [token, ".", thumb]) | 117 | thumbtoken = toStrict (LB.fromChunks [token, ".", thumb]) |
116 | 118 | ||