summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlarsk <>2016-09-16 23:31:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-09-16 23:31:00 (GMT)
commit42f92244d035582024496ec12be0f16bf43e904b (patch)
tree10582973e51e1d8b9c2b48c0cca42bcf5718d979
parent122bcf6d7cd92bfbdbb1fd327021d422bda3c133 (diff)
version 0.2.150.2.15
-rw-r--r--CHANGELOG.md5
-rw-r--r--README.md19
-rw-r--r--configuration-tools.cabal6
-rw-r--r--constraints166
-rw-r--r--constraints-ghc-8.0.194
-rw-r--r--constraints.old-transformers108
-rw-r--r--src/Configuration/Utils/Internal/HttpsCertPolicy.hs27
7 files changed, 120 insertions, 305 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 91582c1..62b2ff9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+0.2.15
+======
+
+* Support for http-client >= 0.5
+
0.2.14
======
diff --git a/README.md b/README.md
index f4fc45b..29dc094 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/alephcloud/hs-configuration-tools.svg?branch=master)](https://travis-ci.org/alephcloud/hs-configuration-tools)
+[![Hackage](https://img.shields.io/hackage/v/configuration-tools.svg)](https://hackage.haskell.org/package/configuration-tools)
Overview
========
@@ -11,12 +12,13 @@ applications in a composable way.
The main features are
-1. configuration management through integration of command line option
- parsing and configuration files,
-2. a `Setup.hs` file that generates a `PkgInfo` module for each component
- of a package that provide information about the package and the build, and
-3. a set of types for configuration of HTTP services and clients along
- with aeson instances and command line option parsers.
+1. compositional configuration management with integration of command line
+ option parsing and configuration files, validation of configurations,
+ and loading of configurations from remote locations,
+2. a `Setup.hs` file that generates a `PkgInfo` module for each component
+ of a package that provide information about the package and the build, and
+3. a set of types for configuration of HTTP services and clients along
+ with aeson instances and command line option parsers.
The ultimate goal for this package is a general framework for
compositional configuration management for software components.
@@ -59,6 +61,11 @@ cabal build
cabal test
```
+If you have issues building this package, first ensure that the installed
+version of the `Cabal` library matches the version that is used by
+your `cabal` binary. You may compare the results of `cabal info Cabal` and
+`cabal --version`.
+
Configuration Management
========================
diff --git a/configuration-tools.cabal b/configuration-tools.cabal
index 767409e..c4170b0 100644
--- a/configuration-tools.cabal
+++ b/configuration-tools.cabal
@@ -4,7 +4,7 @@
-- ------------------------------------------------------ --
Name: configuration-tools
-Version: 0.2.14
+Version: 0.2.15
Synopsis: Tools for specifying and parsing configurations
description:
Tools for specifying and parsing configurations
@@ -49,8 +49,6 @@ extra-doc-files:
extra-source-files:
constraints
- constraints.old-transformers
- constraints-ghc-8.0.1
source-repository head
type: git
@@ -60,7 +58,7 @@ source-repository head
source-repository this
type: git
location: https://github.com/alephcloud/hs-configuration-tools.git
- tag: 0.2.14
+ tag: 0.2.15
flag remote-configs
Description: enable loading of configuration files from HTTP URLs
diff --git a/constraints b/constraints
index 2b9699c..2bcf6ef 100644
--- a/constraints
+++ b/constraints
@@ -1,100 +1,94 @@
-constraints: Cabal ==1.22.3.0,
- StateVar ==1.1.0.0,
- aeson ==0.9.0.1,
- ansi-terminal ==0.6.2.1,
- ansi-wl-pprint ==0.6.7.2,
+constraints: Cabal ==1.23.1.0,
array ==0.5.1.0,
- asn1-encoding ==0.9.0,
- asn1-parse ==0.9.1,
- asn1-types ==0.3.0,
- async ==2.0.2,
- attoparsec ==0.13.0.0,
- base ==4.8.0.0,
+ base ==4.9.0.0,
+ ghc-prim ==0.5.0.0,
+ rts ==1.0,
+ integer-gmp ==1.0.0.1,
+ binary ==0.8.2.0,
+ bytestring ==0.10.7.0,
+ deepseq ==1.4.2.0,
+ containers ==0.5.7.1,
+ directory ==1.2.5.0,
+ filepath ==1.4.1.0,
+ time ==1.6,
+ unix ==2.7.2.0,
+ pretty ==1.1.3.2,
+ process ==1.4.2.0,
+ aeson ==0.11.0.0,
+ attoparsec ==0.13.0.1,
+ scientific ==0.3.4.4,
+ hashable ==1.2.4.0,
+ text ==1.2.2.0,
+ vector ==0.11.0.0,
+ primitive ==0.6.1.0,
+ transformers ==0.5.1.0,
+ dlist ==0.7.1.2,
+ fail ==4.9.0.0,
+ mtl ==2.2.1,
+ syb ==0.6,
+ template-haskell ==2.11.0.0,
+ ghc-boot ==8.0.0.20160204,
+ unordered-containers ==0.2.6.0,
+ ansi-wl-pprint ==0.6.7.3,
+ ansi-terminal ==0.6.2.3,
base-unicode-symbols ==0.2.2.4,
base64-bytestring ==1.0.0.1,
- binary ==0.7.3.0,
- blaze-builder ==0.4.0.1,
+ case-insensitive ==1.2.0.5,
+ connection ==0.2.5,
byteable ==0.1.1,
- bytestring ==0.10.6.0,
- case-insensitive ==1.2.0.4,
- cereal ==0.4.1.1,
- cipher-aes ==0.2.10,
- cipher-des ==0.0.6,
- cipher-rc4 ==0.1.4,
- comonad ==4.2.6,
- conduit ==1.2.4.2,
- connection ==0.2.4,
- containers ==0.5.6.2,
- contravariant ==1.3.1.1,
- cookie ==0.4.1.5,
- crypto-cipher-types ==0.0.9,
- crypto-numbers ==0.2.7,
- crypto-pubkey ==0.2.8,
- crypto-pubkey-types ==0.4.3,
- crypto-random ==0.0.9,
- cryptohash ==0.11.6,
- data-default ==0.5.3,
data-default-class ==0.0.1,
+ network ==2.6.2.1,
+ socks ==0.5.4,
+ cereal ==0.5.1.0,
+ tls ==1.3.4,
+ asn1-encoding ==0.9.3,
+ asn1-types ==0.3.2,
+ hourglass ==0.2.9,
+ memory ==0.11,
+ async ==2.1.0,
+ stm ==2.4.4.1,
+ cryptonite ==0.11,
+ x509 ==1.6.3,
+ asn1-parse ==0.9.4,
+ pem ==0.2.2,
+ x509-store ==1.6.1,
+ x509-validation ==1.6.3,
+ x509-system ==1.6.3,
+ data-default ==0.5.3,
data-default-instances-base ==0.0.1,
data-default-instances-containers ==0.0.1,
data-default-instances-dlist ==0.0.1,
data-default-instances-old-locale ==0.0.1,
- deepseq ==1.4.1.1,
- directory ==1.2.2.0,
- distributive ==0.4.4,
- dlist ==0.7.1.1,
+ old-locale ==1.0.0.7,
enclosed-exceptions ==1.0.1.1,
- exceptions ==0.8.0.2,
- filepath ==1.4.0.0,
- ghc-prim ==0.4.0.0,
- hashable ==1.2.3.2,
- hourglass ==0.2.9,
- http-client ==0.4.11.2,
- http-client-tls ==0.2.2,
- http-types ==0.8.6,
- integer-gmp ==1.0.0.0,
lifted-base ==0.2.3.6,
- memory ==0.6,
+ monad-control ==1.0.0.5,
+ transformers-base ==0.4.4,
+ transformers-compat ==0.5.1.4,
+ http-client ==0.4.27,
+ blaze-builder ==0.4.0.1,
+ cookie ==0.4.1.6,
+ exceptions ==0.8.2.1,
+ http-types ==0.9,
mime-types ==0.1.0.6,
- mmorph ==1.0.4,
- monad-control ==1.0.0.4,
- mtl ==2.2.1,
- nats ==1,
- network ==2.6.1.0,
network-uri ==2.6.0.3,
- old-locale ==1.0.0.7,
- optparse-applicative ==0.11.0.2,
parsec ==3.1.9,
- pem ==0.2.2,
- pretty ==1.1.2.0,
- primitive ==0.6,
- process ==1.2.3.0,
- profunctors ==5.1.1,
- random ==1.1,
- resourcet ==1.1.5,
- rts ==1.0,
- scientific ==0.3.3.8,
- securemem ==0.1.8,
- semigroups ==0.16.2.2,
- socks ==0.5.4,
- stm ==2.4.4,
- streaming-commons ==0.1.12.1,
- syb ==0.5.1,
- tagged ==0.8.0.1,
- template-haskell ==2.10.0.0,
- text ==1.2.1.0,
- time ==1.5.0.1,
- tls ==1.2.17,
- transformers ==0.4.2.0,
- transformers-base ==0.4.4,
- transformers-compat ==0.4.0.4,
- unix ==2.7.1.0,
- unordered-containers ==0.2.5.1,
- vector ==0.10.12.3,
- void ==0.7,
- x509 ==1.5.1,
- x509-store ==1.5.0,
- x509-system ==1.5.0,
- x509-validation ==1.5.2,
- yaml ==0.8.11,
- zlib ==0.5.4.2
+ random ==1.0.1.1,
+ streaming-commons ==0.1.15.1,
+ zlib ==0.6.1.1,
+ http-client-tls ==0.2.2,
+ optparse-applicative ==0.12.1.0,
+ profunctors ==5.2,
+ base-orphans ==0.5.1,
+ bifunctors ==5.2.1,
+ comonad ==5,
+ contravariant ==1.4,
+ StateVar ==1.1.0.3,
+ semigroups ==0.18.1,
+ void ==0.7.1,
+ distributive ==0.5.0.2,
+ tagged ==0.8.3,
+ yaml ==0.8.16,
+ conduit ==1.2.6.2,
+ mmorph ==1.0.6,
+ resourcet ==1.1.7.2
diff --git a/constraints-ghc-8.0.1 b/constraints-ghc-8.0.1
deleted file mode 100644
index 2bcf6ef..0000000
--- a/constraints-ghc-8.0.1
+++ /dev/null
@@ -1,94 +0,0 @@
-constraints: Cabal ==1.23.1.0,
- array ==0.5.1.0,
- base ==4.9.0.0,
- ghc-prim ==0.5.0.0,
- rts ==1.0,
- integer-gmp ==1.0.0.1,
- binary ==0.8.2.0,
- bytestring ==0.10.7.0,
- deepseq ==1.4.2.0,
- containers ==0.5.7.1,
- directory ==1.2.5.0,
- filepath ==1.4.1.0,
- time ==1.6,
- unix ==2.7.2.0,
- pretty ==1.1.3.2,
- process ==1.4.2.0,
- aeson ==0.11.0.0,
- attoparsec ==0.13.0.1,
- scientific ==0.3.4.4,
- hashable ==1.2.4.0,
- text ==1.2.2.0,
- vector ==0.11.0.0,
- primitive ==0.6.1.0,
- transformers ==0.5.1.0,
- dlist ==0.7.1.2,
- fail ==4.9.0.0,
- mtl ==2.2.1,
- syb ==0.6,
- template-haskell ==2.11.0.0,
- ghc-boot ==8.0.0.20160204,
- unordered-containers ==0.2.6.0,
- ansi-wl-pprint ==0.6.7.3,
- ansi-terminal ==0.6.2.3,
- base-unicode-symbols ==0.2.2.4,
- base64-bytestring ==1.0.0.1,
- case-insensitive ==1.2.0.5,
- connection ==0.2.5,
- byteable ==0.1.1,
- data-default-class ==0.0.1,
- network ==2.6.2.1,
- socks ==0.5.4,
- cereal ==0.5.1.0,
- tls ==1.3.4,
- asn1-encoding ==0.9.3,
- asn1-types ==0.3.2,
- hourglass ==0.2.9,
- memory ==0.11,
- async ==2.1.0,
- stm ==2.4.4.1,
- cryptonite ==0.11,
- x509 ==1.6.3,
- asn1-parse ==0.9.4,
- pem ==0.2.2,
- x509-store ==1.6.1,
- x509-validation ==1.6.3,
- x509-system ==1.6.3,
- data-default ==0.5.3,
- data-default-instances-base ==0.0.1,
- data-default-instances-containers ==0.0.1,
- data-default-instances-dlist ==0.0.1,
- data-default-instances-old-locale ==0.0.1,
- old-locale ==1.0.0.7,
- enclosed-exceptions ==1.0.1.1,
- lifted-base ==0.2.3.6,
- monad-control ==1.0.0.5,
- transformers-base ==0.4.4,
- transformers-compat ==0.5.1.4,
- http-client ==0.4.27,
- blaze-builder ==0.4.0.1,
- cookie ==0.4.1.6,
- exceptions ==0.8.2.1,
- http-types ==0.9,
- mime-types ==0.1.0.6,
- network-uri ==2.6.0.3,
- parsec ==3.1.9,
- random ==1.0.1.1,
- streaming-commons ==0.1.15.1,
- zlib ==0.6.1.1,
- http-client-tls ==0.2.2,
- optparse-applicative ==0.12.1.0,
- profunctors ==5.2,
- base-orphans ==0.5.1,
- bifunctors ==5.2.1,
- comonad ==5,
- contravariant ==1.4,
- StateVar ==1.1.0.3,
- semigroups ==0.18.1,
- void ==0.7.1,
- distributive ==0.5.0.2,
- tagged ==0.8.3,
- yaml ==0.8.16,
- conduit ==1.2.6.2,
- mmorph ==1.0.6,
- resourcet ==1.1.7.2
diff --git a/constraints.old-transformers b/constraints.old-transformers
deleted file mode 100644
index 7b738e4..0000000
--- a/constraints.old-transformers
+++ /dev/null
@@ -1,108 +0,0 @@
-constraints: Cabal ==1.18.1.3,
- MonadRandom ==0.3.0.1,
- aeson ==0.8.0.2,
- ansi-terminal ==0.6.2.1,
- ansi-wl-pprint ==0.6.7.1,
- array ==0.5.0.0,
- asn1-encoding ==0.9.0,
- asn1-parse ==0.9.0,
- asn1-types ==0.3.0,
- async ==2.0.2,
- attoparsec ==0.12.1.2,
- base ==4.7.0.1,
- base-unicode-symbols ==0.2.2.4,
- base64-bytestring ==1.0.0.1,
- bifunctors ==4.2,
- blaze-builder ==0.3.3.4,
- byteable ==0.1.1,
- bytestring ==0.10.4.0,
- case-insensitive ==1.2.0.4,
- cereal ==0.4.1.1,
- cipher-aes ==0.2.10,
- cipher-des ==0.0.6,
- cipher-rc4 ==0.1.4,
- comonad ==4.2.2,
- conduit ==1.2.3.1,
- connection ==0.2.4,
- containers ==0.5.5.1,
- contravariant ==1.2.0.1,
- cookie ==0.4.1.4,
- crypto-cipher-types ==0.0.9,
- crypto-numbers ==0.2.7,
- crypto-pubkey ==0.2.8,
- crypto-pubkey-types ==0.4.3,
- crypto-random ==0.0.8,
- cryptohash ==0.11.6,
- data-default ==0.5.3,
- data-default-class ==0.0.1,
- data-default-instances-base ==0.0.1,
- data-default-instances-containers ==0.0.1,
- data-default-instances-dlist ==0.0.1,
- data-default-instances-old-locale ==0.0.1,
- deepseq ==1.3.0.2,
- directory ==1.2.1.0,
- distributive ==0.4.4,
- dlist ==0.7.1,
- either ==4.3.3.2,
- enclosed-exceptions ==1.0.1,
- errors ==1.4.7,
- exceptions ==0.8,
- filepath ==1.3.0.2,
- free ==4.10.0.1,
- ghc-prim ==0.3.1.0,
- hashable ==1.2.3.1,
- hourglass ==0.2.8,
- http-client ==0.4.7.1,
- http-client-tls ==0.2.2,
- http-types ==0.8.6,
- integer-gmp ==0.5.1.0,
- lifted-base ==0.2.3.6,
- mime-types ==0.1.0.5,
- mmorph ==1.0.4,
- monad-control ==1.0.0.4,
- mtl ==2.1.3.1,
- mtl-compat ==0.1.1,
- nats ==1,
- network ==2.6.0.2,
- network-uri ==2.6.0.1,
- old-locale ==1.0.0.6,
- optparse-applicative ==0.11.0.1,
- parsec ==3.1.8,
- pem ==0.2.2,
- prelude-extras ==0.4,
- pretty ==1.1.1.1,
- primitive ==0.5.4.0,
- process ==1.2.0.0,
- profunctors ==4.3.2,
- publicsuffixlist ==0.1,
- random ==1.1,
- resourcet ==1.1.4,
- rts ==1.0,
- safe ==0.3.8,
- scientific ==0.3.3.7,
- securemem ==0.1.7,
- semigroupoids ==4.3,
- semigroups ==0.16.1,
- socks ==0.5.4,
- stm ==2.4.4,
- streaming-commons ==0.1.9.1,
- syb ==0.4.4,
- tagged ==0.7.3,
- template-haskell ==2.9.0.0,
- text ==1.2.0.4,
- time ==1.4.2,
- tls ==1.2.16,
- transformers ==0.3.0.0,
- transformers-base ==0.4.4,
- transformers-compat ==0.3.3.3,
- unix ==2.7.0.1,
- unordered-containers ==0.2.5.1,
- utf8-string ==1,
- vector ==0.10.12.2,
- void ==0.7,
- x509 ==1.5.0.1,
- x509-store ==1.5.0,
- x509-system ==1.5.0,
- x509-validation ==1.5.1,
- yaml ==0.8.10.1,
- zlib ==0.5.4.2
diff --git a/src/Configuration/Utils/Internal/HttpsCertPolicy.hs b/src/Configuration/Utils/Internal/HttpsCertPolicy.hs
index 644cee5..1dc6ce1 100644
--- a/src/Configuration/Utils/Internal/HttpsCertPolicy.hs
+++ b/src/Configuration/Utils/Internal/HttpsCertPolicy.hs
@@ -1,9 +1,14 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
+#ifndef MIN_VERSION_http_client
+#define MIN_VERSION_http_client(x,y,z) 1
+#endif
+
-- |
-- Module: Configuration.Utils.Internal.HttpsCertPolicy
-- Description: HTTPS certificate validation policy
@@ -36,6 +41,7 @@ import Configuration.Utils.Monoid
import Configuration.Utils.Operators
import Configuration.Utils.Validation
+import Control.Exception (catches, Handler(..))
import Control.Monad.Writer hiding (mapM_)
import qualified Data.ByteString.Char8 as B8
@@ -148,13 +154,20 @@ httpWithValidationPolicy
httpWithValidationPolicy request policy = do
certVar ← newIORef Nothing
settings ← getSettings policy certVar
- HTTP.withManager settings (HTTP.httpLbs request) `catch` \httpEx → case httpEx of
- HTTP.TlsException tlsEx → case fromException tlsEx of
- Nothing → throwIO httpEx
- Just e → do
- cert ← readIORef certVar
- handleTlsException request cert e
- _ → throwIO httpEx
+ HTTP.withManager settings (HTTP.httpLbs request) `catches`
+ [ Handler $ \(e ∷ TLS.TLSException) → do
+ cert ← readIORef certVar
+ handleTlsException request cert e
+#if ! MIN_VERSION_http_client(0,5,0)
+ , Handler $ \httpEx → case httpEx of
+ HTTP.TlsException tlsEx → case fromException tlsEx of
+ Nothing → throwIO httpEx
+ Just e → do
+ cert ← readIORef certVar
+ handleTlsException request cert e
+ _ → throwIO httpEx
+#endif
+ ]
-- -------------------------------------------------------------------------- --
-- Verbose TLS exceptions