Repository navigation
Conversation
Spec and implementation plan for #1231: a [rewrite] include_domains allowlist for creative asset rewriting, case-insensitive exclude_domains matching, and a single rewrite of link imagesrcset on the inline path. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Describe the review fixes: strict include_domains validation with a separate non-ASCII error, binary-first upgrade and rollback docs, the distinct link imagesrcset candidate, the host-in-both-lists test across every handler, and the shared-step CHANGELOG entry with the sign status change. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
10 of 14 tasks
9 tasks
prk-Jr
requested changes
Oct 8, 2026
prk-Jr
left a comment
Collaborator
There was a problem hiding this comment.
Summary
Spec and plan for #1231's [rewrite] include_domains asset-host allowlist. The design holds up: the code claims check out against 7a0ecb4c, the <link imagesrcset> double rewrite is real (reproduced against lol_html 2.9.0), the shared step is byte-identical with #1249's, and the plan's snippets compile and pass clippy. One blocking issue: the include-list validator doesn't meet its own stated guarantee for some IPv6 and xn-- entries.
7 of the inline comments below carry a one-click GitHub
suggestion— use Commit suggestion (or Add suggestion to batch) to apply them. The remaining comments describe the fix in prose because it spans several places or lines outside a single range.
Blocking
🔧 wrench
- Validator's IPv6 check uses Rust's formatter, not
host_str()'s — see inline atdocs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:967
Non-blocking
⛏ nitpick
- Step 5 grep can never pass — see inline at
docs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:671 - Shared step:
is_host_permittedvisibility contradicts the plan — see inline atdocs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:312 - Only
test-fastlyruns core tests — see inline atdocs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:321 rewrite_clicksdoesn't exist onmain— see inline atdocs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:1720- Leftover sentence in Task 3 Step 2 — see inline at
docs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:876 - Module-doc anchor that doesn't exist — see inline at
docs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:1479 - Output-parity and blob-hash wording — see inline at
docs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:233 - GTM citation points at test code — see inline at
docs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:94 - Test-plan cases the plan doesn't include — see inline at
docs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:325
♻️ refactor
link[href]snippet relies on comment placement to pass clippy — see inline atdocs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:1593-1613- Task 2 red step can't be observed — see inline at
docs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.md:657
🤔 thinking
- Inert
exclude_domainsentries stay silent — see inline atdocs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.md:132
Cross-cutting / body-level findings
- 📌 Trailing-dot hosts bypass
exclude_domains(pre-existing) —https://blocked.example.com./xhashost_str()blocked.example.com., which matches neitherblocked.example.comnor*.example.cominis_host_allowed(proxy.rs:1242-1255), so it is proxied, signed and getsts-ecdespite the exclusion.include_domainsfails safe here (an off-list host stays raw). Not for this PR; worth a follow-up issue (e.g. strip one trailing.before matching). - 👍 Solid design choices — the sign handler's ordering keeps
403reserved forproxy.allowed_domains; the normalizer/policy split is clean and parse-once; the shared step with #1234 is reproducible verbatim; and the plan's red/green expectations line up with the code paths.
CI Status
- format-docs: PASS
- format-typescript: PASS
- CLAUDE.md symlink guard: PASS
- CodeQL: SKIPPED
- cargo fmt, cargo test, cargo test (axum native), cargo test (cross-adapter parity), cargo check/build/test (spin native + wasm32-wasip1), cargo check (cloudflare native + wasm32-unknown-unknown), cargo test (ts CLI, native) (ubuntu-latest / macos-latest), vitest, prepare integration artifacts, Analyze (rust / javascript-typescript / actions / python): PENDING at review time (docs-only change)
5 of 14 tasks
aram356
marked this pull request as draft
October 9, 2026 05:27
Collaborator
Round-trip include_domains entries through url::Host::parse so IPv4-mapped IPv6 and invalid xn-- entries are rejected, warn on exclude_domains entries that never match, and fix the grep, red-step, citation and wording issues raised in review. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
10 of 14 tasks
Collaborator
Author
|
Closing in favor of #1253 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[rewrite] include_domainsallowlist for creative asset rewriting. Today every absolute asset URL in a winning creative is proxied, so every third-party asset host receives the EC ID. The allowlist lets operators limit that to hosts they choose. Click-through links are not affected.[rewrite] include_domains.to_abssplit:to_absbecomes a pure normalizer,normalize_creative_url, and host policy moves toRewrite::should_proxy_assetandRewrite::should_wrap_click./first-party/sign: an off-list host gets a502, the same as an excluded host, so the browser falls back to a direct load.exclude_domains: matching becomes case-insensitive. This is a behavior change and gets a CHANGELOG note.<link imagesrcset>was proxied twice.Changes
docs/superpowers/specs/2026-10-07-1231-creative-asset-host-allowlist-design.mddocs/superpowers/plans/2026-10-07-1231-creative-asset-host-allowlist.mdCloses
Part of #1231. This PR adds only the spec and plan. The implementation PR will link the approved spec and close the issue.
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serveprettier --config docs/.prettierrc --checkon both files. This PR changes no code, so no Rust or JS gates were run. The plan was checked by implementing it in a local branch, where fmt, all clippy aliases,test-fastly,test-fastly-reuse,test-axum,test-cloudflareandtest-spinpassed. That code is not included here.Checklist
unwrap()in production code — useexpect("should ...")tracingmacros (notprintln!)