Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tamper-proof handler monad for strict servant API handling #19

Open
imalsogreg opened this issue Mar 12, 2018 · 0 comments
Open

Add tamper-proof handler monad for strict servant API handling #19

imalsogreg opened this issue Mar 12, 2018 · 0 comments

Comments

@imalsogreg
Copy link
Contributor

In servant-server, it is impossible for a user-defined handler to inspect the request and to mess with the response. Since servant-snap uses any MonadSnap m => m a as the handler monad, we lose this guarantee, making it possible to branch on runtime information in the request and to call functions like writeText that impurely modify the response.

The goal of running in a restrictive monad like servant-server's Handler' is to ensure that all HTTP logic is determined by the type of the API. We should provide that functionality in servant-snap` for users that want this level of safety in their API handlers.

It's not clear how this would interact with Snaplets ability to provide use values (db connections, local state, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant