Do not share JWT secret with SQL

This commit is contained in:
Joe Nelson
2016-09-24 23:40:54 -07:00
parent 71bc666a8e
commit 2f8ac24128
3 changed files with 2 additions and 11 deletions
-6
View File
@@ -19,7 +19,6 @@ import PostgREST.ApiRequest (ApiRequest(..), ContentType(..),
import PostgREST.Auth (claimsToSQL, JWTAttempt(..))
import PostgREST.Config (AppConfig (..), corsPolicy)
import PostgREST.Error (errResponse)
import PostgREST.QueryBuilder (pgFmtLit)
import Protolude hiding (concat, null)
@@ -46,11 +45,6 @@ runWithClaims conf eClaims app req =
]
(toS $ "{\"message\":\""<>message<>"\"}")
exposeSecretToSQL :: Maybe Text -> H.Transaction ()
exposeSecretToSQL mS =
for_ mS $ \s ->
H.sql $ "set local postgrest.jwt_secret = " <> toS (pgFmtLit s) <> ";"
defaultMiddle :: Application -> Application
defaultMiddle =
gzip def