Commit graph

34 commits

Author SHA1 Message Date
aaron levin
30340b5b11 Fix warnings 2015-10-01 15:30:56 +02:00
aaron levin
873f79ef79 Small haddocks changes for authentication 2015-10-01 15:26:46 +02:00
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
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
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
Julian K. Arni
2be621871d Document octet-stream default RFC. 2015-09-15 17:24:37 +02:00
Index Int
f2f7b061d2 Drop EitherT in favor of ExceptT 2015-09-12 15:11:24 +03: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
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
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
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
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
Julian K. Arni
5de9daf528 Fix outdated docs 2015-05-29 10:59:24 +02: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
Brandon Martin
10a6020ca2 modify delete to allow for response body 2015-05-06 13:21:35 -06:00
Julian K. Arni
92d65aaf49 -Wall fixes 2015-05-03 13:36:51 +02:00
Julian K. Arni
50b05860b7 Remove Canonicalize 2015-05-03 01:45:17 +02:00
Julian K. Arni
bdf6d9aa48 Better docs for servant-server 2015-05-03 01:28:13 +02:00
Julian K. Arni
74f4d2db14 Enter via natural transformations 2015-05-03 00:15:35 +02:00
Julian K. Arni
a2b8d6ae58 Better servant-server left 2015-05-02 03:38:53 +01:00
Julian K. Arni
5531ada22b Headers for all 2015-05-02 02:21:03 +01:00
Julian K. Arni
7cb2ca05c4 7.10 CPP
Including some annoying hacks to work around CPP comments.
2015-04-22 14:57:30 +02:00
Julian K. Arni
f82ca76f7d 7.10 changes 2015-04-22 12:27:18 +02:00
Julian K. Arni
ed502f5f21 Prepare merge 2015-04-20 11:13:18 +02:00