Allow configurable audience claim (#975)

This commit is contained in:
Elliot Murphy
2017-09-26 07:29:20 -07:00
committed by Joe Nelson
parent 4ba27d84a4
commit 3ccae4bb8b
10 changed files with 82 additions and 15 deletions
+3
View File
@@ -59,6 +59,7 @@ data AppConfig = AppConfig {
, configJwtSecret :: Maybe B.ByteString
, configJwtSecretIsBase64 :: Bool
, configJwtAudience :: Text
, configPool :: Int
, configMaxRows :: Maybe Integer
@@ -117,6 +118,7 @@ readOptions = do
<*> (fromMaybe 3000 . join . fmap coerceInt <$> C.key "server-port")
<*> (fmap encodeUtf8 . mfilter (/= "") <$> C.key "jwt-secret")
<*> (fromMaybe False . join . fmap coerceBool <$> C.key "secret-is-base64")
<*> (fromMaybe "" <$> C.key "jwt-aud")
<*> (fromMaybe 10 . join . fmap coerceInt <$> C.key "db-pool")
<*> (join . fmap coerceInt <$> C.key "max-rows")
<*> (mfilter (/= "") <$> C.key "pre-request")
@@ -177,6 +179,7 @@ readOptions = do
|## (use "@filename" to load from separate file)
|# jwt-secret = "foo"
|# secret-is-base64 = false
|# jwt-aud = "your_audience_claim"
|
|## limit rows in response
|# max-rows = 1000