zohl / servant-auth-cookie

Authentication via encrypted cookies
BSD 3-Clause "New" or "Revised" License
23 stars 23 forks source link

Added getHeaderSession to get session from servant header #31

Closed mschristiansen closed 7 years ago

mschristiansen commented 7 years ago

I've updated the example to Fix #30 also added a getHeaderSession to the library and factored out shared code from getSession.

Let me know if there is anything you would like me to change or isn't happy with.

zohl commented 7 years ago

Seems good, except there are few failures in the travis:

If you're using servant-0.9 or higher, this is not a big deal. You can just wrap the code in CPP-directives, so that for older versions of servant there will be old code, and for newer versions there will be new (yours) code. (See directives with condition MIN_VERSION_servant(0,9,0) in Servant.hs for example).

mschristiansen commented 7 years ago

I've added CPP-directives. Fingers-crossed that all the tests pass this time.

mschristiansen commented 7 years ago

Installing deps with Nix and testing all build options locally. Should probably have done from the beginning.

zohl commented 7 years ago

Btw, if you have any problems with testing locally, do not hesitate to update the PR and check travis builds :) The one with parameters CABALVER=1.18 GHCVER=7.8.4 won't build anyway (it was like that before), the one in "allowed failures" might fail too. But the rest should pass successfully.

mschristiansen commented 7 years ago

Ok, thanks. Will do that. Will ping you again once it's ready, so don't worry about it until then. Just have some actual work to do first (it suddenly become urgent).

mschristiansen commented 7 years ago

@zohl Tests are passing. Tried to limit the number of CPP statements, but not great.

zohl commented 7 years ago

Awesome, good job! Thank you!