Skip to content

Honor explicit refusals across jurisdictions - #1717

Open
prk-Jr wants to merge 12 commits into
fix/1695-us-gpp-opt-out-fieldsfrom
fix/1708-explicit-refusals-everywhere
Open

prk-Jr wants to merge 12 commits into
fix/1695-us-gpp-opt-out-fieldsfrom
fix/1708-explicit-refusals-everywhere

Conversation

@prk-Jr

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

Copy link
Copy Markdown
Collaborator

Summary

  • Honor explicit refusals in NonRegulated requests: Purpose 1 denial, GPC, decoded US GPP refusal, and US Privacy sale opt-out now block EC creation and withdraw a held EC. Previously these refusals were ignored there. Unknown jurisdiction also honors explicit withdrawal; absence alone still preserves a held EC.
  • Add default-false consent.us_states.all_states to apply US rules to every US reader, including unresolved regions. No signal still permits NonRegulated creation.
  • Cover the policy, cookie expiry/tombstoning and config parsing with regressions, and verify actual Axum behavior through the approved RC integration.

Stacked on #1714. Implementation branch: fix/1708-explicit-refusals-everywhere. PR target: fix/1695-us-gpp-opt-out-fields; base commit 83e447d052483520422e9e43ef7d6303d447e6a2. Retarget to main after #1714 merges.

Changes

File Change
crates/trusted-server-core/src/consent/mod.rs Add shared refusal detection and honor it for NonRegulated creation and NonRegulated/Unknown withdrawal; add policy and decoded-request regressions.
crates/trusted-server-core/src/consent/jurisdiction.rs Apply US rules everywhere in the US when all_states is enabled; test detection, minting policy and GDPR precedence.
crates/trusted-server-core/src/consent_config.rs Add the serialized/deserialized all_states setting with false default.
crates/trusted-server-core/src/settings.rs Cover omitted/default and true/false TOML/JSON settings parsing.
crates/trusted-server-core/src/ec/finalize.rs Prove a NonRegulated TC refusal expires a valid held EC and tombstones its record.
trusted-server.example.toml Document the new configuration key.
docs/guide/configuration.md Describe the key, jurisdiction behavior, refusal signals and proxy limits.
docs/guide/gdpr-compliance.md Explain all-states policy and explicit withdrawal behavior.

Closes

Closes #1708

Spec

The new configuration option is specified in Explicit refusals and optional US policy for all states, with two independent review rounds recorded. The existing refusal bug fix accompanies that option.

Related changes

#1705 is separate: it maps a US request with no resolved region to UsState("US") regardless of all_states. With both changes, missing US region always uses strict US rules and no signal does not mint. For a resolved unlisted state, all_states=false preserves NonRegulated no-signal creation while honoring explicit refusals; all_states=true applies US rules and requires a signal. Listed states keep US rules. Publisher-configured GDPR classification retains precedence.

#1613 follow-up, intentionally outside this patch: in verify_country_only_consent_rules in the Fastly identity conformance suite (the case linked by #1708), replace the expired == gdpr_override expectation with unconditional assert!(expired, "should expire held EC after explicit refusal regardless of GDPR override"). Replace the record_is_live(...) == !gdpr_override expectation with unconditional assert!(!geo_consent::record_is_live(&adapter.store, &identity), "should tombstone held identity after explicit refusal regardless of GDPR override"). Both iterations should expire and tombstone the held identity. No conformance file is imported here.

Test plan

The following targeted checks ran before commit approval on the reviewed source. No CI gates were rerun for publication; full CI is delegated to GitHub Actions, with CI failures reported by the author. Signed commit 91430630979dd73507552081825e08e3a5e25329 contains the exact reviewed/tested patch; its diff SHA256 matches the review record.

  • Baseline core consent tests: 125 passed.
  • Fail first: all four refusal signals allowed creation and did not withdraw in NonRegulated; Unknown did not withdraw. The unlisted-country decoded TC test allowed creation; held-EC refusal emitted no expiry. all_states parsing failed before implementation.
  • cargo test --locked -p trusted-server-core --lib consent::: 130 passed.
  • cargo test --locked -p trusted-server-core --lib consent_config::: 10 passed.
  • cargo test --locked -p trusted-server-core --lib settings_parses_us_all_states: 1 passed.
  • cargo test --locked -p trusted-server-core --lib ec::finalize::tests::: 42 passed.
  • cargo clippy --locked -p trusted-server-core --all-targets --all-features -- -D warnings: passed.
  • Changed Rust file formatting, changed guide page Prettier, and git diff --check: passed.

