Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #171 from haskell-servant/ghc-8.10.2
Browse files Browse the repository at this point in the history
GHC 8.10.2
  • Loading branch information
domenkozar authored Sep 2, 2020
2 parents fdf20a9 + 02b8ca0 commit 100866a
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 30 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ jobs:
- "8.4"
- "8.6"
- "8.8"
# TODO - "8.10"
- "8.10"
exclude:
- os: macOS-latest
ghc: 8.8.3
- os: macOS-latest
ghc: 8.6.5
- os: windows-latest
ghc: 8.8.3
- os: windows-latest
ghc: 8.6.5

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -67,13 +63,13 @@ jobs:
strategy:
matrix:
stack: ["2.3.1"]
ghc: ["8.6.5"]
ghc: ["8.10.2"]

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'

- uses: actions/setup-haskell@v1.1
- uses: bubba/setup-haskell@2215b2c
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
10 changes: 5 additions & 5 deletions servant-auth-client/servant-auth-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ library
, bytestring >= 0.10.6.0 && < 0.11
, containers >= 0.5.6.2 && < 0.7
, servant-auth == 0.3.*
, servant >= 0.13 && < 0.18
, servant-client-core >= 0.13 && < 0.18
, servant >= 0.13 && < 0.19
, servant-client-core >= 0.13 && < 0.19

exposed-modules:
Servant.Auth.Client
Expand All @@ -63,13 +63,13 @@ test-suite spec
-- test dependencies
build-depends:
hspec >= 2.5.5 && < 2.8
, QuickCheck >= 2.11.3 && < 2.14
, aeson >= 1.3.1.1 && < 1.5
, QuickCheck >= 2.11.3 && < 2.15
, aeson >= 1.3.1.1 && < 1.6
, bytestring >= 0.10.6.0 && < 0.11
, http-client >= 0.5.13.1 && < 0.7
, http-types >= 0.12.2 && < 0.13
, servant-auth-server >= 0.4.2.0 && < 0.5
, servant-server >= 0.13 && < 0.18
, servant-server >= 0.13 && < 0.19
, time >= 1.5.0.1 && < 1.10
, transformers >= 0.4.2.0 && < 0.6
, wai >= 3.2.1.2 && < 3.3
Expand Down
8 changes: 4 additions & 4 deletions servant-auth-docs/servant-auth-docs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ library
build-depends:
base >= 4.10 && < 4.15
, servant-docs >= 0.11.2 && < 0.12
, servant >= 0.13 && < 0.18
, servant >= 0.13 && < 0.19
, servant-auth == 0.3.*
, lens >= 4.16.1 && <4.19
, lens >= 4.16.1 && <4.20
exposed-modules:
Servant.Auth.Docs
default-language: Haskell2010
Expand All @@ -51,7 +51,7 @@ test-suite doctests
base,
servant-auth-docs,
doctest >= 0.16 && < 0.17,
QuickCheck >= 2.11.3 && < 2.14,
QuickCheck >= 2.11.3 && < 2.15,
template-haskell
ghc-options: -Wall -threaded
hs-source-dirs: test
Expand Down Expand Up @@ -79,6 +79,6 @@ test-suite spec
build-depends:
servant-auth-docs
, hspec >= 2.5.5 && < 2.8
, QuickCheck >= 2.11.3 && < 2.14
, QuickCheck >= 2.11.3 && < 2.15

