puppetlabs/trapperkeeper-webserver-jetty9 — pull request #57 by fhrbek (2014-08-15 19:25:50+00:00)
Title: WIP - Add a callback to the rewriteURI method

To be able to run the trapperkeeper-proxy, we need to eventually change the entire URI (e.g. when user is not authenticated) as we don't currently have an efficient middleware that would be able to handle that case.

I added support for such a hook in the rewriteURI method, very similar to the callback-fn which is called in the customizeRequest method.

Please, review this PR and if accepted, we should create a ticket for this change and then merge it under that ticket.

A better solution would be to support something like "middlewares" that would allow us to handle authentication and authorization before the request is actually handed over to the proxy route. It would be possible to do it like this: https://github.com/fhrbek/trapperkeeper-webserver-jetty9/compare/wip_middleware_support?expand=1. This is not a PR though, just a rough proposal how it could be done (there are also no tests yet). If we had the middleware support we would probably need neither of the callback functions to implement an elegant TK proxy.