Skip to content

ask_unlisted renders a copy of every route in each virtual host #78

Done

Description

@tudor-pop

Problem

ask_unlisted, released in v2.3.0, renders the ask as a copy of every route in each virtual host. Each copy carries one negated Origin matcher per listed origin and pattern.

Measured on 2 December 2026, on a file with 242 routes in each of three virtual hosts and 8 to 20 listed origins per environment, the render grew from 777 KB to 3.09 MB. Envoy then measured:

  • allocated memory: 11.5 MiB before, 40.6 MiB after;
  • physical heap at idle: 66.7 MiB before, 142.7 MiB after;
  • start-up peak: 234.6 MiB.

A gateway with a 256 MiB hard limit and no swap cannot run that.

Goal

The same behaviour as v2.3.0, rendered without a route copy:

  • a request whose Origin is in none of the environment's lists is asked of the configured check, before CORS, with the question header;
  • a listed origin, or a request with no Origin header, is not asked;
  • a file without ask_unlisted renders exactly as v2.3.0 does.

Acceptance criteria

  • A generator test in internal/envoy, beside the generator's other tests: for a file with ask_unlisted, the rendered route count of each virtual host equals the count for the same file without it, and the size grows by a bound that does not depend on the number of routes. The bound is stated in the test as a literal.
  • The existing conformance entries for ask_unlisted (conformance/testdata/unlisted-origins.yaml) stay as they are and pass unchanged on the new render. One entry is added for a request with no Origin header (not asked), if the entries have none.
  • The golden comparison for a file without the key stays byte-identical to v2.3.0's render.

Consumers

  • Every file that sets ask_unlisted: conformance/testdata/unlisted-origins.yaml is the only one that writes the key (git grep -n -E '^[[:space:]]*"?ask_unlisted"?[[:space:]]*[:=]' origin/master -- examples conformance internal/render/testdata printed 1 line in 1 file at origin/master 25ef2d9). Its entries pass unchanged in the conformance battery that Required runs.
  • The text that describes the route copy and changes with the fix: docs/defaults.md (the ask_unlisted: row), docs/portability.md (the origins.<env>.ask_unlisted row), and the comments in internal/envoy/generate.go, internal/envoy/fragments/filter-cors.yaml and internal/envoy/fragments/filter-rbac.yaml. The check is git grep -n -i -E 'cop(y|ies) of (each|every|the) ?(route|environment)|copies of the routes|copy of each route' origin/master -- docs README.md internal conformance, which printed 8 lines in 7 files at origin/master 25ef2d9. Five of them describe this key's copy (the files above). The other three describe the nginx retry copies and stay as they are: docs/nginx.md, the retries row of docs/portability.md, and internal/nginx/retries_test.go.
  • One gateway in this organisation waits for this fix before it adopts the key. With the key absent its render does not change.

Open tickets checked: gh search issues ask_unlisted --repo kitecorp/proxyfile printed 1 issue, #75, closed (the v2.3.0 change this ticket fixes). An export of all the repository's issues, grepped for ask_unlisted|route copy|copies every route, printed the same one. No open ticket asks for this.

Lane

FULL: the render decides which requests reach the auth check, so a mistake admits or refuses browsers wrongly. The behaviour is meant to stay as v2.3.0, and the conformance entries against a real Envoy prove it.

Activity

  1. added
    bug
    on Dec 2, 2026
  2. tudor-pop commented on Dec 2, 2026

    @tudor-pop
    ContributorAuthor

    Released as v2.3.1: #79 merged as 5014e08 (the merged tree is the reviewed tree), and the release run passed with its 6 assets.

    ask_unlisted now gates the check once per virtual host instead of copying every route. On a file with 242 routes in each of three hosts and 20 listed origins:

    v2.3.0 v2.3.1
    bytes the key adds 2,670,723 28,611, the same at any route count
    Envoy heap at idle 222.0 MiB 24.0 MiB
    container peak 236.5 MiB 35.7 MiB

    Behaviour:

    • An unlisted origin is still asked once, before CORS.
    • Listed, pattern, the exact own origin and no-Origin requests are never asked.
    • A scheme or port variant of the own host is asked like any unlisted origin.
    • An admitted null origin gets no allow-origin header.

    The conformance scenario's 20 rows, on Envoy 1.40, assert how many times each request was asked.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions