Commit graph

70 commits

Author SHA1 Message Date
aaron levin
ece355bf58 Remove derived 'Show' instance for 'RR' 2015-10-01 15:26:46 +02:00
aaron levin
9aaf426be0 Remove 'Show' instance for RouteMismatch 2015-10-01 15:26:46 +02:00
Alp Mestanogullari
6906b553fb fix another build error 2015-10-01 15:26:46 +02:00
Alp Mestanogullari
5bd4789387 fix some build errors on 7.8/7.10 2015-10-01 15:26:46 +02:00
aaron levin
9ffe361363 explicitly import 'mempty' for GHC 7.8.4 2015-10-01 15:26:46 +02:00
aaron levin
4efee63380 Swap AuthHandlers and subserver placement
if subserver is last it makes it easier to work with.
2015-10-01 15:26:46 +02:00
aaron levin
b96dc3da2f Update tests for new authentication framework 2015-10-01 15:26:46 +02:00
aaron levin
ef4ab91342 Cleanup import failures and compiler warnings 2015-10-01 15:26:46 +02:00
Andres Loeh
272091effe Second Iteration of Authentication
Implemented with the AuthProtected data family as per alp's suggestion.
2015-10-01 15:26:46 +02:00
aaron levin
d2e2122933 Add BasicAuth tests 2015-10-01 15:21:11 +02:00
aaron levin
17885bc50f Authentication cleanup 2015-10-01 15:21:11 +02:00
aaron levin
1cacf850bf First attempt at BasicAuth combinators
Add `authVal` to BasicAuth, assist type inference

Type inference is difficult with `BasicAuth` and  `BasicAuthLookup`.
This is because `BasicAuthLookup` introduces a type variable `authVal`
and is not bound to anything when used in the context of `HasServer`'s
type.

Servant compiles (temp commit - delete)
2015-10-01 15:21:11 +02:00
aaron levin
4add59bbd1 Add word8 dependency 2015-10-01 15:21:11 +02:00
aaron levin
2e4e8e89a2 Add base64-bytestring dependency for basic auth 2015-10-01 15:21:11 +02:00
Julian K. Arni
3c3efda0d5 Extra file 2015-09-23 20:18:52 +02:00
Julian K. Arni
965063171b Janitoring 2015-09-23 20:18:52 +02:00
Julian K. Arni
2be621871d Document octet-stream default RFC. 2015-09-15 17:24:37 +02:00
Index Int
c5257f42ab Depend on transformers-compat 2015-09-12 16:28:20 +03:00
Index Int
f2f7b061d2 Drop EitherT in favor of ExceptT 2015-09-12 15:11:24 +03:00
Jonathan Lange
6a35a0ae7a Remove auto-generated nix files 2015-09-08 20:36:54 +01:00
Jonathan Lange
a265fd31a0 Run of update-nix-files.sh 2015-09-08 20:28:47 +01:00
Julian K. Arni
6eb7add53a stylish haskell changes
And import fix.
2015-08-18 00:07:12 +02:00
Julian K. Arni
98b6e85128 Contributing 2015-08-17 23:50:42 +02:00
AndrewRademacher
e780e445cb Bumped aeson version. 2015-08-06 13:40:18 -05:00
Brandon Martin
050aa21b9d Response with Head to all Get requests
Signed-off-by: Brandon Martin <zmbmartin@gmail.com>
2015-08-01 07:58:56 -06:00
Brandon Martin
b40094d01c convenience scripts and nix updates 2015-07-30 08:09:29 -06:00
Julian Arni
522a7dc961 Merge pull request #165 from haskell-servant/jkarni/bump-warp
Bump warp upper bound.
2015-07-30 10:44:35 +02:00
Julian K. Arni
1c9d5baa99 Bump versions to 0.5 2015-07-27 22:26:49 +02:00
Sönke Hahn
e24cb9ddf6 add stack file 2015-07-26 17:25:07 +08:00
Julian K. Arni
42d73d10e6 Bump warp upper bound.
To < 3.2.
2015-07-23 13:31:37 +02:00
Alp Mestanogullari
3209f98985 Merge pull request #141 from haskell-servant/new-combinators
Add HttpVersion, IsSecure, RemoteHost and Vault combinators with inst…
2015-07-10 15:00:19 +02:00
Alp Mestanogullari
f39d57c6b3 add HttpVersion, IsSecure, RemoteHost and Vault combinators with instances for all interpretations (all but the server ones being 'ignore that combinator')
tighter version bounds for network

cleanup

document the new combinators

servant-server: add some tests for HttpVersion, IsSecure, RemoteHost and Vault

update changelogs

address Julian's feedback

remove vault test in servant-server

servant-server tests: -Werror friendly
2015-07-10 14:00:01 +02:00
Julian K. Arni
5db91c9ecb Cabal file fixes 2015-07-09 23:34:21 +02:00
Julian K. Arni
d5091a68e1 Bump string-conversions 2015-06-04 15:09:01 +02:00
Alp Mestanogullari
d654ccaf3d Merge pull request #111 from haskell-servant/improved-routing
Improved routing
2015-06-04 12:57:45 +01:00
Andres Loeh
31b12d4bf4 Refactoring: abstracting common parts of method handlers.
This change makes an attempt of abstracting out some of the common
functionality found in the handlers for the different request methods.
There's still a bit of code duplication between the cases for headers
and no headers and empty responses. But it's a significant relative
improvement already.
2015-06-04 13:14:51 +02:00
Andres Loeh
eb86a82105 Refactoring: one module per concept.
The main `Server.Internal` module was getting a bit large for my taste.
It now contains just the instances. All the administrative utilities
are in their own dedicated modules.
2015-06-04 13:14:31 +02:00
Andres Loeh
404bfdd89c Add test cases for the priority of error codes.
Due to the delayed treatment of checks during the server interpretation,
we now have the ability to produce "better" error codes for certain
APIs. This change introduces test cases for some of these situations and
their new, desired results. These tests would mostly fail with the old
approach to routing.
2015-06-04 13:10:21 +02:00
Andres Loeh
f9b1e7fc50 Switch server interpretation to a datatype for efficiency.
Instead of directly interpreting a server as a `RoutingApplication`,
this change introduces the concept of a `Router`, which is a datatype
with several constructors.

In particular, the type of the `route` function changes from

    route :: Proxy layout -> Server layout -> RoutingApplication

to

    route :: Proxy layout -> IO (RouteResult (Server layout)) -> Router

Most important in practice is the case of the `StaticRouter` constructor
in `Router`. For choices between statically known paths, we can now use
a lookup table to dispatch requests rather than trying each request
individually.

This brings down routing complexity of a common case from
O(n) to O(log n).

Another important change is that the handler that is passed down by
`route` is no longer of type `Server layout`, but of type
`IO (RouteResult (Server layout))`. This means that API constructs
can "delay" checks and failure. For example, `ReqBody` does not have
to fetch the request body and feed it to the handler immediately; it
can instead record these actions in the handler that is passed down.
The code will only be executed at a leaf / endpoint of the API.

This is desired behaviour: We prefer to save work by doing all matching
on static path components first. Furthermore, we get better error codes
by doing so.
2015-06-04 13:07:53 +02:00
Ben Gamari
939a008b67 Bump aeson bound 2015-06-03 06:53:34 -04:00
Julian K. Arni
0b3291970f Bump to 0.4.1 2015-05-29 16:24:08 +02:00
Alp Mestanogullari
db8cf8bd8d Merge pull request #106 from haskell-servant/jkarni/bump-either
Bump 'either' upper-bound
2015-05-29 14:56:45 +01:00
Julian K. Arni
ce012da4ee Bump 'either' upper-bound 2015-05-29 14:37:10 +02:00
Julian K. Arni
5de9daf528 Fix outdated docs 2015-05-29 10:59:24 +02:00
Julian K. Arni
28387b7804 Update changelog 2015-05-27 15:29:34 +02:00
Julian K. Arni
2bff26feca Bump attoparsec 2015-05-27 15:19:30 +02:00
Julian Arni
763928cd66 Merge pull request #82 from triplepointfive/drop-system-filepath
Add support for wai-app-static-3.1.0
2015-05-18 12:55:40 +02:00
Christian Marie
ec55177796 servant, servant-server: handle corner case in doctests
They seem to encounter multiple sandboxes sometimes, we now provide a more
helpful error if that happens. Didn't look into why this happens.
2015-05-16 12:45:08 +10:00
Ilya Smelkov
7e14eeafe9 Use filepath to add trailing path separator 2015-05-16 01:03:48 +03:00
Julian K. Arni
c41267811e CPP for support for all 3.X versions of wai-app-static 2015-05-16 01:01:55 +03:00