Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
, containers
, cql
, cql-io
, cryptonite
, crypton
, data-default
, data-timeout
, deriving-aeson
Expand Down Expand Up @@ -90,7 +90,7 @@ mkDerivation {
containers
cql
cql-io
cryptonite
crypton
data-default
data-timeout
deriving-aeson
Expand Down
2 changes: 1 addition & 1 deletion integration/integration.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ library
, containers
, cql
, cql-io
, cryptonite
, crypton
, data-default
, data-timeout
, deriving-aeson
Expand Down
2 changes: 1 addition & 1 deletion libs/bilge/bilge.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ library
, cookie
, errors >=1.4
, exceptions >=0.6
, http-client >=0.5
, http-client >=0.7
, http-types >=0.8
, imports
, lens
Expand Down
7 changes: 4 additions & 3 deletions libs/bilge/src/Bilge/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ instance MonadIO m => MonadHttp (SessionT m) where
wResponse :: WaiTest.SResponse <- liftSession $ WaiTest.srequest (WaiTest.SRequest wRequest reqBody)
bodyReader <- liftIO $ trivialBodyReader $ LBS.toStrict $ WaiTest.simpleBody wResponse
let bilgeResponse :: Response BodyReader
bilgeResponse = toBilgeResponse bodyReader wResponse
bilgeResponse = toBilgeResponse bodyReader wResponse req

liftIO $ cont bilgeResponse
where
Expand All @@ -162,14 +162,15 @@ instance MonadIO m => MonadHttp (SessionT m) where
Wai.requestHeaderReferer = lookupHeader "REFERER" req,
Wai.requestHeaderUserAgent = lookupHeader "USER-AGENT" req
}
toBilgeResponse :: BodyReader -> WaiTest.SResponse -> Response BodyReader
toBilgeResponse bodyReader WaiTest.SResponse {WaiTest.simpleStatus, WaiTest.simpleHeaders} =
toBilgeResponse :: BodyReader -> WaiTest.SResponse -> Client.Request -> Response BodyReader
toBilgeResponse bodyReader WaiTest.SResponse {WaiTest.simpleStatus, WaiTest.simpleHeaders} originalReq =
Client.Response
{ responseStatus = simpleStatus,
-- I just picked an arbitrary version; shouldn't matter.
responseVersion = http11,
responseHeaders = simpleHeaders,
responseBody = bodyReader,
responseOriginalRequest = originalReq,
Client.responseCookieJar = mempty,
Client.responseClose' = Client.ResponseClose $ pure ()
}
Expand Down
4 changes: 2 additions & 2 deletions libs/galley-types/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, bytestring
, bytestring-conversion
, containers
, cryptonite
, crypton
, errors
, gitignoreSource
, imports
Expand All @@ -35,7 +35,7 @@ mkDerivation {
bytestring
bytestring-conversion
containers
cryptonite
crypton
errors
imports
lens
Expand Down
2 changes: 1 addition & 1 deletion libs/galley-types/galley-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ library
, bytestring
, bytestring-conversion
, containers >=0.5
, cryptonite
, crypton
, errors
, imports
, lens >=4.12
Expand Down
2 changes: 1 addition & 1 deletion libs/ropes/ropes.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ library
, base >=4 && <5
, bytestring >=0.9
, errors >=2.0
, http-client >=0.5
, http-client >=0.7
, http-types >=0.7
, imports
, iso3166-country-codes >=0.20140203.7
Expand Down
2 changes: 1 addition & 1 deletion libs/ssl-util/ssl-util.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ library
, byteable >=0.1
, bytestring >=0.10
, HsOpenSSL >=0.11
, http-client >=0.4
, http-client >=0.7
, imports
, time >=1.5

Expand Down
2 changes: 1 addition & 1 deletion libs/tasty-cannon/tasty-cannon.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ library
, bytestring-conversion
, data-timeout
, exceptions
, http-client >=0.5
, http-client >=0.7
, http-types
, imports
, random
Expand Down
4 changes: 2 additions & 2 deletions libs/types-common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
, containers
, cryptohash-md5
, cryptohash-sha1
, cryptonite
, crypton
, currency-codes
, data-default
, generic-random
Expand Down Expand Up @@ -73,7 +73,7 @@ mkDerivation {
containers
cryptohash-md5
cryptohash-sha1
cryptonite
crypton
currency-codes
data-default
generic-random
Expand Down
16 changes: 16 additions & 0 deletions libs/types-common/src/Data/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ module Data.Misc

-- * Typesafe FUTUREWORKS
FutureWork (..),
from64,
readT,
)
where

Expand Down Expand Up @@ -397,3 +399,17 @@ instance (KnownNat (n :: Nat), Within Text n 1024) => Arbitrary (PlainTextPasswo
-- >>> let (FutureWork @'LegalholdPlusFederationNotImplemented -> _remoteUsers, localUsers)
-- >>> = partitionQualified domain qualifiedUids
newtype FutureWork label payload = FutureWork payload

-------------------------------------------------------------------------------

-- | Same as 'read' but works on 'Text'
readT :: Read a => Text -> Maybe a
readT = readMaybe . Text.unpack
{-# INLINE readT #-}

-- | Decodes a base64 'Text' to a regular 'ByteString' (if possible)
from64 :: Text -> Maybe ByteString
from64 = hush . B64.decode . encodeUtf8
where
hush = either (const Nothing) Just
{-# INLINE from64 #-}
2 changes: 1 addition & 1 deletion libs/types-common/types-common.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ library
, containers >=0.5
, cryptohash-md5 >=0.11.7.2
, cryptohash-sha1 >=0.11.7.2
, cryptonite >=0.26
, crypton >=0.26
, currency-codes >=3.0.0.1
, data-default >=0.5
, generic-random >=1.4.0.0
Expand Down
12 changes: 5 additions & 7 deletions libs/wire-api/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
, constraints
, containers
, cookie
, cryptonite
, crypton
, crypton-x509
, currency-codes
, deriving-aeson
, deriving-swagger2
Expand Down Expand Up @@ -74,7 +75,6 @@
, saml2-web-sso
, schema-profunctor
, scientific
, scrypt
, servant
, servant-client
, servant-client-core
Expand Down Expand Up @@ -107,7 +107,6 @@
, wai-websockets
, websockets
, wire-message-proto-lens
, x509
, zauth
}:
mkDerivation {
Expand All @@ -133,7 +132,8 @@ mkDerivation {
constraints
containers
cookie
cryptonite
crypton
crypton-x509
currency-codes
deriving-aeson
deriving-swagger2
Expand Down Expand Up @@ -176,7 +176,6 @@ mkDerivation {
saml2-web-sso
schema-profunctor
scientific
scrypt
servant
servant-client
servant-client-core
Expand Down Expand Up @@ -204,7 +203,6 @@ mkDerivation {
wai-websockets
websockets
wire-message-proto-lens
x509
zauth
];
testHaskellDepends = [
Expand All @@ -220,7 +218,7 @@ mkDerivation {
bytestring-conversion
cassava
containers
cryptonite
crypton
currency-codes
either
filepath
Expand Down
Loading