dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Support HTTPAdditionalForwardHeader prefixes #139

Open dhiaayachi opened 3 weeks ago

dhiaayachi commented 3 weeks ago

Support HTTPAdditionalForwardHeaders prefixes to allow passing in prefixes (i.e. foo-bar-) to forward instead of needing to specify a list of every single header

Is your feature request related to a problem? Please describe.

It's helpful to be able to add new headers using a common prefix and not need to do a temporal server deployment

Describe the solution you'd like

In addition to HTTPAdditionalForwardHeaders, support a list of prefixes. This could be called HTTPAdditionalForwardedHeaderPrefixes

Describe alternatives you've considered N/A

Additional context N/A

dhiaayachi commented 1 week ago
## Support `HTTPAdditionalForwardedHeaderPrefixes` prefixes to allow passing in prefixes (i.e. `foo-bar-`) to forward instead of needing to specify a list of every single header

**Is your feature request related to a problem? Please describe.**

It's helpful to be able to add new headers using a common prefix and not need to do a temporal server deployment.

**Describe the solution you'd like**

In addition to [`HTTPAdditionalForwardHeaders`](https://github.com/temporalio/temporal/blob/21b04a19a3d3fd2732389454697ce4dca808c4e5/common/config/config.go#L106-L108), support a list of prefixes. This could be called `HTTPAdditionalForwardedHeaderPrefixes`.

**Describe alternatives you've considered**
N/A

**Additional context**
N/A
dhiaayachi commented 1 week ago

Thanks for the feature request! It's certainly a common need to be able to add headers using a common prefix.

At this time, Temporal does not support forwarding headers using prefixes.

One way to work around this is to use a separate proxy server that performs the header transformation before forwarding requests to the Temporal server. Here are some popular proxy servers you could use:

We will consider supporting this in a future release of Temporal.

dhiaayachi commented 1 week ago

Thanks for the feature request! This is a great idea and would make managing headers much easier.

Currently, the Temporal server doesn't have built-in support for header prefixes. However, you can work around this by using the HTTPAdditionalForwardHeaders configuration to specify each header individually.

For example, if you want to forward all headers with the prefix foo-bar-, you could add the following to your server configuration:

HTTPAdditionalForwardHeaders:
  - "foo-bar-X-Some-Header"
  - "foo-bar-X-Another-Header"
  # ... other headers

We'll consider adding support for header prefixes in a future release.