Skip to content

Reference and shipped integration test disagree on Authorization in forward.headers_allow #177

Description

@OliverWolffGIP

Summary

The configuration reference says the mediated Authorization header is never written into
forward.headers_allow. The shipped integration-test configuration writes it. Since the ITs are the
only complete BFF configuration in the repository, an adopter copying from them inherits the
contradiction — and has no way to tell which side is right.

The two statements

doc/configuration.adoc, section forward:

Three injections happen automatically and are never written in set_headers /
headers_allow: the mediated Authorization: Bearer on require: session routes (Variants 2/3 —
the gateway sets it from the session's access token, and an inbound Authorization header from
the client is always stripped on those routes) […]

integration-tests/src/main/docker/sheriff-config/endpoints/bff-session.yaml:

      forward:
        headers_allow: ["Authorization", "Content-Type"]

with the accompanying comment:

Authorization is allow-listed so the injected mediated bearer is echoed back by go-httpbin;
Cookie is deliberately NOT allow-listed […]

The comment reads as though allow-listing is what lets the mediated bearer reach the upstream, which
is the opposite of what the reference says.

Why it is not resolvable from the outside

Both readings are self-consistent:

  • If the injection bypasses the allowlist, the IT entry is harmless but misleading.
  • If the injection is subject to the allowlist, the reference is wrong and every deployment that
    follows it silently forwards no credential — a failure that looks like an upstream authorization
    problem, not a gateway configuration problem.

The second case is the expensive one, and it is not distinguishable by reading. I could not settle
it empirically either, because the login flow could not be driven (cuioss/TokenSheriff#628).

Suggestion

Whichever is correct, making the two agree would help — and a sentence in the reference stating
explicitly what happens to an allow-listed Authorization on a require: session route would
remove the ambiguity for good. If the IT genuinely needs the entry for its echo assertion, saying so
in a way that distinguishes "needed for this test" from "needed for mediation" would be enough.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions