Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put value from event data in header for HTTP Trigger #2978

Open
Hronom opened this issue Jan 16, 2024 · 0 comments
Open

Put value from event data in header for HTTP Trigger #2978

Hronom opened this issue Jan 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Hronom
Copy link

Hronom commented Jan 16, 2024

Is your feature request related to a problem? Please describe.
Currently headers field is for static values.
We need possibility to put value from event data in header when using HTTP trigger.

Describe the solution you'd like
Given we have event like this:

    {
        "context": {
          "type": "type_of_event_source",
          "specversion": "cloud_events_version",
          "source": "name_of_the_event_source",
          "id": "unique_event_id",
          "time": "event_time",
          "datacontenttype": "type_of_data",
          "subject": "name_of_the_configuration_within_event_source"
        },
        "data": {
          "header": {/* the headers from the request received by the event-source from the external entity */},
          "body": { "userId":"2" },
        }
    }

I wanna have something like this:

          headers:
            MY_HEADER_1: {{ contextKey: id }}
            USER_ID: {{ dataKey: body.userId }}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
This will be useful when you need to have guarantees that events generated for user with id number 1 will be received only by one instance of other service. We can calculate hash based on USER_ID and route requests to specific instance.


Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@Hronom Hronom added the enhancement New feature or request label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant