Joe Nelson
a87dcd5553
Merge pull request #603 from diogob/refactor-jwtClaims
...
jwtClaims should always return Left for invalid JWT
2016-05-21 11:14:57 -07:00
Joe Nelson
592dd39222
Merge pull request #602 from ruslantalpa/order_limit_embeded
...
Ability to order embedded items (closes #509 )
2016-05-21 11:08:24 -07:00
Ruslan Talpa
45d0f85b0d
ability to order embeded items ( closes #509 )
2016-05-21 20:52:13 +03:00
Diogo Biazus
abd81c998b
jwtClaims should always return Left for invalid JWT
2016-05-21 13:18:45 -04:00
Christopher League
5c38b4328b
URL-encode Location header ( closes #588 )
...
The database returns an array of key-value strings like `"k1=eq.hello
world"`. Haskell URL-encodes the portion after the equal sign and joins
them with `&`.
Includes updates to tests in Feature.InsertSpec: The CompoundPK has been
modified to have one Int and one String. We attempt to add a key with a
String that has spaces and other special characters. This requires that
the returned Location header is properly URL-encoded.
2016-05-20 10:42:55 -04:00
Christopher League
b089e0a7dd
Tweak .cabal to avoid unneeded recompilation
...
Previously when making a change and running `stack test`, it would
compile each module 3 times: for the library, the executable, and the
test suite.
This change more cleanly segregates the hs-source-dirs for each target,
which avoids recompilation. The only source change is moving Main.hs
into its own directory (but it's otherwise unchanged). See also:
<http://stackoverflow.com/questions/6711151/how-to-avoid-recompiling-in-this-cabal-file >
2016-05-18 09:55:52 -04:00
Joe Nelson
a21464ddca
Merge pull request #592 from begriffs/form-urlencoded
...
Accept POST requests from HTML forms
2016-05-18 00:38:42 -07:00
Joe Nelson
900b9f1991
Explain use of Left value
2016-05-18 00:06:16 -07:00
Joe Nelson
cf16f90fab
Merge pull request #590 from begriffs/proper-403
...
Return proper 401/403 when access denied
2016-05-17 22:56:55 -07:00
Joe Nelson
36a6b10d0d
Merge pull request #594 from ruslantalpa/multiple_fks
...
Fix include entities from the same parent table using two different foreign keys
2016-05-17 22:54:12 -07:00
Douglas Cuthbertson and Joe Nelson
2ac3ad9e37
Fix Windows build issue 589 ( #593 )
2016-05-17 22:47:39 -07:00
Ruslan Talpa
9e6542680b
Fix include entities from the same parent table using two different foreign keys
2016-05-16 15:36:18 +03:00
Joe Nelson
7e41b620ff
Accept POST requests from HTML forms
2016-05-15 20:55:07 -07:00
Joe Nelson
18e3c30ad8
Return proper 401/403 when access denied
...
Fixes #584
2016-05-15 00:56:47 -07:00
Ruslan Talpa
c13f0a369b
Support node/column renaming #310
2016-05-12 10:22:19 +03:00
Ruslan Talpa
cacc725e41
support dash in column names fix #462
2016-05-11 10:43:34 +03:00
Joe Nelson
d9205bd838
Do not include Content-Type header for empty body ( #580 )
...
* Do not include Content-Type header for empty body
Fixes #544
* Fix lint
* Changelog
2016-05-03 21:18:23 -07:00
Joe Nelson
88aad4b1b6
Reload schema definition on SIGHUP ( #570 )
2016-04-26 07:50:23 -07:00
Joe Nelson
5aadfba84b
Use read-only transaction mode for read requests ( #561 )
...
* Make middleware use ApiRequest rather than Request
* Fix outdated comments
* Use read-only transaction mode for read requests
This allows API requests against read replicas
2016-04-15 12:26:40 -07:00
Joe Nelson
eae5857d0e
Set role only once, and set it before other GUC vars ( #560 )
...
* Set role only once, and set it before other GUC vars
Fixes #559
* Unify role/claim logic in claimsToSQL
Suggested by @diogob
2016-04-15 07:30:36 -07:00
Joe Nelson
cd81e9346f
Do not do table count when plurality=singular
...
Rebasing commits by @ruslantalpa
2016-03-23 20:30:51 -07:00
Joe Nelson
3bfe64dd06
Create monomorphic statement function to force use of Text
2016-03-16 21:04:18 -07:00
Joe Nelson
b858626e17
For correctness include charset=utf-8 in responses
2016-03-13 14:22:17 -07:00
Joe Nelson
330cc91645
Protect unicode values in requests
2016-03-13 14:20:54 -07:00
Joe Nelson
4cc08a11e7
Prevent duplicate call to stored procs
...
Reuse a CTE for results of call
2016-03-12 18:28:36 -08:00
Joe Nelson
358254639a
Merge @ruslantalpa's fk improved detection
2016-03-12 12:42:57 -08:00
Joe Nelson
a779e9eb8b
Batch the sql commands to set local vars
2016-03-11 23:45:05 -08:00
Joe Nelson
f67e195f76
Expose all claims via sql postgrest.claims
2016-03-11 20:51:22 -08:00
Joe Nelson
508d722fb2
Allow SQL functions to generate registered JWT claims
2016-03-10 21:58:43 -08:00
Remco Bloemen
e5d420b2db
Gracefull exit on sigTERM
...
Like the sigINT that was already handled, postgrest
should gracefuly shut down on a sigTERM. This is a
common way of stopping processes, used amongst
others by docker.
See: https://stackoverflow.com/questions/4042201/how-does-sigint-relate-to-the-other-termination-signals
2016-03-07 17:45:53 +01:00
Ruslan Talpa
e43ad54dbf
Merge branch 'master' of https://github.com/begriffs/postgrest
2016-03-01 17:54:55 +02:00
Ruslan Talpa
7b94fb608d
suggestions by @diogob
2016-03-01 08:08:57 +02:00
Joe Nelson
e315ad99b4
Name the main module "Main" as required
2016-02-29 14:50:44 -08:00
Ruslan Talpa
40eec0b2ff
code beautify using stylish-haskell
2016-02-29 14:53:41 +02:00
Ruslan Talpa
77bec52be7
Fix compile notice
2016-02-29 14:11:48 +02:00
Ruslan Talpa
0548d65911
main module of the executable needs to be Main, with PostgREST.Main build fails
2016-02-29 13:57:34 +02:00
Ruslan Talpa
40a30d7b02
Fix view column source detection
2016-02-29 13:10:33 +02:00
Diogo Biazus
9d0f3573c6
Implements query counting in proc call and adds Content-Rage to response
...
headers in /rpc calls.
2016-02-26 14:51:35 -05:00
Diogo Biazus
893b7a7126
Applies range headers to /rpc calls using LIMIT/OFFSET.
2016-02-26 14:41:27 -05:00
Joe Nelson
f28b03f419
Allow new hasql-transaction to do rollbacks
2016-02-25 20:13:03 -08:00
Joe Nelson
17acd134c7
Suppress server logging in test mode
2016-02-22 17:48:33 -08:00
Joe Nelson
d4a4bbf966
Roll back on db errors
2016-02-22 16:52:50 -08:00
Joe Nelson
7b7babd1d1
Fix frozen tests
...
Problem found by @ruslantalpa
2016-02-22 08:41:31 -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
Diogo Biazus and Joe Nelson
01ab540ffe
Simplify return from withResource in Main.hs
2016-02-20 18:03:17 -08:00
Diogo Biazus and Joe Nelson
de848f64fa
Return the results from withResource function before applying the respond continuation. This ensures that the pool resource is freed as soon as the database operation is complete
2016-02-20 18:03:06 -08:00
Joe Nelson
f3293cfac1
Do not name import of void directly as it is used conditionally
2016-02-12 23:15:09 -08:00
Joe Nelson
8b3d224b80
Ensure payload parse errors are not suppressed
...
Fixes #490
2016-02-11 16:24:02 -08:00
Joe Nelson
4dec445b82
Add example db connection string to usage
2016-02-05 09:30:42 -08:00