From f3d5759c1a93387357450032f89ecba403c00fe8 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Thu, 19 Nov 2015 10:21:27 -0800 Subject: [PATCH] JWT is handled by middleware, do not need it in Intent --- src/PostgREST/RequestIntent.hs | 3 --- test/SpecHelper.hs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/PostgREST/RequestIntent.hs b/src/PostgREST/RequestIntent.hs index 29b01ad03..326fe05be 100644 --- a/src/PostgREST/RequestIntent.hs +++ b/src/PostgREST/RequestIntent.hs @@ -55,8 +55,6 @@ data Intent = Intent { , iAccepts :: Either BS.ByteString ContentType -- | Data sent by client and used for mutation actions , iPayload :: Payload - -- | Taken from JSON Web Token - , iTrustedClaims :: Maybe JSON.Object -- | If client wants created items echoed back , iPreferRepresentation :: Bool -- | If client wants first row as raw object @@ -100,7 +98,6 @@ userIntent schema req reqBody = target (pickContentType $ lookupHeader "accept") reqPayload - Nothing -- TODO: decode jwt (hasPrefer "return=representation") (hasPrefer "plurality=singular") diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index 2a7cb123a..f7c429cca 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -23,6 +23,7 @@ import Data.Maybe (fromMaybe) import Text.Regex.TDFA ((=~)) import qualified Data.ByteString.Char8 as BS import System.Process (readProcess) +import Web.JWT (secret) import qualified Data.Aeson.Types as J @@ -40,7 +41,7 @@ isLeft (Left _ ) = True isLeft _ = False cfg :: AppConfig -cfg = AppConfig dbString 3000 "postgrest_anonymous" "test" "safe" 10 +cfg = AppConfig dbString 3000 "postgrest_anonymous" "test" (secret "safe") 10 testPoolOpts :: PoolSettings testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30