Proposal: Pluggable route variables #1903
Replies: 3 comments
-
@philproctor this is a great feature. My only comment is that Ocelot already has a bunch of request manipulation / transform capabilities..and these are all a bit disperate and hacky. It might be a good idea to pull them all together so the code is clear and concise but maybe that is a larger refactor than what you are planning. Also make sure no acceptance tests break as I guess you will deffo be breaking unit tests that will need to change. |
Beta Was this translation helpful? Give feedback.
-
It seems you override AuthorizationMiddleware to process and manipulate claims, right? So, we didn't see your PR or more detailed description here... |
Beta Was this translation helpful? Give feedback.
-
In this scenario Ocelot must authenticate and make a redirection, right? And, what store will be for data like user and URL? In my opinion, all such transformations can be done by custom middleware, or even delegating handler. |
Beta Was this translation helpful? Give feedback.
-
New Feature
Downstream route variables could pull from a pluggable architecture. I have implemented a similar mechanism in our companies usage of Ocelot, where downstream variables could be of the format {claim->UserID} to replace a variable with the first UserID claim and similar for request headers, cookies, and other variables. It also allows operations such as concatenating variables or similar. We also use it in claim authorization for routes.
Motivation for New Feature
All downstream variables currently require the variable to be a replacement from the upstream request. A system such as this would significantly increase flexibility allowing things such as routing to a URL based on the currently logged in user.
Update 1 by Maintainer on Jan 7, 2024
Beta Was this translation helpful? Give feedback.
All reactions