JWT is handled by middleware, do not need it in Intent
This commit is contained in:
@@ -55,8 +55,6 @@ data Intent = Intent {
|
|||||||
, iAccepts :: Either BS.ByteString ContentType
|
, iAccepts :: Either BS.ByteString ContentType
|
||||||
-- | Data sent by client and used for mutation actions
|
-- | Data sent by client and used for mutation actions
|
||||||
, iPayload :: Payload
|
, iPayload :: Payload
|
||||||
-- | Taken from JSON Web Token
|
|
||||||
, iTrustedClaims :: Maybe JSON.Object
|
|
||||||
-- | If client wants created items echoed back
|
-- | If client wants created items echoed back
|
||||||
, iPreferRepresentation :: Bool
|
, iPreferRepresentation :: Bool
|
||||||
-- | If client wants first row as raw object
|
-- | If client wants first row as raw object
|
||||||
@@ -100,7 +98,6 @@ userIntent schema req reqBody =
|
|||||||
target
|
target
|
||||||
(pickContentType $ lookupHeader "accept")
|
(pickContentType $ lookupHeader "accept")
|
||||||
reqPayload
|
reqPayload
|
||||||
Nothing -- TODO: decode jwt
|
|
||||||
(hasPrefer "return=representation")
|
(hasPrefer "return=representation")
|
||||||
(hasPrefer "plurality=singular")
|
(hasPrefer "plurality=singular")
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -23,6 +23,7 @@ import Data.Maybe (fromMaybe)
|
|||||||
import Text.Regex.TDFA ((=~))
|
import Text.Regex.TDFA ((=~))
|
||||||
import qualified Data.ByteString.Char8 as BS
|
import qualified Data.ByteString.Char8 as BS
|
||||||
import System.Process (readProcess)
|
import System.Process (readProcess)
|
||||||
|
import Web.JWT (secret)
|
||||||
|
|
||||||
import qualified Data.Aeson.Types as J
|
import qualified Data.Aeson.Types as J
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ isLeft (Left _ ) = True
|
|||||||
isLeft _ = False
|
isLeft _ = False
|
||||||
|
|
||||||
cfg :: AppConfig
|
cfg :: AppConfig
|
||||||
cfg = AppConfig dbString 3000 "postgrest_anonymous" "test" "safe" 10
|
cfg = AppConfig dbString 3000 "postgrest_anonymous" "test" (secret "safe") 10
|
||||||
|
|
||||||
testPoolOpts :: PoolSettings
|
testPoolOpts :: PoolSettings
|
||||||
testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30
|
testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30
|
||||||
|
|||||||
Reference in New Issue
Block a user