default-language: Haskell2010
8 changes: 4 additions & 4 deletions servant-auth-server/servant-auth-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ library
, entropy >= 0.4.1.3 && < 0.5
, http-types >= 0.12.2 && < 0.13
, jose >= 0.7.0.0 && < 0.9
, lens >= 4.16.1 && < 4.19
, lens >= 4.16.1 && < 4.20
, memory >= 0.14.16 && < 0.16
, monad-time >= 0.3.1.0 && < 0.4
, mtl >= 2.2.2 && < 2.3
, servant >= 0.13 && < 0.18
, servant >= 0.13 && < 0.19
, servant-auth == 0.3.*
, servant-server >= 0.13 && < 0.18
, servant-server >= 0.13 && < 0.19
, tagged >= 0.8.4 && < 0.9
, text >= 1.2.3.0 && < 1.3
, time >= 1.5.0.1 && < 1.10
Expand Down Expand Up @@ -119,7 +119,7 @@ test-suite spec
build-depends:
servant-auth-server
, hspec >= 2.5.5 && < 2.8
, QuickCheck >= 2.11.3 && < 2.14
, QuickCheck >= 2.11.3 && < 2.15
, http-client >= 0.5.13.1 && < 0.7
, lens-aeson >= 1.0.2 && < 1.2
, warp >= 3.2.25 && < 3.4
Expand Down
8 changes: 4 additions & 4 deletions servant-auth-swagger/servant-auth-swagger.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ library
base >= 4.10 && < 4.15
, text >= 1.2.3.0 && < 1.3
, servant-swagger >= 1.1.5 && < 1.8
, swagger2 >= 2.2.2 && < 2.5
, servant >= 0.13 && < 0.18
, swagger2 >= 2.2.2 && < 2.7
, servant >= 0.13 && < 0.19
, servant-auth == 0.3.*
, lens >= 4.16.1 && < 4.19
, lens >= 4.16.1 && < 4.20
exposed-modules:
Servant.Auth.Swagger
default-language: Haskell2010
Expand All @@ -64,7 +64,7 @@ test-suite spec
build-depends:
servant-auth-swagger
, hspec >= 2.5.5 && < 2.8
, QuickCheck >= 2.11.3 && < 2.14
, QuickCheck >= 2.11.3 && < 2.15
other-modules:
Servant.Auth.SwaggerSpec
default-language: Haskell2010
11 changes: 9 additions & 2 deletions servant-auth-swagger/src/Servant/Auth/Swagger.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
module Servant.Auth.Swagger
(
-- | The purpose of this package is provide the instance for 'servant-auth'
Expand All @@ -18,7 +19,7 @@ module Servant.Auth.Swagger
import Control.Lens ((&), (<>~))
import Data.Proxy (Proxy (Proxy))
import Data.Swagger (ApiKeyLocation (..), ApiKeyParams (..),
SecurityRequirement (..), SecurityScheme (..),
SecurityRequirement (..), SecurityScheme (..), SecurityDefinitions(..),
SecuritySchemeType (..), allOperations, security,
securityDefinitions)
import GHC.Exts (fromList)
Expand All @@ -31,11 +32,17 @@ import qualified Data.Text as T
instance (AllHasSecurity xs, HasSwagger api) => HasSwagger (Auth xs r :> api) where
toSwagger _
= toSwagger (Proxy :: Proxy api)
& securityDefinitions <>~ fromList secs
& securityDefinitions <>~ mkSec (fromList secs)
& allOperations.security <>~ secReqs
where
secs = securities (Proxy :: Proxy xs)
secReqs = [ SecurityRequirement (fromList [(s,[])]) | (s,_) <- secs]
mkSec =
#if MIN_VERSION_swagger2(2,6,0)
SecurityDefinitions
#else
id
#endif


class HasSecurity x where
Expand Down
8 changes: 7 additions & 1 deletion servant-auth-swagger/test/Servant/Auth/SwaggerSpec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module Servant.Auth.SwaggerSpec (spec) where

import Control.Lens
Expand All @@ -15,7 +16,12 @@ spec = describe "HasSwagger instance" $ do
let swag = toSwagger (Proxy :: Proxy API)

it "adds security definitions at the top level" $ do
length (swag ^. securityDefinitions) `shouldSatisfy` (> 0)
#if MIN_VERSION_swagger2(2,6,0)
let (SecurityDefinitions secDefs) = swag ^. securityDefinitions
#else
let secDefs = swag ^. securityDefinitions
#endif
length secDefs `shouldSatisfy` (> 0)

it "adds security at sub-apis" $ do
swag ^. security `shouldBe` []
Expand Down
4 changes: 2 additions & 2 deletions servant-auth/servant-auth.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ library
base >= 4.10 && < 4.15
, aeson >= 1.3.1.1 && < 1.6
, jose >= 0.7.0.0 && < 0.9
, lens >= 4.16.1 && < 4.19
, servant >= 0.15 && < 0.18
, lens >= 4.16.1 && < 4.20
, servant >= 0.15 && < 0.19
, text >= 1.2.3.0 && < 1.3
, unordered-containers >= 0.2.9.0 && < 0.3
exposed-modules:
Expand Down
9 changes: 8 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
resolver: lts-14.4
resolver: nightly-2020-08-31
packages:
- servant-auth
- servant-auth-server
- servant-auth-client
- servant-auth-docs
- servant-auth-swagger
extra-deps:
- servant-client-core-0.18
- servant-server-0.18
- servant-client-0.18
- servant-swagger-1.1.10
- servant-docs-0.11.6
- base64-bytestring-1.0.0.3

0 comments on commit 100866a

Please sign in to comment.