steve-chavez
f3a184af01
Correct openapi ignore mode to filter schemas
...
Also rename openapi-mode options
* follow-acl -> follow-privileges
* ignore-acl -> ignore-privileges
2021-06-27 22:48:49 -05:00
Steve Chavez and GitHub
41d119b19f
feat: add openapi-mode config ( #1881 )
...
* openapi-mode="follow-acl"(default): follows access control for the
JWT role.
* openapi-mode="ignore-acl": ignores access control for the JWT role.
* openapi-mode="disabled": disables OpenAPI output, the root endpoint
replies with 404 Not Found.
2021-06-25 19:20:04 -05:00
laurenceisla and GitHub
214a92f207
Change the default db-channel-enabled config value from False to True ( #1880 )
2021-06-25 11:12:28 -05:00
steve-chavez
d3a8b5f6e1
Change db-load-guc-config to db-config
...
Make clear that in-db config is being read
2021-03-05 19:03:15 -05:00
steve-chavez
498e77215a
Reread in-db config when recoverying connection
...
* Separate reading files from whole config re-read
* Only reload external file on SIGUSR2/NOTIFY
2021-03-05 19:03:15 -05:00
steve-chavez
6750a5c44d
Restrict db settings to current db and global
...
Global settings are overriden by database specific settings if they
share common ones.
2021-03-05 19:03:15 -05:00
Steve Chavez and GitHub
c93e8f9e0c
Correct hardcoded postgrest_test_authenticator ( #1743 )
...
Also remove panic from Config and correct io test not running
2021-01-25 18:38:46 -05:00
steve-chavez
125ea8f6d9
feat: allow reloading config with NOTIFY
...
Enables reloading the config by doing:
NOTIFY pgrst, 'reload config'
Adds an alias for reloading the schema cache:
NOTIFY pgrst, 'reload schema'
2021-01-19 13:49:40 -05:00
steve-chavez
9c005fc683
feat: get configuration parameters from the db
...
Allows configuring postgrest from the db by setting config parameters
on the connection role. For example:
ALTER ROLE postgrest_test_authenticator
SET pgrst.jwt-secret = "REALLYREALLYREALLYREALLYVERYSAFE"
The above wWill set the `jwt-secret` config option accordingly.
SUPERUSER privileges are required for ALTERing role settings,
so this might not work on some cloud-managed databases.
This feature is enabled by default, for disabling it you can add the
following to the config file:
db-load-guc-config = false
2021-01-19 13:49:40 -05:00
Wolfgang Walther and Wolfgang Walther
97d8456382
cov: Add io tests for basic cli commands and invalid config options
...
Full code coverage for Config.hs except expected overlays.
2021-01-14 16:40:29 +01:00
Remo Rechkemmer and GitHub
2425cddaed
improve io-tests
...
Tests are now run through unix socket by default allowing
parallel execution. Test setup configuration is done via
environment variables instead of config files.
2020-12-24 16:09:25 +01:00
Wolfgang Walther and Wolfgang Walther
69b459e7b6
Use environment variables for configuration in developer tooling
...
Avoid the need for configuration files for temporary database connections.
2020-12-23 19:39:40 +01:00
Wolfgang Walther and Wolfgang Walther
b7fc393e49
feat: Read config directly from environment variables
...
resolves #1624
2020-12-23 19:39:40 +01:00
Remo Rechkemmer and GitHub
71fa87937b
Migrate io-tests from bash to pytest
...
Authored-by: monacoremo <monacoremo>
2020-12-13 16:19:26 +01:00
Wolfgang Walther and Wolfgang Walther
9254f119f6
fix: implement robust parsing of boolean config values
...
resolves #1572
2020-12-06 21:59:32 +01:00
Wolfgang Walther and Wolfgang Walther
ed58511de3
feat: renamed config options with prefixes; added aliases for old names
...
* secret-is-base64 -> jwt-secret-is-base64
* role-claim-key -> jwt-role-claim-key
* max-rows -> db-max-rows
* pre-request -> db-pre-request
* root-spec -> db-root-spec
* db-schema -> db-schemas
This is not a breaking change, because aliases are added as well.
refactor: sorted all config keys alphabetically where applicable
2020-12-06 21:59:03 +01:00
Wolfgang Walther and Wolfgang Walther
eb46cf2662
added: cli option --dump-config prints loaded config and exits
...
This is most useful for automated tests for upcoming configuration
features. Can also be used for debugging.
2020-12-06 13:33:25 +01:00
Wolfgang Walther and Wolfgang Walther
d218a9eaff
dev: improve postgrest-watch experience
...
* speed up io tests
* avoid infinite loop while watching io tests
* improve auto-complete with postgrest-watch postgrest-run
* detect when files are added or deleted
2020-12-05 16:47:50 +01:00
steve-chavez
e8b4e3771c
Allow config file reloading with SIGUSR2
...
* move config validation to Config.hs
* Add tests for jwt-secret/app.settings.*/db-schema reload
2020-07-13 11:30:16 -05:00
Remo Rechkemmer and GitHub
69b09e312a
Nixify io and memory tests ( #1538 )
...
* Include tests for io and memory in the Nix environment.
* include spec tests in nix-shell by default
* install the io and memory tests in CI
2020-05-28 12:45:14 -05:00
Dan Amoroso and Steve Chávez
78e5677fbe
Add server-unix-socket config option ( #1303 )
...
Add ncat workaround to test socket connection on CircleCI
2019-06-05 12:57:47 -05:00
周丰 and Steve Chávez
0d6d112b38
Read db-uri configuration from a separate file. ( #1215 )
...
* Read dburi configuration from a separate file.
* Add changelog entry.
2018-12-04 13:58:29 -05:00
Steve Chávez and GitHub
30b5859b28
Fix #1141 , app.settings resetting on pool timeout ( #1169 )
...
* Add test for ensuring app.settings don't reset
2018-08-20 11:02:03 -05:00
Steve Chávez and GitHub
0a1d83ce8f
Fix JWTIssuedAtFuture for valid iat claim ( #1166 )
...
* Add test for ensuring "iat" works with time cache
2018-08-16 12:29:32 -05:00
steve-chavez
2066220244
Change server-host default of *4 to 127.0.0.1
2018-08-16 11:15:09 -05:00
steve-chavez
f033c2c4b5
Add role-claim-key config value
2018-04-30 11:31:06 -05:00
Eric Bréchemier and Joe Nelson
7fcdbf9153
strip newline before Base64 decoding ( #916 )
2017-07-20 09:21:31 -05:00