Follow-up correction 9aa868a37 omits disabled all_states during serialization so strict older readers accept the default configuration; enabled true remains explicit and requires a supporting binary. Actual full-source native checks pass: Settings 219, consent configuration 12, consent policy 130, EC finalization 42, and core all-target/all-feature Clippy. Restoring default-false emission fails both compatibility and actual Settings regressions. The required spec passed two independent review rounds and includes propagation-aware rollback. All 24 current-revision hosted checks pass, with workflow records confirming head 9aa868a371625f884ddf2f291ad7f281fee55cb6 and base 83e447d052483520422e9e43ef7d6303d447e6a2; prior runtime qualification remains separate.

Runtime verification: VERIFIED on the actual Axum application in the author-approved disposable RC integration. Main-based Axum lacks geo and EC lifecycle wiring; this is RC integration evidence, not a main-only Axum certification.

  • Built normal trusted-server-axum using cargo build --locked -p trusted-server-adapter-axum --features geo-cloudfront, Rust 1.98.1, Node 24.20.0, with dev debug info disabled. No adapter/wrapper or EdgeZero source changes.
  • Runtime base c3e33666604d5d3b6e043fc206931b3681c8f3bf plus Honor all decoded US GPP opt-outs #1714 and this candidate; integrated patch SHA256 cabf974831d9a4cf84eb1f6ad43cd3cf1f89b1bbb80a03a22960c237b535f67e. Tested binary SHA256 ea50da42eea9db9eacd9aafc77993837496ffcba33c8fb5e35f7914668160aff.
  • Consent policy, config and GPP decoder production code exactly matched the candidate; jurisdiction code matched apart from preexisting RC comments. RC test/doc conflicts were resolved by preserving RC tests and the existing config table while adding the new key. Candidate regression tests were run on the Honor all decoded US GPP opt-outs #1714-based implementation, not claimed as RC tests. The RC-only old us_sale_opt_out assertion still needs its Honor all decoded US GPP opt-outs #1714 migration before RC test compilation; that test is excluded from the normal runtime build.
  • Fictional publisher.example.com config loaded through the supported local config-store envelope, fake secret references, loopback origin and persistent records. All ten requests returned 200, the origin sentinel and x-geo-country: JP with no region. Logs confirmed NonRegulated and decoded TCF/direct GPC reached EC eligibility.
  • No signal minted a nonempty EC with Max-Age=31536000; an existing no-signal EC was retained without refresh or expiry.
  • A fresh, dynamically dated TC string with Purpose 1 denied blocked minting and expired a separately minted live EC with ts-ec=; ... Max-Age=0. Repeated refusal did not mint.
  • Sec-GPC: 1 blocked minting and expired another separately minted live EC with the same deletion attributes. Repeated GPC did not mint.
  • Both owned servers stopped. Preserved headers, logs, fixture script, source patch and tested binary outside the repository. Reversed only the owned integration patch and removed the clean scratch worktree, confirming its registration was gone. The implementation worktree was retained clean at that runtime checkpoint; the completed review/fix worktrees have now been removed.
  • Runtime verification used no browser, DataDome interaction, staging/production tasks, deployment, operator config changes or GitHub mutations. This PR does not change the project board or request reviewers.

Checklist

  • Changes follow AGENTS.md conventions.
  • New behavior has regression tests.
  • No operator config, credentials, EdgeZero changes, project-board changes, browser runs or staging/production tasks.
  • Local self-review and runtime evidence recorded.

@prk-Jr prk-Jr self-assigned this Nov 30, 2026
@prk-Jr
prk-Jr marked this pull request as ready for review December 1, 2026 12:50
@prk-Jr prk-Jr linked an issue Dec 1, 2026 that may be closed by this pull request
1 task
@prk-Jr
prk-Jr added this pull request to stack #1719 December 1, 2026 13:25

@ChristianPavilonis ChristianPavilonis 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.

Reviewed 9aa868a37 against #1714's head (83e447d05); only this PR's diff.

Approving so I'm not blocking, on the understanding that you'll handle the comments before merging. No behavioral problems in what it sets out to do.

