Skip to content

Restrict creative proxy identity disclosure - #1615

Draft
prk-Jr wants to merge 2 commits into
mainfrom
docs/1233-proxy-disclosure-policy
Draft

prk-Jr wants to merge 2 commits into
mainfrom
docs/1233-proxy-disclosure-policy

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Stop attaching reader EC identity to ordinary creative resources: disclosure is default-denied and requires an explicit HTTPS origin/path recipient plus a canonical cookie and current consent.
  • Evaluate every redirect independently and couple event delivery to upstream cache bypass, terminal private/no-store responses, restricted headers, and rejection of raw redirect escapes.
  • Share the policy with ts config proxy explain <URL> --json; preserve specialized integration/publisher asset fetching and verify actual CLI-to-Axum resource transport.

Changes

File Change
.github/workflows/test.yml Run the bounded Fastly proxy network fixture and runner self-checks.
crates/trusted-server-adapter-axum/src/app.rs Prepare current policy and pass the normal EC context to the creative handler.
crates/trusted-server-adapter-axum/src/middleware.rs Preserve terminal privacy when creative-route failures become HTTP responses.
crates/trusted-server-adapter-cloudflare/src/app.rs Prepare current policy and pass the normal EC context to the creative handler.
crates/trusted-server-adapter-cloudflare/src/middleware.rs Preserve terminal privacy when creative-route failures become HTTP responses.
crates/trusted-server-adapter-fastly/src/app.rs Prepare current policy and pass the normal EC context to the creative handler. Add actual withdrawal/finalization regression coverage.
crates/trusted-server-adapter-fastly/src/main.rs Register the test-only network fixture.
crates/trusted-server-adapter-fastly/src/middleware.rs Preserve terminal privacy when creative-route failures become HTTP responses.
crates/trusted-server-adapter-fastly/src/proxy_policy_runtime.rs Observe actual Fastly transport URLs, redirect stripping and exhaustion under Viceroy.
crates/trusted-server-adapter-fastly/tests/proxy-policy-origin.mjs Run an owned local origin with exact test discovery, bounded execution and cleanup.
crates/trusted-server-adapter-fastly/tests/proxy-policy-origin.test.mjs Reject missing selection, origin failure and timeouts; verify cleanup.
crates/trusted-server-adapter-spin/src/app.rs Prepare current policy and pass the normal EC context to the creative handler.
crates/trusted-server-adapter-spin/src/middleware.rs Preserve terminal privacy when creative-route failures become HTTP responses.
crates/trusted-server-cli/src/commands/config/mod.rs Register read-only proxy policy diagnostics.
crates/trusted-server-cli/src/commands/config/proxy.rs Implement shared-evaluator explain output with redaction and documented exits.
crates/trusted-server-cli/src/run.rs Wire the config proxy subcommand.
crates/trusted-server-cli/tests/config_env_overlay.rs Cover typed recipient validation and effective overlays during config publication.
crates/trusted-server-cli/tests/config_proxy.rs Exercise the actual explain command, overlays, invalid inputs and redacted output.
crates/trusted-server-cli/tests/proxy_trusted_server.rs Compare real CLI-mediated and direct Axum resource fetches for two readers.
crates/trusted-server-core/src/config.rs Reject invalid recipient configuration during typed deployment validation.
crates/trusted-server-core/src/consent/mod.rs Compose the current consent gate without generating identity or adding store work.
crates/trusted-server-core/src/integrations/google_tag_manager.rs Make shared-helper query identity explicitly disabled; preserve integration-owned behavior.
crates/trusted-server-core/src/integrations/gpt.rs Make shared-helper query identity explicitly disabled; preserve integration-owned behavior.
crates/trusted-server-core/src/integrations/js_asset_proxy.rs Make shared-helper query identity explicitly disabled; preserve integration-owned behavior.
crates/trusted-server-core/src/integrations/testlight.rs Make shared-helper query identity explicitly disabled; preserve integration-owned behavior.
crates/trusted-server-core/src/lib.rs Expose policy types and keep query mutation private.
crates/trusted-server-core/src/proxy.rs Apply authorization, narrow headers and event cache bypass before every creative send; reject terminal redirect escapes.
crates/trusted-server-core/src/proxy_policy.rs Validate and compile explicit recipients; model request consent and chain privacy.
crates/trusted-server-core/src/proxy_query.rs Remove reserved EC keys without rewriting unrelated query bytes; inspect raw redirect paths.
crates/trusted-server-core/src/response_privacy.rs Reassert terminal no-store and remove validators after operator response headers.
crates/trusted-server-core/src/settings.rs Add default-empty recipients, eager preparation and serialization/legacy-reader tests.
crates/trusted-server-integration-tests/README.md Document the evidence supplied by native policy route tests.
crates/trusted-server-integration-tests/tests/parity.rs Verify all three native routers, positive recipients, failures, redirects and rule removal.
docs/guide/configuration.md Document recipient validation, defaults, activation and rollback.
docs/guide/first-party-proxy.md Explain the revised disclosure, redirect, header and cache contracts.
docs/superpowers/plans/2026-11-16-1233-proxy-disclosure-policy.md Record implementation tasks, acceptance traceability and local verification.
docs/superpowers/specs/2026-11-16-1233-proxy-disclosure-policy-design.md Record the reviewed design, alternatives and production qualification requirements.
scripts/README.md Document the proxy network runner and its limits.
trusted-server.example.toml Show commented explicit recipients while retaining default denial.

Closes

Closes #1233

Spec

Proxy disclosure and cache policy, including two independent spec review rounds.

Implementation plan and A1–A22 traceability.

Test plan

All checked results below are local. Hosted CI is separate.

  • cargo test-fastly && cargo test-axum; also cargo test-fastly-reuse, cargo test-cloudflare, and cargo test-spin
  • cargo clippy-fastly && cargo clippy-axum; also Cloudflare native/WASM, Spin native/WASM, CLI and codegen lint aliases
  • cargo fmt --all -- --check
  • JS build, tests (3,299 passed / 80 files) and format
  • Docs format and production documentation build; Markdown checks outside docs
  • Native core library (3,408 passed; 2 existing ignored), native adapter parity (34 passed), build-digest tests (10 passed) and corresponding lints
  • Complete CLI tests including Chrome fixtures and real CLI→Axum→origin resource requests
  • Actual Viceroy network fixtures: five deadline cases and three creative proxy cases; four proxy-runner self-checks
  • Actual Fastly KV withdrawal/finalization regression; Cloudflare and Spin auction deadline runtime fixtures
  • Clock, Node pin, release producer, documentation proposal and added-line URL-host checks
  • Seven disposable-copy regression controls rejected unconditional identity, initial-hop-only query editing, absent positive wiring, missing bypass, lost chain privacy, and late validator/public-cache restoration
  • Fastly release artifact build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Production staging: actual Fastly static cache reuse and positive HTTPS event delivery/non-reuse on deployed Fastly/Worker runtimes

Configuration hardening and compatibility

Invalid recipient origins, paths, IDs, duplicate selectors and non-roundtripping paths return configuration errors during typed validation/runtime preparation; every adapter prepares settings before routing. No panic-based recipient compilation is used. Regression coverage includes proxy_identity_policy_rejects_invalid_runtime_configuration, identity_policy_rejects_invalid_origins, identity_policy_rejects_invalid_paths_and_rule_ids, identity_policy_rejects_duplicate_ids_and_normalized_selectors, and proxy_policy_rejects_selectors_changed_by_url_serialization.

Deploy the new binary before publishing a nonempty proxy.identity_endpoints configuration: older strict readers reject the new field. Empty defaults remain omitted. Existing signatures are still validated before query transformation, and removing a rule revokes future disclosure without re-signing URLs. Creative requests deliberately use a fixed user agent and restricted forwarded headers; unfollowed redirects carrying Location return 502. Integration-owned identity payloads and click behavior remain outside this policy.

Draft / release qualification

Keep this PR in draft while CI and the documented staging experiments remain unqualified. The local HTTP Viceroy fixture proves destination URL behavior, stripping and redirect exhaustion; it does not prove HTTPS recipient delivery or readthrough cache reuse. Positive HTTPS policy/cache-intent assertions use injected transports through real routes. A controlled deployed origin with counters and reader-distinct responses is still required before claiming production cache/HTTPS qualification. No deployment has been performed.

Checklist

  • Feature spec linked above and ends with two agent review rounds
  • Changes follow AGENTS.md conventions
  • No new unwrap() in production code
  • Uses log macros rather than println!
  • New code has regression tests
  • No secrets or credentials committed

Require explicit HTTPS origin and path grants plus current consent before disclosing canonical EC identity. Reevaluate every redirect and coordinate event cache bypass with terminal response privacy.

Add shared CLI diagnostics, adapter and real-network coverage, operator migration guidance, and the reviewed design and implementation plan.
@prk-Jr prk-Jr self-assigned this Nov 16, 2026

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.

Stop forwarding ts-ec to static creative assets through /first-party/proxy

1 participant