packages feed

servant-auth-swagger 0.2.9.0 → 0.2.10.0

raw patch · 4 files changed

+30/−5 lines, 4 filesdep ~QuickCheckdep ~basenew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: QuickCheck, base

API changes (from Hackage documentation)

+ Servant.Auth.Swagger: instance Servant.Auth.Swagger.AllHasSecurity xs => Servant.Auth.Swagger.AllHasSecurity (Servant.Auth.Cookie : xs)

Files

+ CHANGELOG.md view
@@ -0,0 +1,16 @@+# Changelog++All notable changes to this project will be documented in this file.++The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).++## [Unreleased]++## [0.2.10.0] - 2018-06-18++### Added+- Support for GHC 8.4 by @phadej+- Changelog by @domenkozar+- #93: add Cookie in SwaggerSpec API by @domenkozar+- #42: add dummy AllHasSecurity Cookie instance by @sordina
servant-auth-swagger.cabal view
@@ -1,5 +1,5 @@ name:           servant-auth-swagger-version:        0.2.9.0+version:        0.2.10.0 synopsis:       servant-swagger/servant-auth compatibility description:    This package provides instances that allow generating swagger2 schemas from                 <https://hackage.haskell.org/package/servant servant>@@ -15,9 +15,11 @@ copyright:      (c) Julian K. Arni license:        BSD3 license-file:   LICENSE-tested-with:    GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2+tested-with:    GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3 build-type:     Simple cabal-version:  >= 1.10+extra-source-files:+    CHANGELOG.md  source-repository head   type: git@@ -29,7 +31,7 @@   default-extensions: AutoDeriveTypeable ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators   ghc-options: -Wall   build-depends:-      base >= 4.8 && < 4.11+      base >= 4.8 && < 4.12     , text     , servant-swagger     , swagger2 >= 2 && < 3
src/Servant/Auth/Swagger.hs view
@@ -56,11 +56,17 @@ class AllHasSecurity (x :: [*]) where   securities :: Proxy x -> [(T.Text,SecurityScheme)] -instance (HasSecurity x, AllHasSecurity xs) => AllHasSecurity (x ': xs) where+instance {-# OVERLAPPABLE #-} (HasSecurity x, AllHasSecurity xs) => AllHasSecurity (x ': xs) where   securities _ = (securityName px, securityScheme px) : securities pxs     where       px :: Proxy x       px = Proxy+      pxs :: Proxy xs+      pxs = Proxy++instance {-# OVERLAPPING #-} AllHasSecurity xs => AllHasSecurity (Cookie ': xs) where+  securities _ = securities pxs+    where       pxs :: Proxy xs       pxs = Proxy 
test/Servant/Auth/SwaggerSpec.hs view
@@ -3,6 +3,7 @@ import Control.Lens import Data.Proxy import Servant.API+import Servant.Auth import Servant.Auth.Swagger import Data.Swagger import Servant.Swagger@@ -23,7 +24,7 @@  -- * API -type API =   "secure" :> Auth '[JWT] Int :> SecureAPI+type API =   "secure" :> Auth '[JWT, Cookie] Int :> SecureAPI         :<|> "insecure" :> InsecureAPI  type SecureAPI = Get '[JSON] Int :<|> ReqBody '[JSON] Int :> Post '[JSON] Int