Skip to content

Retain provider-local HTTP opt-in in the demo baseline - #1533

Open
ChristianPavilonis wants to merge 171 commits into
baseline/protected-geo-20261110from
baseline/http-auction-20261110
Open

ChristianPavilonis wants to merge 171 commits into
baseline/protected-geo-20261110from
baseline/http-auction-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Existing default-false HTTP provider exception, explicit defaults in all callers and configuration tests.
  • Reorganize the existing working demo using EdgeZero83d7a629, not current-main forwarding compatibility.

Draft baseline review unit. Not a current-main merge candidate, deployment approval or completed current-head CI claim.

Baseline and sequence

Head: 1cfba70a2efecda9ff522187c69359eda1fa6692. Base: baseline/protected-geo-20261110.

Historical main anchor: 2dd968aeebeb2cc0d5110115f64e0ad58e2e1d13. Original demo: TS2423a2ed plus separately preserved dirty inputs. Matching EdgeZero: draft431, exact revision 83d7a6296d285e135c4ea70021b19e6c8dca7e9f.

The user selected compatible-baseline cleanup. Current-main integration with EdgeZero462 and the authenticated-forwarder incompatibility are deferred. Preserve current-main PR1525/1526 ready and1527/1528 draft, with their existing bases. No excluded1499 or independent1506 implementation, relay/privacy experiment, new transport fallback, group/codec/phase design or operational deployment is included.

Changes

Area Change
This unit Existing default-false HTTP provider exception, explicit defaults in all callers and configuration tests.
Unchanged work Original checkouts, dirty Prebid inputs, recovery references and existing PRs remain preserved.

Closes

Refs #1530. This unit completes one part of the baseline extraction and does not close the overall tracker on its own.

Spec

Not a new feature. This is extraction of existing demo behavior and bounded build/caller corrections. Original native and EC storage design/review records remain in the baseline where applicable; they are not presented as approval of later combined source. No new forwarding, consent, timer or provider policy is designed here.

Test plan

Focused auction-plan tests and strict Core lint pass. Fixture uses pbs.example.com, without changing opt-in assertions. Current-main PR1525 remains separate and ready; its hosted results are not relabeled as this baseline head's results.

  • Required current-head hosted checks complete before ready-state transition.
  • Final baseline combined-check results recorded with exact input revisions and limitations.
  • Focused failures and corrections retained rather than assertions relaxed.

The b67ffc6 baseline checkpoint has passing documented local gates: Fastly/default/reuse/native/Cloudflare/Spin suites, all adapter strict lint lanes, 17 cross-adapter parity cases, 1252 JS cases, CLI suites, formatting, clock/digest/proposal checks and changed-lines domain lint. Passing checks at121ebcc36 are reused only for unchanged relevant inputs; the final follow-up covers the CLI test-import and documentation-only corrections. These results are not a substitute for this PR's current-head hosted checks.

Checklist

  • Existing behavior extracted into a scoped review unit.
  • Public examples use fictional inputs and no licensed Geo data.
  • No deployment, main merge, old-RC closure or recovery deletion.
  • No new worker launched or paused experiment resumed.
  • Review readiness confirmed independently from later units.

Operational Terraform remains in trusted-server-deployer. Local checks and prototype tests do not qualify cloud access, fleet durability or a live publisher.

Hosted docs-build correction

The first hosted format-docs job caught an additional site-build gate that the original local formatter checkpoint had not run: a relative link from the native EC guide to a Terraform example outside the site. Native EC correction8b11dbad3 replaces it with the plain repository path; no dead-link check is disabled. That docs-only correction is carried through the existing upper PR identities. Native EC and final integration8985b111 both pass docs ESLint and VitePress build; the final docs formatter also passes. Runtime, dependency, image-build-context and test inputs are unchanged from b67ffc6, so their prior exact-input proofs are reused. Hosted current-head checks still control readiness.

Startup negative-probe correction

A hosted native EC case failed the no-listener probe while its child logged the expected startup validation failure. The old log has no socket endpoints, so the failure's exact subtype is not claimed confirmed. A separate controlled Linux reproduction demonstrates a successful TCP self-connection with no listening server. Native correction8490c691d distinguishes equal local/peer endpoints from a real listener; actual socket controls prove the self-connection is excluded and a real listener is still detected. Nonzero exit, expected diagnostic, secret-redaction and the original startup deadline remain required. This changes only the acceptance fixture, not production admission, transport or trust.

The earliest native unit and final9356c557 default/all-feature acceptance checks and strict lint pass, including both controls and the original failure case. Ignores remain explicit; earlier separately executed celld proof is not relabeled as a new ignored-case run. Correction is merged upward through existing PR identities without force-pushing or retargeting. Current-head hosted checks must pass; the old failure is retained rather than rerun-only waived. Runtime/API/dependency inputs remain unchanged. A fresh exact9356 producer build and real runtime smoke now pass: image sha256:65a735d38e9dbc0573d0f6068a8b261bd202c43aea05085c2b2d6bccc91ebdbd, linux/amd64 UID/GID10001, including startup rejection and in-flight SIGTERM drain. Prior b67 image receipts remain separate; no image was pushed. All local parent runners are complete.

Browser CI host compatibility

Preserved older browser failures show Playwright1.58.2 rejecting ubuntu-latest's new Ubuntu26.04 image before browser installation; later missing-executable failures are consequences, not passing browser tests. Nativeb1216763a pins only the browser job to ubuntu-24.04, leaving dependency versions, tests and assertions unchanged. Direct Actionlint1.7.12 passes at the owning native and final integration points; the first shim-only attempt could not run because no global version was configured, and is not counted as lint proof. No global tooling was changed. The only9356 ->ee7 delta is this workflow host/comment; runtime, Cargo, docs, tests and Docker-context inputs are unchanged. Actual browser execution on the supported hosted runner remains pending and must pass before readiness. No waiver or browser skip.

Reconciliation refresh above the new PR 1506 head

Merge-forward head 0de7e14346b589c1177eb8fd05f18e5c716e934a retains original public 82d9a0e66e00727c56572d707d92aed5be66fe58, previous local candidate 3c2c0a022f712b8f51c6360f5f165ba9e59904fb and updated parent 9075b4b391c84bc5954d7b8a92f810251d2657be. The original feature patch is unchanged. Aram's #1516 code/tests/spec are preserved upstream rather than duplicated as another owned production port. The existing PR identity, feature boundary and readiness remain intact.

Fresh shared-root and combined RC qualification passes on the refreshed source. Reused JS/Chrome/storage/wrapper/Terraform evidence is explicitly fingerprinted, not claimed as a new execution. Source-image proof is bound to refreshed #1539, not a new RC release. Fresh hosted/macOS, digest-backed wrapper/RC images, other external browser/framework lanes and live AWS/publisher/CMP acceptance remain unverified. Ignored/unexecuted cases and original failed receipts are not counted as passes. Historical claims above remain bound to their named old inputs. No tag, registry publication or deployment is included.

Published snapshot; newer upstream integration pending

Published deliberately for review from the qualified #1506 checkpoint 57d7c6ad8db43601ef31c1e1d1615e6dd2aa6a6a. At publication the moving author branch was at 628474ec4a8cee8361a6927ae6b79b68fdd33a55. Newer upstream bounded-response handling, per-profile RTB caps and Sourcepoint changes are not incorporated or qualified in this snapshot. Further merge-forward reconciliation and conflict resolution may be needed before merge. Local results above describe this exact qualified source, not a merge with the newer base or a release.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The provider-local allow_insecure_http opt-in is correct and well covered: the flag gates only the http scheme, does not leak to other providers or schemes, is omitted from serialized output when false, and the scheme flows through to the backend spec so an opted-in endpoint is actually sent as plain HTTP. One blocking item: the current-head hosted check cargo test (axum native) fails from an inherited test fixture that this PR describes as corrected but which was corrected only in a sibling file.

1 of the inline comments below carries a one-click GitHub suggestion. The blocking finding is body-level because its file is outside this PR's diff.

Blocking

🔧 wrench

  • startup.rs still has the self-connection listener probe — see Cross-cutting below.

Non-blocking

⛏ nitpick

  • unwrap() in the new serialization test — see inline at crates/trusted-server-core/src/auction/plan.rs:1186