Policy questions I'd like answered, even if the answer is "intended":

  • GDPR still only looks at TCF. With gdpr.applies_in including US, a reader sending GPC or a GPP US opt-out alongside a TCF grant still gets an EC, while the same reader in an unlisted country is now refused. That predates this PR, but the title says "across jurisdictions". Is GDPR meant to stay TCF-only?
  • gpc_implies_optout = false doesn't exempt GPC from refusing and withdrawing in non-regulated and unknown jurisdictions. UsState already behaved this way. Confirm publishers shouldn't get an opt-out from GPC-as-refusal outside the US?

Coordination with #1718: docs/guide/configuration.md says an unresolved US region "currently falls back to NonRegulated", and all_states_switch_controls_unlisted_us_no_signal_creation asserts creation for region None. Both become wrong once #1718 lands.

Checks: cargo test -p trusted-server-core --lib filtered to consent, consent_config, the all-states settings test and finalize non-regulated (144 passed), native clippy on core, cargo fmt --check.

// ---------------------------------------------------------------------------

/// Returns whether a decoded signal explicitly refuses EC storage.
fn explicit_refusal(ctx: &ConsentContext) -> bool {

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.

R1 · Nonblocking: explicit_refusal duplicates the existing US-state withdrawal rule. The UsState branch of has_explicit_ec_withdrawal (around lines 601-617) computes the same thing as four early returns: GPC, GPP opt-out, USP opt-out, then !has_storage_consent(). All four are pure, so the copies agree today. But the next change to what counts as a refusal has to land in both, and if it doesn't, UsState and non-regulated withdrawal drift apart, which is the bug this PR fixes. Collapsing the withdrawal match to UsState(_) | NonRegulated | Unknown => explicit_refusal(ctx) keeps every decision the same and drops about 17 lines.

return Jurisdiction::UsState(region.to_uppercase());
// The all-states policy also covers US readers with no resolved region.
if geo.country.eq_ignore_ascii_case("US") {
if config.us_states.all_states {

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.

R2 · P3 (logs and docs): UsState now carries values its docs and Display don't expect. With all_states = true this produces UsState("WY") for an unlisted state and UsState("US") when the region is unresolved. The variant doc still says "a US state with an active comprehensive privacy law", and Display prints the sentinel as US-US in the EC and consent context logs. #1718 fixes both (variant doc plus a "US" arm in Display). Either carry the same edit here or let #1718 land first and rebase, so whichever merges first doesn't leave wrong logs behind.

/// Apply US state rules to every US reader, including unresolved regions.
///
/// Defaults to `false`, using [`Self::privacy_states`] to select regions.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]

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.

R3 · Nit: use the repo's is_false convention. settings.rs already does "skip while false so older strict readers accept the default" with skip_serializing_if = "is_false" and a doc paragraph explaining why (around settings.rs:106-110). Here it's std::ops::Not::not and the doc only says "Defaults to false". Since that rollback reason is the point of 9aa868a37, please add the sentence ("Skipped while false: UsStatesConfig denies unknown fields, so a default blob must stay readable by older binaries."), and optionally reuse settings::is_false.

@dhruv8sh dhruv8sh 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

This PR adds a shared explicit_refusal helper. In NonRegulated requests, a decoded TCF Purpose 1 refusal, GPC, a GPP US opt-out or a US Privacy sale opt-out now blocks EC creation, and in both NonRegulated and Unknown it withdraws a held EC. The PR also adds an opt-in consent.us_states.all_states switch, and the switch is serialized only when it is true, so older strict readers can still parse the default config. The logic is correct, GDPR still takes precedence, and the tests cover every refusal signal, a real decoded TC string, finalizer cookie expiry with a tombstone write, and serialization in both directions. I found no blocking issues. The open points are a policy question about applying GPC to every reader, a docs example that conflicts with the PR's own rollout guidance, and a cosmetic log label.

1 of the inline comments below carries a one-click GitHub suggestion. Use Commit suggestion to apply it as a commit on the PR branch. The other comments are discussion points or need no change.

Non-blocking

🤔 thinking / ⛏ nitpick

  • GPC now withdraws ECs for every non-regulated reader, and gpc_implies_optout cannot turn this off — see inline at crates/trusted-server-core/src/consent/mod.rs:509
  • Uncommented all_states = false in the GDPR guide's example breaks older TOML readers — see inline at docs/guide/gdpr-compliance.md:104
  • An unresolved region shows as US-US in logs — see inline at crates/trusted-server-core/src/consent/jurisdiction.rs:70

👍 praise

  • The default stays readable by older binaries — see inline at crates/trusted-server-core/src/consent_config.rs:194

Cross-cutting / body-level findings

  • 🏕 The configuration guide no longer lists the removed consent_store key — the old table still described consent_store as an optional KV store, but the key is already rejected (settings_rejects_removed_consent_store_toml). This PR fixes that stale entry.

/// Returns whether a decoded signal explicitly refuses EC storage.
fn explicit_refusal(ctx: &ConsentContext) -> bool {
effective_tcf(ctx).is_some_and(|tcf| !tcf.has_storage_consent())
|| ctx.gpc

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.

🤔 thinking — Treating ctx.gpc as an explicit refusal in NonRegulated is a big change in practice. Some browsers send Sec-GPC: 1 by default (Brave, for example), so from this release on, every such reader in any unregulated country loses their held EC and never gets a new one.

That is consistent with the UsState branch, which also ignores us_privacy_defaults.gpc_implies_optout. But the change also means a publisher has no config switch to limit GPC handling to regulated regions. Two points to settle:

  1. Is that the intended product decision for Honor explicit refusals in every jurisdiction #1708? If so, please add a sentence to docs/guide/configuration.md saying gpc_implies_optout = false does not stop GPC from withdrawing ECs in NonRegulated or Unknown. As written, that table row ("Treat Sec-GPC: 1 as sale opt-out") suggests it does.
  2. Expect a visible drop in EC coverage outside the US and EU after rollout. Release notes should call this out.


[consent.us_states]
# Apply US state rules to every US reader, even without a resolved region.
all_states = false

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.

⛏ nitpick — This example writes all_states = false uncommented. The PR's own rollout notes in configuration.md say older tools that read TOML directly reject the key even when it is false, so a publisher who copies this example and then uses an older CLI or binary gets a parse error. Commenting it out matches trusted-server.example.toml and keeps the example valid for every reader.

Suggested change
all_states = false
# all_states = false

// The all-states policy also covers US readers with no resolved region.
if geo.country.eq_ignore_ascii_case("US") {
if config.us_states.all_states {
return Jurisdiction::UsState(geo.region.as_deref().unwrap_or("US").to_uppercase());

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.

⛏ nitpick — When the region is unresolved, this produces UsState("US"), and Display turns that into US-US in the jurisdiction= debug and info logs (consent/mod.rs:684, ec/mod.rs:346, ec/mod.rs:394). Nothing depends on the label, so it works. But a reader of the logs can't tell "region unresolved" apart from a real region code. A sentinel such as "UNRESOLVED" (US-UNRESOLVED) would be clearer if you want to change it. The all_states_applies_us_rules_with_or_without_region test would need the same change.

/// Apply US state rules to every US reader, including unresolved regions.
///
/// Defaults to `false`, using [`Self::privacy_states`] to select regions.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]

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.

👍 praise — Using skip_serializing_if = "std::ops::Not::not" together with the strict LegacyUsStatesConfig test is a careful way to keep the "push config with a newer CLI before upgrading the binary" flow working with deny_unknown_fields readers. The test that an enabled payload is rejected by the legacy reader also documents the rollout ordering well.

PR #1717 stays on PR #1714's branch, which now sits on PR #1662's branch, the top of the identity chain trunk, instead of main. PR #1714's new head brings the identity integration chain as of round 12 wave A under #1714's US GPP opt-out fix.

crates/trusted-server-core/src/consent/jurisdiction.rs: #1717 lets `us_states.all_states` apply US rules to every US reader and adds two tests for it. The chain reworded the module docs, imported consent_allows_server_side_auction for its tests, and added publisher list and geography tests at the same place. The resolution keeps #1717's detection change, the chain's import, and both sets of tests, the chain's first. With all_states off, #1717 leaves detection unchanged, so the chain's tests keep their expectations.

crates/trusted-server-core/src/ec/finalize.rs: #1717 added a test that a non-regulated TC Purpose 1 refusal expires and tombstones a held EC. The chain made finalize async with a FinalizeRequest and made its tests tokio tests. The resolution keeps the chain's tests and ports #1717's test to the async graph and FinalizeRequest, with no navigation permit, since withdrawal tombstones on any finalized request.

docs/guide/configuration.md: #1717 added the `us_states.all_states` row to the consent table and rewrote the intro about the removed consent_store key. The chain rewrote the same intro to describe the one EC record service. The resolution keeps the chain's intro and #1717's table with the new row.

crates/trusted-server-core/src/consent/mod.rs (merged clean, failed to compile): #1717's unlisted_country_decodes_purpose_one_refusal test builds a GeoInfo with main's fields. The resolution builds the chain's GeoInfo with GeoInfo::country_region("JP", None).
PR #1714's new head brings wave B from PR #1662: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806. The merge is clean.
@aram356
aram356 removed this pull request from stack #1719 December 1, 2026 23:13
aram356 added a commit that referenced this pull request Dec 1, 2026
One octopus merge of the round 12 tips into rc/identity c3e3366. It is a single octopus because the RC already holds every sibling's old head, so each tip's new head merges in alongside the others rather than as a chain of merges. The tree is the automatic merge of the RC and all tips, with no resolution: every tip pair, their union and the merge into the RC are clean.

Tips, in parent order after the RC:

- PR #1503 at 4225024
- PR #1653 at 4bd4903
- PR #1654 at 95cf3e8
- PR #1655 at 05c509d
- PR #1622 at afe5217
- PR #1660 at c1a05d7
- PR #1666 at 108b122
- PR #1659 at 5fb8190
- PR #1709 at 6d152f6
- PR #1710 at dcceeee
- PR #1713 at cae7801
- PR #1557 at 302e972

PR #1659 sits above PR #1718, so it carries PR #1714, PR #1717 and PR #1718.
@aram356
aram356 added this pull request to stack #1721 December 1, 2026 23:14
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Round 12 identity realignment: rc/identity is now at db7dce634, and EdgeZero is pinned to its rc/identity at 8a73c097. This branch fast-forwarded from 9aa868a37 to f9f3278fc:

Merges #1714's new head, now on the identity chain. The refusal-tombstone test is ported to the async FinalizeRequest API, and configuration.md keeps the chain's intro with this PR's all_states row. #1718 is now stacked on this PR.

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

PR #1714's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1714's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1714's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage, #1535's Sourcepoint consent mirror deduplication and consent update coverage, #1636's stronger after-response body and drain checks, #1626's enforcement of stored and carried provider opt-outs, #1656's strict browser gate wording, #1661's grouped QUIC JA4 fixture and #1662's consent-string comment on the EC route fixture. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 15 identity realignment: rc/identity is now at 391a08578, and EdgeZero is pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 7a0531440 to 5fdfe0c49:

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

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

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Cascade of #1533's Axum startup-test port fix (779e44673): 5c754312b merges it into this PR. There were no conflicts and nothing else changed. The fix moves free_loopback_port in crates/trusted-server-adapter-axum/tests/routes.rs below the ephemeral port range, and #1533's note has the details. Owner commits pushed to other chain PRs since round 15 come in with the next round. rc/identity is now 62f8e41e2.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as 9ccc4e0f2, on top of 5c754312b.

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. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped. The Axum README and docs/guide/axum-dev.md keep this branch's Axum wording.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1714's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in and #1646's fix that preserves filter headers through identity finalization. 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 9ccc4e0f2 to 5b9c7e820:

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

Trusted Server owns the `/_ts/` namespace: a request for a `/_ts/` path
that no route handles is answered locally on every adapter and never
reaches the publisher origin.

The publisher forward answers such a path with a JSON 404 before any
auction, template cache or origin work. The path is matched on its
percent-decoded bytes, so `/%5Fts/x`, `/_ts%2Fx` and multi-encoded
spellings count, even when another escape in the path is not valid
UTF-8. Registered routes and integration or asset routes configured
under `/_ts/` keep working, and publisher paths such as `/_tsx`,
`/_ts-foo` and `/articles/_ts/x` still reach the origin. The
`/_ts/admin` fallback answers are unchanged.
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 0c4e23f48, on top of 5b9c7e820.

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 48930c270 directly, not #1714's new head, because #1714's head carries eb7a187ee and this branch does not have it yet. It conflicted in docs/guide/api-reference.md, resolved by keeping this branch's paragraph and replacing only the sentence about paths without a local route, and in the Cloudflare tests/routes.rs, resolved by keeping this branch's tests first and the new /_ts/ test after them.

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; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. 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.

Honor explicit refusals in every jurisdiction

4 participants