packages feed

cachix-api 1.6 → 1.6.1

raw patch · 9 files changed

+46/−58 lines, 9 filesdep −base16-bytestringdep −cookiedep −deepseqPVP ok

version bump matches the API change (PVP)

Dependencies removed: base16-bytestring, cookie, deepseq, http-api-data, lens, servant-auth-swagger, servant-client, servant-swagger, servant-swagger-ui-core, string-conv, transformers

API changes (from Hackage documentation)

+ Cachix.Types.BinaryCache: type BinaryCacheName = Text

Files

cachix-api.cabal view
@@ -1,27 +1,38 @@-cabal-version:      2.2-name:               cachix-api-version:            1.6-synopsis:           Servant HTTP API specification for https://cachix.org-homepage:           https://github.com/cachix/cachix#readme-bug-reports:        https://github.com/cachix/cachix/issues-author:             Domen Kozar-maintainer:         domen@cachix.org-copyright:          2018 Domen Kozar-category:           Nix-license:            Apache-2.0-license-file:       LICENSE-build-type:         Simple-extra-source-files:+cabal-version:   2.2+name:            cachix-api+version:         1.6.1+synopsis:        Servant HTTP API specification for https://cachix.org+homepage:        https://github.com/cachix/cachix#readme+bug-reports:     https://github.com/cachix/cachix/issues+author:          Domen Kozar+maintainer:      domen@cachix.org+copyright:       2018 Domen Kozar+category:        Nix+license:         Apache-2.0+license-file:    LICENSE+build-type:      Simple+extra-doc-files:   CHANGELOG.md   README.md +source-repository head+  type:     git+  location: https://github.com/cachix/cachix+  subdir:   cachix-api+ common defaults+  build-depends:      base >=4.7 && <5   default-extensions:     NoImplicitPrelude+    NoImportQualifiedPost     DeriveAnyClass     DeriveGeneric     DerivingVia+    LambdaCase+    NamedFieldPuns     OverloadedStrings+    RecordWildCards+    ScopedTypeVariables    ghc-options:     -Wall -Wcompat -Wincomplete-record-updates@@ -29,6 +40,16 @@     -fwarn-unused-imports -fwarn-missing-signatures     -fwarn-name-shadowing -fwarn-incomplete-patterns +  -- TODO: address partial record fields in Cachix Deploy+  -- if impl(ghc >= 8.4)+  --   ghc-options:       -Wpartial-fields++  if impl(ghc >=8.10)+    ghc-options: -Wunused-packages++  if impl(ghc >=9.2)+    ghc-options: -Wredundant-bang-patterns+   default-language:   Haskell2010  source-repository head@@ -68,19 +89,13 @@   build-depends:     , aeson     , async-    , base                  >=4.7    && <5-    , base16-bytestring     , bytestring     , conduit               >=1.3.0-    , cookie     , cryptonite-    , deepseq     , deriving-aeson     , exceptions-    , http-api-data     , http-media     , jose-    , lens     , memory     , nix-narinfo     , protolude@@ -88,14 +103,10 @@     , safe-exceptions     , servant               >=0.14.1     , servant-auth-    , servant-auth-swagger-    , servant-client     , stm-chans-    , string-conv     , swagger2     , text     , time-    , transformers     , unordered-containers     , uuid     , websockets@@ -111,28 +122,9 @@   hs-source-dirs:     test   build-depends:     , aeson-    , base                     >=4.7    && <5-    , base16-bytestring     , bytestring     , cachix-api-    , conduit                  >=1.3.0-    , cookie-    , cryptonite     , hspec-    , http-api-data-    , http-media-    , lens-    , memory     , protolude-    , servant                  >=0.14.1-    , servant-auth-    , servant-auth-swagger-    , servant-swagger-    , servant-swagger-ui-core-    , string-conv-    , swagger2-    , text-    , transformers-    , unordered-containers    build-tool-depends: hspec-discover:hspec-discover
src/Cachix/API.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-}  module Cachix.API@@ -27,7 +26,6 @@ import Data.UUID (UUID) import Protolude import Servant.API hiding (BasicAuth)-import Servant.API.Generic import Servant.Auth  type CachixAuth = Auth '[Cookie, JWT, BasicAuth] Session
src/Cachix/API/Deploy/V1.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-}  module Cachix.API.Deploy.V1 where@@ -11,7 +10,6 @@ import Data.UUID (UUID) import Protolude import Servant.API-import Servant.API.Generic  type API = "api" :> "v1" :> ToServantApi DeployAPI 
src/Cachix/API/Deploy/V2.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-}  module Cachix.API.Deploy.V2 where@@ -9,7 +8,6 @@ import qualified Cachix.Types.DeployResponse.V2 as DeployResponse.V2 import Protolude import Servant.API-import Servant.API.Generic  type API = "api" :> "v2" :> ToServantApi DeployAPI 
src/Cachix/API/Signing.hs view
@@ -27,20 +27,20 @@       ["1", storePath, narHash, show narSize, T.intercalate "," references]  -- Useful sinks for streaming nars-sizeSink :: MonadIO m => ConduitT ByteString o m Integer+sizeSink :: (MonadIO m) => ConduitT ByteString o m Integer sizeSink = CC.foldM (\p n -> return (p + fromIntegral (BS.length n))) 0 -hashSink :: MonadIO m => ConduitT ByteString o m (Context SHA256)+hashSink :: (MonadIO m) => ConduitT ByteString o m (Context SHA256) hashSink = CC.foldM (\p n -> return (hashUpdate p n)) hashInit -passthroughSizeSink :: MonadIO m => IORef Integer -> ConduitT ByteString ByteString m ()+passthroughSizeSink :: (MonadIO m) => IORef Integer -> ConduitT ByteString ByteString m () passthroughSizeSink ioref = passthroughSink sizeSink (liftIO . writeIORef ioref) -passthroughHashSinkBase :: MonadIO m => (Digest SHA256 -> ByteString) -> IORef ByteString -> ConduitT ByteString ByteString m ()+passthroughHashSinkBase :: (MonadIO m) => (Digest SHA256 -> ByteString) -> IORef ByteString -> ConduitT ByteString ByteString m () passthroughHashSinkBase f ioref = passthroughSink hashSink (liftIO . writeIORef ioref . f . hashFinalize) -passthroughHashSink :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()+passthroughHashSink :: (MonadIO m) => IORef ByteString -> ConduitT ByteString ByteString m () passthroughHashSink = passthroughHashSinkBase BA.convert -passthroughHashSinkB16 :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()+passthroughHashSinkB16 :: (MonadIO m) => IORef ByteString -> ConduitT ByteString ByteString m () passthroughHashSinkB16 = passthroughHashSinkBase (convertToBase Base16)
src/Cachix/API/WebSocketSubprotocol.hs view
@@ -50,10 +50,10 @@   | DeploymentFinished {id :: UUID, time :: UTCTime, hasSucceeded :: Bool}   deriving (Show, Eq, Generic, Aeson.FromJSON, Aeson.ToJSON) -parseMessage :: Aeson.FromJSON cmd => ByteString -> Either Text (Message cmd)+parseMessage :: (Aeson.FromJSON cmd) => ByteString -> Either Text (Message cmd) parseMessage = first toS . Aeson.eitherDecodeStrict' -sendMessage :: Aeson.ToJSON cmd => WS.Connection -> Message cmd -> IO ()+sendMessage :: (Aeson.ToJSON cmd) => WS.Connection -> Message cmd -> IO () sendMessage connection cmd =   WS.sendTextData connection (Aeson.encode cmd) 
src/Cachix/Types/BinaryCache.hs view
@@ -6,6 +6,8 @@ import Protolude import Servant.API +type BinaryCacheName = Text+ data BinaryCache = BinaryCache   { name :: Text,     uri :: Text,
src/Cachix/Types/ContentTypes.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}+{-# OPTIONS_GHC -Wno-orphans #-}  module Cachix.Types.ContentTypes   ( XNixNar,
test/DeploySpec.hs view
@@ -3,7 +3,6 @@ import Cachix.Types.Deploy import Data.Aeson (eitherDecode, encode) import qualified Data.ByteString.Lazy as BSL-import Data.HashMap.Strict import Protolude import Test.Hspec import qualified Prelude