New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support UVerb in servant-auth-server #1571
Conversation
ca3a35e
to
b4d9cbe
Compare
b4d9cbe
to
94690ad
Compare
94690ad
to
030d852
Compare
2d085ec
to
426d3ce
Compare
type instance AddSetCookieApi (Verb method stat ctyps a) | ||
= Verb method stat ctyps (AddSetCookieApiVerb a) | ||
#if MIN_VERSION_servant_server(0,18,1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: this is in fact not sufficient, as UVerb
support depends on some instances in servant
that are provided by this PR and hence not yet in any released version of servant
.
@@ -86,6 +87,8 @@ newtype WithStatus (k :: Nat) a = WithStatus a | |||
instance KnownStatus n => HasStatus (WithStatus n a) where | |||
type StatusOf (WithStatus n a) = n | |||
|
|||
instance HasStatus a => HasStatus (Headers ls a) where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: this actually brings support to headers in UVerb responses, AFAICT, which probably deserves a changelog entry.
@gdeest Is this ready for review? :) |
@tchoutri Modulo the small comments for myself, yes, it is ! |
No idea how I missed that one, sorry! |
@tchoutri would you mind recreating the branch servant-auth-uverb? Unfortunately due to the way GitHub squashes commits on merged pull requests this has broken my ability to pull this commit in stack and thus my code won't build any longer. I tried building my code on master but there have been several changes and several dependencies since then. I can fork but not recreate the branch once forked. |
The branch still exists on my fork, which I made while waiting for this to be merged, feel free to take from there, but don't rely on it for long as I might delete the fork now that this has been merged https://github.com/bank-manager/servant/tree/servant-auth-uverb |
Closes #1570
Caveat: returning a 401 response with UVerb is not equivalent to usingThis should be fixed.throwAll err401
:XSRF-TOKEN
will be set anyway, because the handler then doesn't fail (it successfully returns an error 馃檭). I can't see a satisfying solution to this problem, so external input is much welcome on this issue (I for one consider this limitation semi-reasonable).