Cross-cutting / body-level findings

  • 🔧 startup.rs still has the self-connection listener probe. crates/trusted-server-adapter-axum/tests/startup.rs:116 (assert_failed_before_listen) treats any successful TcpStream::connect_timeout as "the server is listening". On Linux a connect can succeed with no listener when the ephemeral source port equals the target port. The PR description says this was corrected; the correction in 70a894547 added connected_to_listener (local address != peer address) to native_acceptance.rs only, and startup.rs kept the bare is_err() probe. At this head the Linux runner hit the case: missing_config_fails_before_listen_without_legacy_fallback panicked at startup.rs:115 ("should not listen while required startup inputs are invalid"). The base branch passed with identical fixture content, so this is intermittent and inherited rather than introduced by the HTTP change. Minimal correction: apply the same local-vs-peer exclusion in assert_failed_before_listen (the connected_to_listener helper from native_acceptance.rs). The file entered in the native unit and was last touched by the geo unit, so the fix belongs there and merges upward through the stack. Not a suggestion because the file is outside this diff.
  • 📝 Configuration guide now contradicts the new field. docs/guide/configuration.md:2090 still says all provider endpoints must be absolute HTTPS URLs, and the provider-field table at :2153 has no allow_insecure_http row, while auction-orchestration.md documents the opt-in. Optional consistency fix.
  • 📝 Rollback note, no action needed. ProviderConfig has deny_unknown_fields, so a config blob with allow_insecure_http set is rejected by any binary that predates this change; a demo config using it cannot roll back the binary alone. Default configs are unaffected because the field is omitted when false.

Verification notes

  • Focused auction::plan suite at head: 32 pass (host triple, native).
  • Mutation controls on the new guard: accepting http without the flag fails insecure_http_requires_an_explicit_per_provider_opt_in; letting the flag accept any scheme fails insecure_http_opt_in_does_not_allow_credentials_fragments_or_other_schemes.
  • startup fixture on macOS: 3/3 pass (the Linux self-connection does not reproduce there).
  • The inline suggestion was applied in a scratch tree: cargo fmt --check, cargo clippy -p trusted-server-core --lib --tests -D warnings, and the three focused tests pass.

CI Status

  • cargo test (axum native): FAIL
  • CLAUDE.md symlink guard: PASS
  • browser integration tests: PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo check/build/test (spin native + wasm32-wasip2): PASS
  • cargo fmt: PASS
  • cargo test: PASS
  • cargo test (cross-adapter parity): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • docs-proposal scripts: PASS
  • format-docs: PASS
  • format-typescript: PASS
  • integration tests: PASS
  • integration tests (Fastly EC lifecycle): PASS
  • prepare integration artifacts: PASS
  • vitest: PASS

@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:56
Preserve the existing literal-loopback HTTP exception, explicit non-loopback provider opt-in, default-false wire shape and credential/fragment/scheme rejection. Retain the existing HTTP feature head and the direct EdgeZero cutover.

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The scoping in canonicalize_endpoint is right: one provider's flag doesn't leak to another, and credentials, fragments and other schemes stay rejected. I confirmed it end to end at this head on Axum and on Fastly (Viceroy). What's missing is around the change. Operators get no signal that a provider is sending in plaintext, two transport mutants survive the whole core suite, and the CHANGELOG and four other docs still say HTTPS-only. The production code is the same as #1525, so these match my #1525 r1 findings, re-checked against this base.

4 of the inline comments below carry a one-click GitHub suggestion. Use Commit suggestion (or Add suggestion to batch for several at once) to apply them as commits on the PR branch. The other inline comments describe the fix in prose because it touches lines outside the diff or another file.

Blocking

🔧 wrench

  • Nothing tells the operator a provider is running in plaintext: see inline at crates/trusted-server-core/src/auction/plan.rs:326
  • Tests don't check how an opted-in provider is dialed, or that HTTPS isn't downgraded: see inline at crates/trusted-server-core/src/auction/plan.rs:1163
  • Configuration reference, CHANGELOG and three other docs still say HTTPS-only: see body-level below
  • prepare integration artifacts failed, so integration and browser jobs never ran: see body-level below

Non-blocking

