Ocelot icon indicating copy to clipboard operation
Ocelot copied to clipboard

Global UpstreamHeaderTransform settings in GlobalConfiguration section

Open marklonquist opened this issue 1 year ago • 10 comments

New Feature

Add UpstreamHeaderTransform globally for all routes.

Motivation for New Feature

Currently we have to set the same transforms on all routes, leaving a lot of copy paste work.

"UpstreamHeaderTransform": {
    "X-Forwarded-For": "{RemoteIpAddress}",
    "X-Forwarded-Host": "{BaseUrl}",
    "X-Forwarded-Proto": "https"
}

A solution would be to also set global transforms in GlobalConfiguration

Related to

Feature: Headers Transformation

marklonquist avatar May 25 '23 07:05 marklonquist

Hi Mark!

Thanks for paying your attention to this per Route feature. Yes, I agree, it makes sense to have Headers Transformation on the global level for all routes.

Do you have some preliminary solution? Did you fork the Ocelot repo? So, I have assigned this issue to you because I expect most active communication and collaboration on that feature.

If you've seen someone's solution, just let me know about please!

raman-m avatar May 26 '23 16:05 raman-m

@abooraja @anktsrkr @binarymash @briansantura @geffzhang @jps @margaale @philproctor @TomPallister Do we accept this new feature?

raman-m avatar May 26 '23 16:05 raman-m

I do not currently have a solution for it no, but I'd say it would be pretty easy to implement.

Could be a new DefaultUpstreamHeaderTransform and DefaultDownstreamHeaderTransform on the GlobalConfiguration object.

Then, if there is a header transform set on a route which is also a default, that would "win" over the default one (so you can override specific headers on specific routes).

marklonquist avatar May 26 '23 18:05 marklonquist

Added a PR

marklonquist avatar May 26 '23 19:05 marklonquist

👌 I believe this local-to-global feature enhancement will be useful for the Ocelot community. So, I'm going to accept this feature request... ✔️

raman-m avatar Jun 01 '23 11:06 raman-m

The issue has been accepted due to open PR #1659

  • #1659

raman-m avatar Sep 08 '23 15:09 raman-m

Is it solved? I urgently need this feature

xuanhe168 avatar Nov 17 '23 04:11 xuanhe168

@mingyouzhu commented on Nov 17

Hi 老中医 ! Linked PR #1659 is mostly ready. We need to update docs only and/or polish the code. This feature can be added to Nov'23 release. I'll discuss with the team... Sounds good? Sorry, we don't make "urgent" releases! As an urgent solution you can clone marklonquist forked repo, checkout feature branch and compile it.

raman-m avatar Nov 17 '23 10:11 raman-m

Any ETA to release this feature?

spaduret avatar Feb 28 '24 13:02 spaduret

@spaduret This PR was added to Annual 2023 release. Watch the progress please! Sorry, it cannot be released so fast as you/community want/s.

raman-m avatar Mar 02 '24 11:03 raman-m