packages feed

webgear-openapi 1.1.1 → 1.2.0

raw patch · 6 files changed

+40/−6 lines, 6 filesdep ~basedep ~webgear-core

Dependency ranges changed: base, webgear-core

Files

CHANGELOG.md view
@@ -2,6 +2,11 @@  ## [Unreleased] +## [1.2.0] - 2024-03-18++### Added+- Prerequisite traits (#37)+ ## [1.1.1] - 2024-01-01  ### Changed@@ -47,7 +52,8 @@ ### Added - First version of webgear-openapi -[Unreleased]: https://github.com/haskell-webgear/webgear/compare/v1.1.1...HEAD+[Unreleased]: https://github.com/haskell-webgear/webgear/compare/v1.2.0...HEAD+[1.2.0]: https://github.com/haskell-webgear/webgear/releases/tag/v1.2.0 [1.1.1]: https://github.com/haskell-webgear/webgear/releases/tag/v1.1.1 [1.1.0]: https://github.com/haskell-webgear/webgear/releases/tag/v1.1.0 [1.0.5]: https://github.com/haskell-webgear/webgear/releases/tag/v1.0.5
+ src/WebGear/OpenApi/Trait/Auth.hs view
@@ -0,0 +1,26 @@+{-# OPTIONS_GHC -Wno-orphans #-}+{-# OPTIONS_GHC -Wno-unused-imports #-}++-- | Functions and instances for authentication+module WebGear.OpenApi.Trait.Auth () where++import Control.Lens ((?~))+import Data.Function ((&))+import Data.OpenApi (+  Definitions,+  HasType (type_),+  NamedSchema,+  Schema,+  ToParamSchema (..),+  ToSchema (..),+  paramSchemaToSchema,+ )+import Data.OpenApi.Declare (Declare)+import Data.OpenApi.Internal.Schema (plain)+import Data.Proxy (Proxy (..))+import GHC.TypeLits (KnownSymbol)+import WebGear.Core.Trait.Auth.Common (AuthToken)++instance (KnownSymbol scheme) => ToSchema (AuthToken scheme) where+  declareNamedSchema :: Proxy (AuthToken scheme) -> Declare (Definitions Schema) NamedSchema+  declareNamedSchema _ = declareNamedSchema $ Proxy @String
src/WebGear/OpenApi/Trait/Auth/Basic.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -Wno-orphans #-} --- | OpenApi implementation of 'BasicAuth'' trait.+-- | OpenApi implementation of `BasicAuth'` trait. module WebGear.OpenApi.Trait.Auth.Basic where  import Data.OpenApi
src/WebGear/OpenApi/Trait/Cookie.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -Wno-orphans #-} --- | OpenApi implementation of 'Cookie' and 'SetCookie' traits.+-- | OpenApi implementation of 'WG.Cookie' and 'WG.SetCookie' traits. module WebGear.OpenApi.Trait.Cookie () where  import Data.OpenApi hiding (Response)
src/WebGear/OpenApi/Traits.hs view
@@ -5,6 +5,7 @@ -} module WebGear.OpenApi.Traits () where +import WebGear.OpenApi.Trait.Auth () import WebGear.OpenApi.Trait.Auth.Basic () import WebGear.OpenApi.Trait.Auth.JWT () import WebGear.OpenApi.Trait.Body ()
webgear-openapi.cabal view
@@ -1,7 +1,7 @@ cabal-version:       2.4  name:                webgear-openapi-version:             1.1.1+version:             1.2.0 synopsis:            Composable, type-safe library to build HTTP API servers description:     WebGear is a library to for building composable, type-safe HTTP API servers.@@ -29,6 +29,7 @@   exposed-modules:    WebGear.OpenApi                     , WebGear.OpenApi.Handler                     , WebGear.OpenApi.Traits+                    , WebGear.OpenApi.Trait.Auth                     , WebGear.OpenApi.Trait.Auth.Basic                     , WebGear.OpenApi.Trait.Auth.JWT                     , WebGear.OpenApi.Trait.Body@@ -69,14 +70,14 @@                       TypeFamilies                       TypeOperators   build-depends:      arrows ==0.4.*-                    , base >=4.13.0.0 && <4.19+                    , base >=4.13.0.0 && <4.20                     , http-media ==0.8.*                     , http-types ==0.12.*                     , insert-ordered-containers ==0.2.*                     , lens >=4.18.1 && <5.3                     , openapi3 >=3.1.0 && <3.3                     , text >=1.2.0.0 && <2.2-                    , webgear-core ^>=1.1.1+                    , webgear-core ^>=1.2.0   ghc-options:        -Wall                       -Wno-unticked-promoted-constructors                       -Wcompat