aleph

jmromrell 2019-04-26T16:53:32.002400Z

Can I rely on a manifold stream as a response to a web request to behave as a delay (meaning no execution of its content until it is realized after being handled by middleware)?

jmromrell 2019-04-26T16:55:06.004200Z

I'm wanting to write auth middleware which relies on this property and enforces authentication/authorization after the response is being passed back up the middleware chain, rather than checking auth before the handler is reached.

jmromrell 2019-04-26T16:56:10.005500Z

I have been running into issues with compojure where if I try to handle auth in middleware as the request is coming in, it will end up enforcing auth even if the request didn't match any of the routes I was trying to implement auth for.

valerauko 2019-04-28T07:57:07.006900Z

This could be resolved by using #reitit instead which has per-route middleware

jmromrell 2019-04-26T16:57:17.006800Z

But if I delay checking auth until after a handler returns something (so I know a route was matched), then the handler has already executed the contents regardless of if the user were authenticated/authorized.