biscuit-servant 0.4.0.0 → 0.5.0.0
raw patch · 7 files changed
+31/−8 lines, 7 filesdep ~biscuit-haskelldep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: biscuit-haskell, bytestring
API changes (from Hackage documentation)
- Auth.Biscuit.Servant: BiscuitConfig :: ParserConfig Handler -> (Request -> Either e ByteString) -> (forall a. () => e -> Handler a) -> (forall a. () => ParseError -> Handler a) -> BiscuitConfig e
+ Auth.Biscuit.Servant: BiscuitConfig :: ParserConfig Handler -> (Request -> Either e ByteString) -> (forall a. e -> Handler a) -> (forall a. ParseError -> Handler a) -> BiscuitConfig e
- Auth.Biscuit.Servant: WithAuthorizer :: ReaderT t m a -> m Authorizer -> WithAuthorizer' t (m :: Type -> Type) a
+ Auth.Biscuit.Servant: WithAuthorizer :: ReaderT t m a -> m Authorizer -> WithAuthorizer' (t :: Type) (m :: Type -> Type) (a :: Type)
- Auth.Biscuit.Servant: [authorizer_] :: WithAuthorizer' t (m :: Type -> Type) a -> m Authorizer
+ Auth.Biscuit.Servant: [authorizer_] :: WithAuthorizer' (t :: Type) (m :: Type -> Type) (a :: Type) -> m Authorizer
- Auth.Biscuit.Servant: [handler_] :: WithAuthorizer' t (m :: Type -> Type) a -> ReaderT t m a
+ Auth.Biscuit.Servant: [handler_] :: WithAuthorizer' (t :: Type) (m :: Type -> Type) (a :: Type) -> ReaderT t m a
- Auth.Biscuit.Servant: [onExtractionError] :: BiscuitConfig e -> forall a. () => e -> Handler a
+ Auth.Biscuit.Servant: [onExtractionError] :: BiscuitConfig e -> forall a. e -> Handler a
- Auth.Biscuit.Servant: [onParseError] :: BiscuitConfig e -> forall a. () => ParseError -> Handler a
+ Auth.Biscuit.Servant: [onParseError] :: BiscuitConfig e -> forall a. ParseError -> Handler a
- Auth.Biscuit.Servant: checkBiscuitMWith :: (MonadIO m, MonadError ServerError m) => (forall b. () => ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> m Authorizer -> ReaderT (AuthorizedBiscuit OpenOrSealed) m a -> m a
+ Auth.Biscuit.Servant: checkBiscuitMWith :: (MonadIO m, MonadError ServerError m) => (forall b. ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> m Authorizer -> ReaderT (AuthorizedBiscuit OpenOrSealed) m a -> m a
- Auth.Biscuit.Servant: checkBiscuitWith :: (MonadIO m, MonadError ServerError m) => (forall b. () => ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> Authorizer -> ReaderT (AuthorizedBiscuit OpenOrSealed) m a -> m a
+ Auth.Biscuit.Servant: checkBiscuitWith :: (MonadIO m, MonadError ServerError m) => (forall b. ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> Authorizer -> ReaderT (AuthorizedBiscuit OpenOrSealed) m a -> m a
- Auth.Biscuit.Servant: data WithAuthorizer' t (m :: Type -> Type) a
+ Auth.Biscuit.Servant: data WithAuthorizer' (t :: Type) (m :: Type -> Type) (a :: Type)
- Auth.Biscuit.Servant: handleBiscuitWith :: (MonadIO m, MonadError ServerError m) => (forall b. () => ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> WithAuthorizer m a -> m a
+ Auth.Biscuit.Servant: handleBiscuitWith :: (MonadIO m, MonadError ServerError m) => (forall b. ExecutionError -> m b) -> Biscuit OpenOrSealed Verified -> WithAuthorizer m a -> m a
- Auth.Biscuit.Servant: noAuthorizer :: forall (m :: Type -> Type) t a. Applicative m => ReaderT t m a -> WithAuthorizer' t m a
+ Auth.Biscuit.Servant: noAuthorizer :: Applicative m => ReaderT t m a -> WithAuthorizer' t m a
- Auth.Biscuit.Servant: type WithAuthorizer = WithAuthorizer' AuthorizedBiscuit OpenOrSealed
+ Auth.Biscuit.Servant: type WithAuthorizer = WithAuthorizer' (AuthorizedBiscuit OpenOrSealed)
- Auth.Biscuit.Servant: withAuthorizer :: forall (m :: Type -> Type) t a. Applicative m => Authorizer -> ReaderT t m a -> WithAuthorizer' t m a
+ Auth.Biscuit.Servant: withAuthorizer :: Applicative m => Authorizer -> ReaderT t m a -> WithAuthorizer' t m a
- Auth.Biscuit.Servant: withFallbackAuthorizer :: forall (m :: Type -> Type) t a. Functor m => Authorizer -> WithAuthorizer' t m a -> WithAuthorizer' t m a
+ Auth.Biscuit.Servant: withFallbackAuthorizer :: Functor m => Authorizer -> WithAuthorizer' t m a -> WithAuthorizer' t m a
- Auth.Biscuit.Servant: withPriorityAuthorizer :: forall (m :: Type -> Type) t a. Functor m => Authorizer -> WithAuthorizer' t m a -> WithAuthorizer' t m a
+ Auth.Biscuit.Servant: withPriorityAuthorizer :: Functor m => Authorizer -> WithAuthorizer' t m a -> WithAuthorizer' t m a
Files
- ChangeLog.md +4/−0
- README.md +1/−1
- biscuit-servant.cabal +6/−6
- src/Auth/Biscuit/Servant.hs +8/−1
- test/AppWithAuthorizer.hs +4/−0
- test/ClientHelpers.hs +4/−0
- test/Spec.hs +4/−0
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for biscuit-servant +## 0.5.0.0++- use biscuit-haskell 0.5.0.0+ ## 0.4.0.0 - use biscuit-haskell 0.4.0.0
README.md view
@@ -6,7 +6,7 @@ ## Usage -```Haskell+```haskell type AppM = WithAuthorizer Handler type API = RequireBiscuit :> ProtectedAPI
biscuit-servant.cabal view
@@ -1,7 +1,7 @@-cabal-version: 2.0+cabal-version: 3.0 name: biscuit-servant-version: 0.4.0.0+version: 0.5.0.0 category: Security synopsis: Servant support for the Biscuit security token description: Please see the README on GitHub at <https://github.com/biscuit-auth/biscuit-haskell#readme>@@ -10,10 +10,10 @@ author: Clément Delafargue maintainer: clement@delafargue.name copyright: 2021 Clément Delafargue-license: BSD3+license: BSD-3-Clause license-file: LICENSE build-type: Simple-tested-with: GHC ==9.0.2 || ==9.2.4 || ==9.6.5 || ==9.8.2+tested-with: GHC ==9.8.4 || ==9.10.3 || ==9.12.4 || ==9.14.1 extra-source-files: README.md ChangeLog.md@@ -34,8 +34,8 @@ ghc-options: -Wall build-depends: base >= 4.7 && <5,- biscuit-haskell >= 0.4 && < 0.5,- bytestring >= 0.10 && <0.12,+ biscuit-haskell >= 0.5 && < 0.6,+ bytestring >= 0.10 && <0.13, mtl >= 2.2 && < 2.4, text >= 1.2 && <3, servant-server >= 0.18 && < 0.21,
src/Auth/Biscuit/Servant.hs view
@@ -5,6 +5,13 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-}+{-|+ Module : Auth.Biscuit.Datalog.AST+ Copyright : © Clément Delafargue, 2021+ License : BSD-3-Clause+ Maintainer : clement@delafargue.name+ Servant support for biscuit+-} module Auth.Biscuit.Servant ( -- * Protecting a servant API with biscuits@@ -199,7 +206,7 @@ -- > -- reachable with an admin biscuit -- > . withFallbackAuthorizer [authorizer|allow if right("anon");|] -- > -- ^ this policy will be tried /after/ the endpoints policies, so `endpoint3` will--- > -- *not* be reachable with an anon macaroon.+-- > -- *not* be reachable with a biscuit carrying a @right("anon")@ fact. -- > handlers = handler1 :<|> handler2 :<|> handler3 -- > in hoistServer @ProtectedAPI Proxy handleAuth handlers -- > -- ^ this will apply `handleAuth` on all 'ProtectedAPI' endpoints.
test/AppWithAuthorizer.hs view
@@ -5,6 +5,10 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-+ Copyright : © Clément Delafargue, 2021+ License : BSD-3-Clause+-} module AppWithAuthorizer where import Auth.Biscuit
test/ClientHelpers.hs view
@@ -2,6 +2,10 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-}+{-+ Copyright : © Clément Delafargue, 2021+ License : BSD-3-Clause+-} module ClientHelpers where import Data.Bifunctor (first)
test/Spec.hs view
@@ -4,6 +4,10 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-+ Copyright : © Clément Delafargue, 2021+ License : BSD-3-Clause+-} module Main (main) where import Auth.Biscuit