Skip to content

rest connectors: Authorization header propagation using router and legacy config causes aws load balancer 400 #7481

Open
@TygerTaco

Description

@TygerTaco

Describe the bug

For a rest connector subgraph when i have a Authorization config for both a @source header configuration and a router connector propagate configuration any query to that subgraph results in a failed http 400 response. Inspecting the response in the connectors debugger i see:

b"<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n"

This is coming from my aws application load balancer:

Image

The error only happens when both @source and router configuration are there, having one or the other does not cause this behavior. I would like to switch over to the new router configuration, however I can't deploy that change in a way that would not cause an outage for a brief period of time. I'd have to deploy an updated rest connector schema without Authorization before deploying the router and then clients would get 401s, or do it in reverse and then clients would get the 400 before i get a chance to update the subgraph.

To Reproduce

Steps to reproduce the behavior:

  1. Have a rest api with an ingress through an aws aplication load balancer.
  2. Create a rest connector schema with a @source like the following:
  @source(
    name: "foo"
    http: {
      baseURL: "foo_url"
      headers: [
        { name: "Authorization", from: "Authorization" }
      ]
    }
  )
  1. Create a v2.2 router config with
headers:
  connector:
    all:
      request:
        - propagate:
            named: "Authorization"
  1. make a query to the rest connector subgraph with a valid Authorization header and get a 400

Expected behavior

Per PR 7152:

Note that if one of these rules conflicts with a header set in your schema, either in `@connect` or `@source`, the value in the Router config will take priority and be treated as an override.

Which means i should be able to have both configs in place and it the router config should ignore the @source config and the query should result in a 200

Output

Image

Image

Image

Desktop (please complete the following information):

  • OS: ubuntu jammy
  • Version 2.2

Additional context

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#http-400-issues

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions