Ocelot icon indicating copy to clipboard operation
Ocelot copied to clipboard

Proposal: Pluggable route variables

Open philproctor opened this issue 6 years ago • 4 comments

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.

philproctor avatar Jan 08 '19 04:01 philproctor

@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.

TomPallister avatar Jan 13 '19 12:01 TomPallister

Any update on this ?

redplane avatar Mar 12 '20 18:03 redplane

Any update on this ?

xclw2000 avatar Dec 03 '20 06:12 xclw2000

Any update on this ?

lujiaxing avatar Jun 15 '22 06:06 lujiaxing

4 years have been passed... 😄

raman-m avatar Dec 11 '23 13:12 raman-m

@philproctor

We also use it in claim authorization for routes.

It seems you override AuthorizationMiddleware to process and manipulate claims, right?

So, we didn't see your PR or more detailed description here... I understood that your feature request is very rare user case for your specific needs only. Am I right? Could you show your idea better in details plz? Any sample code?

raman-m avatar Dec 11 '23 13:12 raman-m

@redplane @xclw2000 @lujiaxing Hello community! The update is above! ☝️ 😉

raman-m avatar Dec 11 '23 13:12 raman-m

Lack of design description! Should be discussed more! Converting to a discussion...

raman-m avatar Jan 07 '24 15:01 raman-m