steve-chavez
5c87fe2704
Add getCurrentTime cache for jwt validation
2018-04-30 11:31:06 -05:00
steve-chavez
6675821c64
Allow PUT method: UPSERT of a single row
2018-02-21 07:33:54 -05:00
steve-chavez
85b1dc0eb4
Add UPSERT for POST with Prefer:resoultion=merge/ignore-duplicates
2018-02-21 07:33:54 -05:00
Duane Johnson and Joe Nelson
a46b6f5020
Pass custom settings to the DB's SESSION ( #1063 )
...
- allows queries to refer to current_setting('app.settings.foo') to retrieve variables
- useful for 12-factor apps (app data can be in environment)
- provides workaround for AWS Relational Database Service (RDS) not
allowing `ALTER DATABASE SET 'app.[KEY]' TO '[VALUE]'` on database.
2018-02-19 12:41:22 -06:00
steve-chavez
188f947437
Maintain backward compatibility on GUC headers feature
...
If pg version >= 9.6 is detected the feature is enabled,
also all of the 9.6 dependent tests are moved to their own spec.
2017-10-18 17:41:55 -05:00
Elliot Murphy and Joe Nelson
3ccae4bb8b
Allow configurable audience claim ( #975 )
2017-09-26 07:29:20 -07:00
Steve Chávez and Joe Nelson
4ba27d84a4
Fix some OpenAPI issues ( #970 )
...
* Fix #933 , update externals docs url to current version
* Fix #962 , openApi don't err on nonexistent schema
* Fix #954 , make OpenAPI rpc output dependent on user privileges
2017-09-25 23:09:52 -07:00
Steve Chávez and Joe Nelson
cf19ad0369
Allow GET on RPC ( #946 )
2017-09-17 11:16:46 -05:00
Joe Nelson and GitHub
0ed4215a0d
Support asymmetric JWK ( #919 )
2017-08-09 08:42:00 -05:00
SteveBash and Joe Nelson
b8eb2cd9c1
Add and/or params for complex boolean logic
...
* Add support for and/or params in GET, POST, PATCH and DELETE
* Restrict usage of IN in and/or to be inside parens e.g. in.(1,2,3)
* Allow quoting operators for values that have ',)' chars
inside and/or e.g. eq."(entity,1)"
2017-05-13 16:49:25 -05:00
Steve Chávez and Joe Nelson
3e26c1a83f
Add connection retrying on startup and SIGHUP, Fix #742 ( #869 )
...
* Add connection retrying on startup and SIGHUP, Fix #742
* Ensure that only one connection worker can run at a time
* Change ConnectionError status code to 503 and add automatic connection retrying
2017-05-06 19:11:18 -05:00
Joe Nelson and GitHub
104a7ed4fa
Use a mime type to request singular JSON responses ( #763 )
2017-01-16 15:11:37 -08:00
Ruslan Talpa and Joe Nelson
16fd3a57ff
Fix #746 ( #769 )
...
also fix broken text env
After the last couple of commits the tests ran correctly only on a
fresh db, in addition, the roles within the db were not created/dropped
on each request and we need that since their privileges differ and we
need to to have an absolute clean db on each execution
2016-12-18 15:46:53 -08:00
Trevor Basinger and Joe Nelson
e364cbc3ff
Support binary (b64) JWT secrets ( #772 )
2016-12-11 09:01:03 -08:00
dsimunic and Joe Nelson
0d85152e42
Improve test db management ( #747 )
2016-12-01 21:06:10 -08:00
Joe Nelson and GitHub
74e68408e6
Bring packages up to date ( #722 )
...
* Bring packages up to date
* New LTS includes deps now
Use stack to select most versions
* Alphabetize packages
* Strip down packages
Switch tests to protolude
* Appease cabal check with base version constraint
2016-10-19 22:25:58 -07:00
Joe Nelson
9cd65a4033
Avoid calling getPOSIXTime more than necessary
2016-10-03 09:55:28 -07:00
Joe Nelson
62ed9e2c4d
Do not require jwt secret, but die on auth without it
2016-09-24 21:28:08 -07:00
Jacky Hu
1fef1991ef
Add proxy awareness for OpenAPI spec generation
...
Proxy uri from command line options takes precedence over host and port
2016-07-07 19:20:40 +08:00
Joe Nelson
88aad4b1b6
Reload schema definition on SIGHUP ( #570 )
2016-04-26 07:50:23 -07:00
Joe Nelson
31738d745f
Regression test for read/write unicode table names
2016-03-25 15:14:00 -07:00
Joe Nelson
e315ad99b4
Name the main module "Main" as required
2016-02-29 14:50:44 -08:00
Joe Nelson
de772b9246
Modified the concurrent test to illustrate problem with prepared statement
2016-02-22 20:58:44 -08:00
Joe Nelson
c28b26d949
Run QueryLimitedSpec with its own server flags
2016-02-22 19:21:39 -08:00
Joe Nelson
b0974a4e36
Reset db between each test suite
2016-02-22 17:50:00 -08:00
Joe Nelson
17acd134c7
Suppress server logging in test mode
2016-02-22 17:48:33 -08:00
Joe Nelson
d5c1438c6e
Use hasql-transaction
...
Also use hspec before-wrapper
2016-02-21 18:05:25 -08:00
Joe Nelson
d7fe59f0b0
WIP: share server code between tests and program
...
- Share server code in Main
- Switch to hasql-pool
- Use pool in tests
- DRY up test runner
2016-02-21 12:22:18 -08:00
Joe Nelson
52e689b830
Add concurrent test for "transaction in progress"
...
MonadBaseControl wizardry courtesy of @jwiegley
2016-02-20 17:45:55 -08:00
Joe Nelson
ac73e8d77b
Remove connection pooling in test
2016-01-24 18:09:19 -08:00
Joe Nelson
b9fd083c77
It all compiles but all requests give a postgres error
2016-01-24 18:09:19 -08:00
Joe Nelson
fec316b087
WIP: fixing compiler errors in specs
2016-01-24 18:09:19 -08:00
Ruslan Talpa
3cd01f9859
Fix failing test after test structure optimization
2015-12-11 10:23:11 +02:00
Joe Nelson
b3144aee15
Cache schema structure between tests for speed
...
Causes one test to fail
2015-12-10 13:36:28 -08:00
Diogo Biazus
0961524e70
Refactors tests to use new fixtures and remove some haskell functions that wont be necessary anymore
2015-12-08 00:44:49 -05:00
Joe Nelson
e37d5d9b25
Style tweak
2015-02-15 15:59:49 -08:00
Adam C. Baker
c9b960f955
only create schema once
2014-12-29 17:57:31 -08:00
Joe Nelson
5900475460
Reset db between tests rather than using transactions to accomodate Hasql limitation
2014-12-06 17:42:21 -08:00
Joe Nelson
f1ecbec543
Do not quote params in Location header
...
Also treat the enum field in OPTIONS as an array uniformly
2014-12-06 17:42:21 -08:00
Joe Nelson
dc43bcbca9
Silence the database fixture output from stdout
2014-12-06 17:42:21 -08:00
Joe Nelson
21b0b02c03
Temporarily use psql to load schemas
2014-12-06 17:42:20 -08:00
Joe Nelson
d6e3526bff
Use Text for textual data
...
Also upgrade Hasql
2014-12-06 17:42:20 -08:00
Joe Nelson
f6b7b42d75
Feature specs compile
2014-12-06 17:42:20 -08:00
Joe Nelson
dd2adf4daa
Tests compile, run, and fail
...
Temporarily disabled unit tests
2014-12-06 17:42:19 -08:00
Joe Nelson
7e9c224299
Configure roles and permissions suitable for Travis auth feature specs
2014-09-30 22:44:02 -07:00
Adam C. Baker
f203982527
have test fixtures load roles too.
2014-09-26 16:58:55 -07:00
Adam C. Baker
a93065a887
specify schema as a string everywhere in the app.
...
This will make it easier to support semantic API versioning,
and makes code reuse easier right now.
2014-09-26 12:51:36 -07:00
Joe Nelson
036ffa107b
Feature tests pass, unit test does not
2014-08-23 18:08:20 -07:00
Joe Nelson
9df8a7b99b
Add global before/after hspec hook in test/Main.hs
2014-08-17 21:21:47 -07:00