From 214a92f20779db656f3ee9fb6fd68914501ad40a Mon Sep 17 00:00:00 2001 From: laurenceisla Date: Fri, 25 Jun 2021 11:12:28 -0500 Subject: [PATCH] Change the default db-channel-enabled config value from False to True (#1880) --- src/PostgREST/CLI.hs | 2 +- src/PostgREST/Config.hs | 2 +- test/SpecHelper.hs | 2 +- test/io-tests/configs/expected/aliases.config | 2 +- test/io-tests/configs/expected/defaults.config | 2 +- .../expected/no-defaults-with-db-other-authenticator.config | 2 +- test/io-tests/configs/expected/no-defaults-with-db.config | 2 +- test/io-tests/configs/expected/no-defaults.config | 2 +- test/io-tests/configs/expected/types.config | 2 +- test/io-tests/configs/no-defaults-env.yaml | 2 +- test/io-tests/configs/no-defaults.config | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/PostgREST/CLI.hs b/src/PostgREST/CLI.hs index de4020ed0..3c5247bc7 100644 --- a/src/PostgREST/CLI.hs +++ b/src/PostgREST/CLI.hs @@ -160,7 +160,7 @@ exampleConfigFile = |db-channel = "pgrst" | |## Enable or disable the notification channel - |db-channel-enabled = false + |db-channel-enabled = true | |## Enable in-database configuration |db-config = true diff --git a/src/PostgREST/Config.hs b/src/PostgREST/Config.hs index fd1b3bc37..764d144d1 100644 --- a/src/PostgREST/Config.hs +++ b/src/PostgREST/Config.hs @@ -193,7 +193,7 @@ parser optPath env dbSettings = <$> parseAppSettings "app.settings" <*> reqString "db-anon-role" <*> (fromMaybe "pgrst" <$> optString "db-channel") - <*> (fromMaybe False <$> optBool "db-channel-enabled") + <*> (fromMaybe True <$> optBool "db-channel-enabled") <*> (maybe ["public"] splitOnCommas <$> optValue "db-extra-search-path") <*> optWithAlias (optInt "db-max-rows") (optInt "max-rows") diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index 1dcec08f0..c1b9394d3 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -76,7 +76,7 @@ _baseCfg = let secret = Just $ encodeUtf8 "reallyreallyreallyreallyverysafe" in configAppSettings = [ ("app.settings.app_host", "localhost") , ("app.settings.external_api_secret", "0123456789abcdef") ] , configDbAnonRole = "postgrest_test_anonymous" , configDbChannel = mempty - , configDbChannelEnabled = False + , configDbChannelEnabled = True , configDbExtraSearchPath = [] , configDbMaxRows = Nothing , configDbPoolSize = 10 diff --git a/test/io-tests/configs/expected/aliases.config b/test/io-tests/configs/expected/aliases.config index e8bd68a75..0bb492e96 100644 --- a/test/io-tests/configs/expected/aliases.config +++ b/test/io-tests/configs/expected/aliases.config @@ -1,6 +1,6 @@ db-anon-role = "required" db-channel = "pgrst" -db-channel-enabled = false +db-channel-enabled = true db-extra-search-path = "public" db-max-rows = 1000 db-pool = 10 diff --git a/test/io-tests/configs/expected/defaults.config b/test/io-tests/configs/expected/defaults.config index 45aa14ce8..3656b4b29 100644 --- a/test/io-tests/configs/expected/defaults.config +++ b/test/io-tests/configs/expected/defaults.config @@ -1,6 +1,6 @@ db-anon-role = "required" db-channel = "pgrst" -db-channel-enabled = false +db-channel-enabled = true db-extra-search-path = "public" db-max-rows = "" db-pool = 10 diff --git a/test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config b/test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config index 5729bb10a..bf6107c60 100644 --- a/test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config +++ b/test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config @@ -1,6 +1,6 @@ db-anon-role = "postgrest_test_anonymous" db-channel = "postgrest" -db-channel-enabled = true +db-channel-enabled = false db-extra-search-path = "public,extensions,other" db-max-rows = 100 db-pool = 1 diff --git a/test/io-tests/configs/expected/no-defaults-with-db.config b/test/io-tests/configs/expected/no-defaults-with-db.config index 4339c24ec..5282774e7 100644 --- a/test/io-tests/configs/expected/no-defaults-with-db.config +++ b/test/io-tests/configs/expected/no-defaults-with-db.config @@ -1,6 +1,6 @@ db-anon-role = "postgrest_test_anonymous" db-channel = "postgrest" -db-channel-enabled = true +db-channel-enabled = false db-extra-search-path = "public,extensions,private" db-max-rows = 1000 db-pool = 1 diff --git a/test/io-tests/configs/expected/no-defaults.config b/test/io-tests/configs/expected/no-defaults.config index 55ef2fc77..f79cbccb5 100644 --- a/test/io-tests/configs/expected/no-defaults.config +++ b/test/io-tests/configs/expected/no-defaults.config @@ -1,6 +1,6 @@ db-anon-role = "root" db-channel = "postgrest" -db-channel-enabled = true +db-channel-enabled = false db-extra-search-path = "public,test" db-max-rows = 1000 db-pool = 1 diff --git a/test/io-tests/configs/expected/types.config b/test/io-tests/configs/expected/types.config index 86bf81747..178cb0b6f 100644 --- a/test/io-tests/configs/expected/types.config +++ b/test/io-tests/configs/expected/types.config @@ -1,6 +1,6 @@ db-anon-role = "required" db-channel = "pgrst" -db-channel-enabled = false +db-channel-enabled = true db-extra-search-path = "public" db-max-rows = "" db-pool = 10 diff --git a/test/io-tests/configs/no-defaults-env.yaml b/test/io-tests/configs/no-defaults-env.yaml index 7078afc6f..2f8853d43 100644 --- a/test/io-tests/configs/no-defaults-env.yaml +++ b/test/io-tests/configs/no-defaults-env.yaml @@ -2,7 +2,7 @@ PGRST_APP_SETTINGS_test2: test PGRST_APP_SETTINGS_test: test PGRST_DB_ANON_ROLE: root PGRST_DB_CHANNEL: postgrest -PGRST_DB_CHANNEL_ENABLED: true +PGRST_DB_CHANNEL_ENABLED: false PGRST_DB_EXTRA_SEARCH_PATH: public, test PGRST_DB_MAX_ROWS: 1000 PGRST_DB_POOL: 1 diff --git a/test/io-tests/configs/no-defaults.config b/test/io-tests/configs/no-defaults.config index 1f2cfa0ec..a689628da 100644 --- a/test/io-tests/configs/no-defaults.config +++ b/test/io-tests/configs/no-defaults.config @@ -1,6 +1,6 @@ db-anon-role = "root" db-channel = "postgrest" -db-channel-enabled = true +db-channel-enabled = false db-extra-search-path = "public, test" db-max-rows = 1000 db-pool = 1