planb-token-introspection 0.1.3.0 → 0.1.4.0
raw patch · 3 files changed
+15/−18 lines, 3 filesdep −th-formatPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: th-format
API changes (from Hackage documentation)
- Network.PlanB.Introspection.Internal.Types: instance GHC.Exception.Exception Network.PlanB.Introspection.Internal.Types.IntrospectionError
+ Network.PlanB.Introspection.Internal.Types: instance GHC.Exception.Type.Exception Network.PlanB.Introspection.Internal.Types.IntrospectionError
Files
- planb-token-introspection.cabal +2/−3
- src/Network/PlanB/Introspection/Internal.hs +0/−1
- tests/Network/PlanB/Introspection/Internal/Test.hs +13/−14
planb-token-introspection.cabal view
@@ -1,5 +1,5 @@ name: planb-token-introspection-version: 0.1.3.0+version: 0.1.4.0 synopsis: Token Introspection for PlanB description: This package provides token introspection functionality for the PlanB token provider.@@ -8,7 +8,7 @@ license-file: LICENSE author: Moritz Clasmeier maintainer: mtesseract@silverratio.net-copyright: (c) 2018 Moritz Clasmeier+copyright: (c) 2018, 2019 Moritz Clasmeier category: Security build-type: Simple extra-source-files: README.md@@ -58,7 +58,6 @@ , http-types , unliftio-core , safe-exceptions- , th-format ghc-options: -Wall default-language: Haskell2010
src/Network/PlanB/Introspection/Internal.hs view
@@ -116,7 +116,6 @@ -> Request -> m (Response LazyByteString) httpRequestExecuteIO maybeManager request = do- liftIO $ print request manager <- maybe (liftIO getGlobalManager) pure maybeManager liftIO $ httpLbs request manager
tests/Network/PlanB/Introspection/Internal/Test.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE QuasiQuotes #-} module Network.PlanB.Introspection.Internal.Test ( planBTokenIntrospectionTests@@ -9,7 +8,6 @@ import Control.Monad import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as ByteString.Lazy-import Data.Format import qualified Data.Map as Map import qualified Data.Text.Encoding as Text import Network.HTTP.Client.Internal@@ -37,7 +35,7 @@ testInvalidToken :: Assertion testInvalidToken = do let rspBody = ByteString.Lazy.fromStrict . Text.encodeUtf8 $- [fmt|{"error":"invalid_token","error_description":"Access Token not valid"}|]+ "{\"error\":\"invalid_token\",\"error_description\":\"Access Token not valid\"}" response = Response { responseStatus = status401 , responseVersion = http20 , responseHeaders = []@@ -77,17 +75,18 @@ testIntrospectToken :: Assertion testIntrospectToken = do- let rspBody = ByteString.Lazy.fromStrict . Text.encodeUtf8 $ [fmt|- { "access_token": "some-token",- "client_id": "test-suite",- "cn": "some-username",- "expires_in": 3591,- "grant_type": "password",- "realm": "/employees",- "scope": ["uid"],- "token_type": "Bearer",- "uid": "some-user-name" }- |]+ let rspBody = ByteString.Lazy.fromStrict . Text.encodeUtf8 $+ "{ \+ \ \"access_token\": \"some-token\", \+ \ \"client_id\": \"test-suite\", \+ \ \"cn\": \"some-username\", \+ \ \"expires_in\": 3591, \+ \ \"grant_type\": \"password\", \+ \ \"realm\": \"/employees\", \+ \ \"scope\": [\"uid\"], \+ \ \"token_type\": \"Bearer\", \+ \ \"uid\": \"some-user-name\" \+ \}" response = Response { responseStatus = ok200 , responseVersion = http20 , responseHeaders = []