♻️ refactor / ⛏ nitpick

  • Field doc comment: summary/details split and rollback rationale: see inline at crates/trusted-server-core/src/auction/plan.rs:139
  • Guide table understates plaintext exposure: see inline at docs/guide/auction-orchestration.md:771
  • is_false duplicates settings::is_false: see inline at crates/trusted-server-core/src/auction/plan.rs:611
  • Scheme error message says HTTPS for opted-in providers: see inline at crates/trusted-server-core/src/auction/plan.rs:585

Cross-cutting / body-level findings

  • 🔧 Configuration reference, CHANGELOG and three other docs still say HTTPS-only. The PR updates only docs/guide/auction-orchestration.md. This extends prk-Jr's 📝 on configuration.md: operators configuring providers read every one of these, and two of them give the wrong fix for the exact error an opted-in setup hits.

    • CHANGELOG.md:15: the Unreleased config-first entry says "Provider endpoints must be absolute HTTPS URLs." Amend it to "... unless the provider sets allow_insecure_http", and add an ### Added entry with the rollback ordering. ProviderConfig denies unknown fields, and the base branch's own ts config validate (built at 0ae96ef5f) rejects an opted-in config with unknown field `allow_insecure_http` … in `auction.providers.pbs-main` , while the same config without the flag passes:

      - Added per-provider `allow_insecure_http` (default `false`) under `[auction.providers.<id>]`, which lets an explicitly approved demo or test provider use a plain `http://` endpoint. Other providers still require HTTPS, and credentials, fragments and other schemes remain rejected. Requests to an opted-in provider carry client IP, User-Agent, geo, consent signals and identifiers in cleartext, and its responses can be altered in transit. Upgrading: binaries that predate the field reject a blob that sets it, so upgrade the binary first, then push the config. Rollback: remove the flag, push the default-compatible blob, then roll back.
    • docs/guide/configuration.md:2149-2157: the provider-field table has no allow_insecure_http row, and its endpoint row says "Absolute HTTPS URL with host and no credentials or fragment". Proposed rows (then npm run format:write in docs/):

      | `endpoint`            | Yes      | None            | Absolute HTTPS URL with host and no credentials or fragment; plain HTTP only with `allow_insecure_http` |
      | `allow_insecure_http` | No       | `false`         | Accept a plain `http://` endpoint for this provider only; approved demo/test endpoints only             |
    • docs/guide/configuration.md:2089-2090: "All provider endpoints must be absolute HTTPS URLs." Suggest: "All provider endpoints must be absolute HTTPS URLs, except a provider that sets allow_insecure_http for an approved demo or test endpoint."

    • crates/trusted-server-core/src/auction/README.md:151: same sentence. Suggest: "Provider endpoints must be absolute HTTPS URLs unless the provider sets allow_insecure_http for an approved demo or test endpoint."

    • docs/guide/error-reference.md:92-93: the solution for this error. Add: "Plain HTTP is accepted only when that provider sets allow_insecure_http = true, for an approved demo or test endpoint."

    • docs/guide/integrations/aps.md:132: "The common provider endpoint ... must be an absolute HTTPS URL". The flag applies to aps providers too, so add the same exception or say the flag is for demo/test providers only.

  • 🔧 prepare integration artifacts failed at this head, so the integration and browser jobs never ran. The job built every artifact, then actions/upload-artifact got an HTML page back from CreateArtifact on all 5 attempts (job log). That is a GitHub artifact-service failure, not a code failure, but it skipped integration tests, integration tests (Fastly EC lifecycle) and browser integration tests, which the description lists as still required before readiness. Re-run the workflow. Separately, cargo test (axum native) passes at 6501eede7, so the startup.rs self-connection flake prk-Jr flagged at 1cfba70a2 didn't recur this run; it is still intermittent until that fixture gets the same local-vs-peer exclusion.

  • 📌 The CLI drops core warnings. trusted-server-cli depends on log (Cargo.toml:27) but installs no logger on this base either, so anything core logs during ts config validate / ts config push is discarded, including the warning proposed at plan.rs:326. I raised the same point on #1525 and no issue exists yet. Worth a follow-up issue: either install a stderr logger at warn, or return warnings from validation.

  • 🤔 The flag accepts any host, including public ones, so plaintext auction traffic can cross the internet. No in-repo example in the stack (#1534 to #1541) sets the flag, so the demo's PBS host isn't visible from here. If demos only need a local or private-network PBS, restricting http to loopback or private addresses would bound the exposure without losing that use case. If the demo PBS is public, the docs warning should say so explicitly.

  • 📝 PR description. Head: still says 1cfba70a2; the head is 6501eede7 after two EdgeZero-tag merges (tracker #1530 has the same stale value). Several identifiers have lost their separating space ("EdgeZero83d7a629", "PR1525/1526 ready and1527/1528 draft", "Nativeb1216763a", "UID/GID10001"). Most of the description covers base-branch corrections (docs build, startup probe, browser CI host) that are not in this PR's diff. A plain summary of the behavior change, the default, and the rollback note would serve reviewers better.

  • 📝 Keep this PR and #1525 in sync. plan.rs here carries the same production change as #1525 (main), but the tests diverge: #1525 already has assertion messages and expect() where this PR has bare asserts and unwrap(). The #1525 r1 findings (warning, transport tests, docs, CHANGELOG) apply here unchanged. Whichever fixes land on one should land on the other, or the two copies drift.

Verification

  • Real binaries at 6501eede7: ts config validate --strict rejects an http:// provider without the flag and accepts it with the flag, silently; ts config push keeps "allow_insecure_http":true in the blob. A live POST /auction on Axum and on Fastly (Viceroy) reached a plaintext stub bidder and returned its bid. Fastly registered a non-TLS dynamic backend (backend_http_127_0_0_1_…_p_pbs-main_…). The base branch's ts (at 0ae96ef5f) rejects the same config with unknown field allow_insecure_http.
  • Mutation testing: 9 mutants of plan.rs against the full trusted-server-core lib suite (3005 tests). 7 killed, 2 survived (see inline at plan.rs:1163). With that suggestion applied, both are killed by their named assertions.
  • Each suggestion verified alone (fmt, clippy-fastly, core lib tests, or prettier and domain lint for the guide), and all four together through every adapter clippy and test alias plus the parity suite, with no drift between the approved and verified patches. One Axum test, managed_ingress_ignores_direct_spoof_and_isolates_two_gateway_clients, can't run on macOS (it binds 127.0.0.2, which lo0 doesn't carry) and fails identically at the unmodified head; hosted cargo test (axum native) covers it on Linux. ts dev lint domains --changed-vs on this PR's lines: clean.

CI Status

  • browser integration tests: SKIPPED
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo check/build/test (spin native + wasm32-wasip2): PASS
  • cargo fmt: PASS
  • cargo test: PASS
  • cargo test (axum native): PASS
  • cargo test (cross-adapter parity): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • CLAUDE.md symlink guard: PASS
  • docs-proposal scripts: PASS
  • format-docs: PASS
  • format-typescript: PASS
  • integration tests: SKIPPED
  • integration tests (Fastly EC lifecycle): SKIPPED
  • prepare integration artifacts: FAIL
  • vitest: PASS

Comment thread docs/guide/auction-orchestration.md Resolved
aram356 added a commit that referenced this pull request Dec 3, 2026
Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
aram356 added a commit that referenced this pull request Dec 3, 2026
Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
aram356 added a commit that referenced this pull request Dec 3, 2026
Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
Nothing reads or writes `trusted_server_runtime_kv`, yet every Fastly
service had to provision and pay for it. Remove its declaration, the
Fastly, Spin and Cloudflare adapter wiring, `KvHandleStore`, the KV
fixtures and the documentation, so `RuntimeServices::kv_store()` is
unavailable on every adapter. `trusted_server_kv` stays declared as on
the base, and a Fastly test pins that generic KV never falls through to
the request registry's default store.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as 726f638af, on top of 779e44673.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. The merge was clean and applies exactly the removal.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1532's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 726f638af to 3ea2f5fed:

Each merge message says what it carries and how any conflict was resolved.

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as db9d3d44c, on top of 3ea2f5fed.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1532's new head (f34c85bb5), which carries 48930c270 and nothing else new to this branch. The merge conflicted only in docs/guide/api-reference.md, where this branch edits the same paragraph. The resolution keeps this branch's paragraph and replaces only the sentence about paths without a local route.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack. rc/identity (e72407155) passed the full CI gate list with the change.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants