cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

Header request insert from context

Open rasmusviben opened this issue 1 year ago • 3 comments

Component(s)

router

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

Currently its not possible to insert headers from context in the router, like we see on Apollo. It requires a custom module, but would be great to have this feature in the pure config file.

Describe the solution you'd like

Etc reading user_id from context in config.yaml

version: '1'
headers:
  all: # Rules for all origin requests
    request:
      - insert:
          name: "User-ID"
          from_context: "user_id"

Describe alternatives you've considered

Create a custom plugin/module that supports to read from context and insert the header.

Additional context

No response

rasmusviben avatar Oct 28 '24 14:10 rasmusviben