Skip to content

A Workload learns why a proxied connection failed, and the Gateway never connects directly #51

Description

@sodre

Parent

#49

What to build

When the proxied leg fails, the Workload's response says why, and the Gateway never falls back to a direct connection. Each failure returns 502 with Countersign-Request-ID, and the egress proxy's own response body is never passed on.

What happened Countersign-Error
The egress proxy refused the CONNECT (a 4xx answer) proxy_denied
The egress proxy answered that it could not reach the site (a 5xx answer) upstream_failure
The egress proxy could not be reached, timed out, gave no usable answer, or resolved only to addresses inside denied_networks proxy_unavailable

The runtime test's test-only CONNECT proxy learns to refuse, to answer 5xx, to answer with something that is not an HTTP response, and to be absent. Every negative case asserts what the site saw, not only what the Workload got: that is the test that a failure path never retries directly.

For the wrong-hostname case, the test proxy tunnels a listed name to a site whose certificate covers a different name, and the test grant authority counts the signatures it is asked for.

Acceptance criteria

  • When the egress proxy refuses the CONNECT with a 4xx answer, the Workload gets 502 with Countersign-Error: proxy_denied, and the site saw no connection
  • When the egress proxy answers 5xx, the Workload gets 502 with Countersign-Error: upstream_failure
  • When nothing listens at the egress proxy's address, the Workload gets 502 with Countersign-Error: proxy_unavailable, and the site saw no connection although the Gateway could have reached it directly
  • When the egress proxy closes the connection or answers with something that is not an HTTP response, the Workload gets 502 with proxy_unavailable
  • When the egress proxy's address is inside denied_networks, the Workload gets 502 with proxy_unavailable, and neither the proxy nor the site saw a connection
  • Through an allowed tunnel to a site whose certificate is for another hostname, the request fails and the grant authority is asked for no client-certificate signature
  • Each of these responses carries Countersign-Request-ID, and none carries the egress proxy's response body
  • The Gateway logs each failure with its request ID and error value
  • The runtime test runs these cases wherever it runs today
  • The troubleshooting table covers proxy_denied and proxy_unavailable, and says that upstream_failure on a proxied route means the egress proxy could not reach the site

Decided in: #49 (spec); ADR 0003; the triage outcome on #46
Live step at merge: none

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions