cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

When forwarding all headers , websocket subscriptions break

Open warrenisarobot opened this issue 1 year ago • 5 comments
trafficstars

Component(s)

router

Component version

0.106.0

wgc version

0.63.1

controlplane version

0.106.0

router version

0.106.0

What happened?

Edit the router config to forward all headers.

Use the cosmo demo with make full-demo-up

Websocket subscriptions return an "Internal server error"

Environment information

Environment

OS: (e.g., "MacOS Sonoma 14.6") Package Manager: npm

Router configuration

headers:
  all:
    request:
      - op: "propagate"
        matching: .*

Router execution config

No response

Log output

No response

Additional context

When forwarding specific headers like "Authorization" this works correctly, but when using a wildcard it fails. In this specific setup there is an ingress controller ahead that is passing along only relevant headers which are then passed along to the subgraphs.

warrenisarobot avatar Sep 05 '24 19:09 warrenisarobot

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

github-actions[bot] avatar Sep 05 '24 19:09 github-actions[bot]

Hi @warrenisarobot

Please do the following:

  1. Delete all Cosmo-related containers, images, and volumes.
  2. Reset any and all changes that you might have made in the repository (if any).
  3. Re-pull the repository.
  4. Ensure docker --version yields at least 23.
  5. Try make full-demo-up again.

After you have completed these steps, please do let us know whether you were successful or the problem persists.

Thank you!

The WunderGraph Team

Aenimus avatar Sep 06 '24 21:09 Aenimus

I just read that you're editing config.yaml. The intention of the demo is a quick, one-button solution to show you the fundamentals of WunderGraph Cosmo and the router. Making edits and altering the demo is likely to cause issues like this.

Aenimus avatar Sep 06 '24 21:09 Aenimus

I originally saw the issue when testing on our own subgraphs. To simplify the problem I reverted back to using the subgraphs provided by the demo. It is the same either way - when I forward all headers subscriptions via websocket do not work. I didn't see this behavior documented in the router header config section so I wanted to bring it here to see if I was missing something, or it was expected.

I have tried multiple versions of the router, and all have the same behavior. If I forward all headers then websocket subscriptions do not work.

warrenisarobot avatar Sep 09 '24 16:09 warrenisarobot

Hi @warrenisarobot, thank you! We've tracked the issue and will provide a resolution soon. We highly discourage forwarding all headers. This will destroy the deduplication cache and is a security risk as well. If possible, please try to forward only whitelisted headers.

StarpTech avatar Sep 10 '24 11:09 StarpTech

Hi everyone. The issue has been addressed in https://github.com/wundergraph/cosmo/pull/1293. Thanks!

StarpTech avatar Oct 20 '24 20:10 StarpTech