Skip to content

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

Open
@Hronom

Description

@Hronom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions