Repository navigation
Conversation
Add the ID-7 family rule in core. The TLS client family comes from the JA4 cipher-suite hash (JA4_b), matched against public FoxIO JA4+ mapping entries for Chromium, Firefox, Safari, Python and Go. When it contradicts the browser family the User-Agent claims, `DeviceSignals` marks the client a known non-browser, so both browser gates refuse creation and the record's `known_browser` analytics reads false. An unlisted JA4, no JA4, or a User-Agent that claims no browser never blocks, and iOS browsers are checked only against non-browser stacks. The shared app now reads JA4 only from EdgeZero's request ingress, the source of `ctx.ja4()`, so the Fastly adapter no longer derives device signals from the SDK's JA4, and Axum applies the rule when EdgeZero's trusted JA4 proxy header is configured. The shared conformance suite gains a contradicting-JA4 scenario that the Fastly and Axum runners supply. Refs #1592
A TLS-intercepting proxy replaces a reader's JA4 with its own. When that JA4 is a listed non-browser stack (Python, Go), the ID-7 rule refuses every reader behind the proxy. Setting allow_non_browser_tls = true stops a non-browser stack from contradicting a browser User-Agent; a browser-engine mismatch is still refused. The key is off by default and skipped from serialization at its default, so older runtimes still load a config that leaves it unset. Refs #1592
A boolean could only exempt non-browser TLS stacks. An operator who needs the JA4 rule off entirely, for example behind a proxy that re-terminates TLS with a browser library, had no switch. [ec].ja4_contradiction_exempt takes off (default, every contradiction blocks), non_browser (a Python or Go stack behind a browser User-Agent is allowed, an engine mismatch still blocks) or all. It follows the browser_gate pattern: snake_case values, unknown values rejected, and skipped from serialization at its default so older runtimes still load a default blob. The unreleased boolean is gone. read_request no longer trusts a DeviceSignals request extension: it derives signals for every request from the User-Agent and the JA4 in EdgeZero's request ingress, so no caller can bypass the rule. Tests and both conformance runners now supply JA4 through RequestIngress. Under Viceroy the Fastly runner cannot reach EdgeZero's own capture, which reads get_tls_ja4() of a client request and drops hook-supplied ingress, so a test-only middleware fills the ingress JA4 claim that capture would make. The conformance suite also checks a browser-engine mismatch and current Firefox and Safari JA4s on every runner, per ID-7. JA4 and User-Agent fixtures move into test_support::ja4, stale doc comments about adapter-derived signals are corrected, and the changelog marks the refusal as breaking and drops the claim that a refused request stores known_browser = false. Refs #1592
Keep only non-browser cipher hashes specific to one client library: the FoxIO Python row whose 18 suites are CPython's own default-context list. Drop the 43-suite Python row and every GoLang row, which are TLS library default lists that proxies built on those libraries also send. Add DeviceSignals.ja4_contradiction for the ID-7 rule, read by allows_creation, so known_browser and telemetry's is_known_browser keep their allowlist meaning and a contradiction is not stored. Pin that a JA4 EdgeZero's parser rejects as malformed counts as none (no ja4_class, no contradiction, strict refuses, lenient allows), and that Cloudflare's EC route answers 501 whatever Bot Management's JA4, because Cloudflare binds no EC record store yet. Document both. Refs #1592
…ate' into feat/1592-ja4-ua-contradiction # Conflicts: # docs/guide/configuration.md # trusted-server.example.toml
…ate' into feat/1592-ja4-ua-contradiction
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642, #1646, #1626 and #1656, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. Restacking on the Axum serving line conflicts in CHANGELOG.md and the Fastly main.rs imports. Fastly imports: this PR drops the DeviceSignals import and #1617 drops HEADER_X_TS_VERSION with the old /health response, so neither remains. CHANGELOG: this PR's JA4 contradiction entry stays first under Changed, followed by #1617's breaking health and readiness entry. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Known non-browser fixtures: #1646's aa31559 marks a refused client by inserting DeviceSignals with known_browser Some(false) into the request, in the Fastly test identity_writes_are_refused_only_for_known_non_browsers and in both conformance runners for its known non-browser navigation and EC route checks. This PR derives the signals from the User-Agent and the trusted JA4 instead, so an inserted DeviceSignals is not read. The merge keeps #1646's test and checks and gives their known non-browser a Chrome User-Agent with a trusted Python JA4, the contradiction this PR refuses, as this PR already does for the /auction body ingest test: the Fastly test inserts it as a runtime TLS JA4, and the Fastly and Axum runners supply it in place of the navigation's JA4 for a known_non_browser API request. Fastly signal tests: ingress_browser_signals_reach_ec_finalize_state keeps this PR's looks_like_browser assertion and adds #1646's check that a browser keeps the KV-backed finalize path. request_without_browser_signals_does_not_look_like_a_browser and this PR's contradiction test stay beside #1646's write test. Device signals doc: this PR's known_browser and ja4_contradiction entries stand, and the module doc keeps #1646's and #1656's refusal rules: under the lenient gate only a known non-browser or a JA4 contradiction refuses creation and record writes, and the strict gate also refuses missing signals. Settings: this PR's `ja4_contradiction_exempt` and #1488's `hashed_email` both follow `browser_gate` in Ec and in its Default; the merge keeps both. The Axum conformance runner drops #1646's now unused DeviceSignals import.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. This PR already carries #1646's head 461aa0d, so the merge adds only #1646's new merge 166944769 of #1642 and the chain below it, including the identity conformance check that now strips the mirrored UID's exp. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. Restacking on the Axum serving line conflicts in the Axum startup tests, where #1617 waits for /ready, since liveness stays up after a caught initialization failure, and this PR rewrites the wait to retry a port collision and to require the child's own ready lifecycle event. Axum startup tests: wait_ready keeps this PR's collision retry and lifecycle check, then probes #1617's /ready and returns the /health response once the child is ready. The fixture drains each child's output through this PR's log readers, so #1617's assert_serves_failure_router reaps the stopped child and reads those captured logs instead of collecting the pipes, which the readers already own. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661 (refusing EC creation when a trusted JA4 contradicts the User-Agent). Fastly identity conformance fixture: #1661 records each scenario's runtime TLS JA4 through a RuntimeTlsJa4 middleware in place of derived device signals, takes the User-Agent from the scenario and drops the browser flag. This PR adds geo consent requests with their own trusted client IP settings and no browser device signals. The merge assembles the conformance app with #1661's middleware and keeps this PR's geo_configured flag and producer_settings. It sends the scenario's User-Agent unless the API request supplies one, and inserts the scenario's JA4 only for requests without a geo consent exchange, because this PR derived device signals only for those. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Fastly conformance JA4: the rebuilt #1661 merge supplies a trusted Python JA4 behind the Chrome User-Agent for #1646's known non-browser API requests, and this PR inserts the scenario's JA4 only without a geo consent exchange, with its producer_settings. The merge keeps both: a known non-browser request gets the Python JA4, any other request the scenario's JA4 unless it is a geo consent exchange. This PR's head moves to e8015ca, its clean merge of #1646's aa31559, which the base already carries, so it adds no change beyond the base. Axum lib.rs: the base now carries #1636, through #1626's merge of it, whose after_response_drain_tests module sits where this PR adds its geo_conformance module. The crate keeps both test modules.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. The merge also brings the 12 #1646 commits this PR lacked, from 48a43ae to 461aa0d: dhruv8sh's page-phase lookup and /auction EID work (48a43ae, 82fe088, 1d0a74f, 838586e and his chain merges a061c01, ecf16e8, e1d23a0, edcf4c5 and 9a020e1), the merge 9cad928 of #1641 into #1642, and prk-Jr's "Merge providers-awaited into shared identity" (4ffbaf8) and "Restore Fastly auction browser gating" (461aa0d). Edge cookies guide: a conflict is the request lifecycle paragraph. The merge takes #1646's sentences on positive identity cookies, core expiries and /auction body EIDs, and keeps this PR's closing sentences on the default ec.sliding_refresh = false flow and sliding renewal. Fastly adapter tests: 82fe088 from #1646 removed the navigation-lookups thread-local and the page-lookups argument of apply_edgezero_ec_finalize, since the handler now collects page lookups onto the EC context. This PR's sliding_ec_renews_held_publisher_identity_before_terminal_privacy test drops its two take_navigation_lookups calls and passes no page lookups to finalize. Its configuration has no record store or providers, so no lookups were collected before either, and its assertions are unchanged. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661 (refusing EC creation when a trusted JA4 contradicts the User-Agent). Cloudflare route tests: both PRs add a test at the end of the file. The merge keeps both, this PR's sliding_ec_configuration_preserves_unsupported_platform_responses and #1661's ec_route_creates_no_record_whatever_the_bot_management_ja4. Fastly sliding EC test: #1617, which now sits below this PR, answers GET /health through the router's probe hook as an operational response, which carries no EC state. This PR's sliding_ec_renews_held_publisher_identity_before_terminal_privacy routes /health through the router and expected EC state on every path but the unsupported EC route, so it now also accepts the liveness probe without EC state. Its check that /health issues no renewal cookie is unchanged. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Settings: this PR's MaxAgeDays and #1488's HashedEmailSource are both added before Ec in settings.rs; the merge keeps both. This PR's head moves to fbe5670, its merge of #1646's aa31559, which models admitted clients in the core sliding tests, finalizes them with the store gate and adds refused_client_gets_no_renewal_or_record_io, and adds the proposal's review log. Taken as the change from the old head 668d501, the new head would replay #1646 commits the base already carries in rebuilt form. The merge takes only fbe5670's own resolution, the change from a plain merge of 668d501 and aa31559 to fbe5670: the sliding tests and the proposal apply cleanly, and its Fastly sliding test port is the one this merge already made.
…1622 into rc/identity #1622 (244ca26) now carries the whole chain, each PR merging the one below it: - #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. - #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds b2d4bfd, which records known UID hashes with a setter. - #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and #1532. - The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627, chained, with #1627's b958107 decoding the Spin discovery document with Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin into the chain. - The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared after-response runner in ec::app::lookups. - #1636 (72096cd) on #1646 (b5a5f62), draining Axum after-response identity tasks on SIGTERM through #1646's shared runner. - The EC route line on #1636: #1626 (067531e), which merges #1636, the draft #1656, #1661, #1662 and #1622, and through #1622's merge of it, #1620's round-6 head. Each conflict was resolved in the PR that sits higher. This merge is clean. Since the last update the chain also takes #1488's hashed-email intake (a610152 and 9104fd3) and its POST, body and header options for the status call (f063a76), #1627's split of the generic runtime KV store into trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for rejected clients (aa31559) its native container test of the failure router (4f4c036) and that test's header check on an ordinary route (71a573a), #1626's withholding of a mirrored UID while another source owner is opted out (d07f789), and #1617's description of the Axum startup failure router (6d174a8) and of the startup failures that still exit before listening (4c07cad). #1636 no longer sits in the Axum serving line; it arrives through #1626, which merges it on top of #1646. Its new head adopts #1646's after-response runner in place of the one rc/identity took with cf1102c. Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph, and fixes #1625's smoke script test for #1617's Python floor and Worker build, and #1537's merge fixes its ts stub for #1537's storage template step, so this merge needs no resolution.
|
For the identity integration branch (#1608), I pushed
|
|
For the identity integration branch (#1608), I pushed |
|
For the identity integration branch (#1608), I pushed |
|
For the identity integration branch (#1608), I pushed Takes #1656's new head f03c64a, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities). The merge is clean. |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
The default behavior matches ID-7, and the Fastly and Axum conformance tests pass on the reviewed tree. Before merging, please confirm whether ID-7 allows an operator exemption and whether a contradiction should also stop updates to existing EC records. Both are reasonable policy choices, but they should be explicit in the design and release notes.
The conformance tests verify cookie and record behavior with supplied ingress metadata. They do not verify native JA4 capture.
| ja4: &str, | ||
| exempt: Ja4ContradictionExempt, | ||
| ) -> bool { | ||
| if exempt == Ja4ContradictionExempt::All { |
There was a problem hiding this comment.
Confirm the ID-7 exception before merging. ID-7 requires refusal on a recognized contradiction. The default still complies, but the new exemption can waive that refusal under either browser gate. If the proxy compatibility exception is approved, please record its scope and update the acceptance criteria. Otherwise, keep the refusal unconditional.
| insert_ja4( | ||
| request.extensions_mut(), | ||
| captured_ja4( | ||
| if known_browser { |
There was a problem hiding this comment.
Does ID-7 also cover existing-record updates? This fixture confirms that a contradiction stops /auction from saving consented EIDs to a live row, even though /auction never creates an EC. The same gate also suppresses ordinary navigation writes and provider dispatch for returning readers. If that broader scope is intentional, please document it in the design and breaking-change note. If not, leave existing-row-only operations on the prior gate. Keep the withdrawal exception and the explicit EC POST’s provider refusal either way.
| counts as no JA4 under both rules. `strict` blocks everything `lenient` | ||
| blocks. | ||
|
|
||
| `ja4_contradiction_exempt` names the JA4 contradictions that stop blocking |
There was a problem hiding this comment.
Document rollout and rollback order if the exemption stays. Older runtimes reject the entire config when it contains a non-default exemption. This matters on Axum with shared AppConfig: rolling back the image alone can leave the old runtime unable to become ready. Upgrade readers before publishing the key, and restore compatible config before rolling back the runtime.
| request.user_agent = FIREFOX_USER_AGENT; | ||
| request.ja4 = Some(CHROMIUM_JA4); | ||
| } | ||
| Self::CurrentFirefox => { |
There was a problem hiding this comment.
Exercise ID-7’s unlisted-JA4 case through the adapters. The Chrome, Firefox, and Safari positive cases all use listed cipher hashes. The core test checks eligibility for one unlisted value, but it never observes a cookie or stored row. Please keep the matching-family controls and add unlisted-JA4 positive cases to the shared Fastly and Axum suite.
|
|
||
| The shared application creates a new EC record before issuing its cookie on an eligible publisher document navigation of any method, or an admitted same-origin `POST /_ts/api/v1/ec`. Document classification uses `Sec-Fetch-Dest: document` or, without Fetch Metadata, an `Accept` header naming `text/html`. Fastly and Axum retain navigation eligibility on HTML error documents and exclude redirect statuses 301, 302, 303, 307 and 308. A navigation returning `304 Not Modified` retains its lifecycle permission even without Content-Type, because it validates the cached document. Positive identity cookies remain restricted to eligible document and EC responses; core-generated EC, configured SharedID/companion and mirror expiries may accompany any already-finalized response, as described below. An EC ID collision on create retries with a fresh ID, up to five attempts, inside that request's one creation write. Integration proxies and `/auction` use an existing EC but never mint one. Partner identify and batch-sync routes also skip generation. `/auction` may conditionally save explicit body EIDs into an existing live record without issuing positive identity cookies. During pre-routing, Trusted Server builds consent from request-local cookies, headers, geolocation, and policy defaults; it does not load consent from a separate KV store. The document-navigation flow is shown below. | ||
|
|
||
| Creation also checks the client's TLS fingerprint where the runtime supplies a trusted one. Trusted Server reads JA4 only through EdgeZero (`ctx.ja4()`): Fastly fills it from the client TLS connection, and Axum only from a trusted proxy header: EdgeZero's protected CloudFront path (`CloudFront-Viewer-JA4-Fingerprint`), or the header named by `EDGEZERO__ADAPTER__JA4_HEADER` from peers in `EDGEZERO__ADAPTER__JA4_TRUSTED_PROXY_CIDRS`. EdgeZero discards a value that is not a well-formed JA4 fingerprint, so it counts as no JA4. Cloudflare fills `ctx.ja4()` from Bot Management, but Cloudflare has no EC record store yet: it creates no ECs, its EC route answers `501` before identity is read, and the rule does not run there. When the JA4's TLS client family contradicts the browser family the User-Agent claims, the request creates no EC under either `ec.browser_gate` rule. That covers a browser User-Agent over a non-browser TLS stack and a User-Agent of one browser engine over another engine's stack, such as a Firefox User-Agent with a Chromium JA4. The family comes from the JA4 cipher-suite hash (its middle section), matched against a short table of public FoxIO JA4+ entries in `crates/trusted-server-core/src/ec/ja4_family.rs`. The table names Chromium, Firefox and Safari, and one non-browser stack: Python's own default TLS context. It lists no Go entry and no other Python entry, because those cipher lists are a TLS library's defaults that every program built on the library sends, including scanning and corporate proxies, so Go clients and Python clients that replace the default context are not checked. A JA4 the table does not list, a missing JA4 and a User-Agent that claims no browser never block, and iOS browsers are only checked against non-browser stacks. A TLS-intercepting proxy in front of a reader replaces the reader's JA4 with its own, so a listed non-browser proxy stack blocks creation for its users. Set `ec.ja4_contradiction_exempt = "non_browser"` to exempt non-browser TLS stacks while a browser-engine mismatch still blocks, or `"all"` to exempt every contradiction (see [EC Configuration](/guide/configuration#ec-configuration)). Only JA4 section 1 is stored; the rule reads the full value in memory. A contradiction is not stored and does not change the stored `known_browser` flag, which still comes only from the known-browser allowlist and feeds analytics. |
There was a problem hiding this comment.
Clarify how the protected CloudFront path is enabled. The stock manifest does not select that JA4 source, and the example origin request policy does not forward the JA4 header. Please say that this path requires explicit manifest selection, a protected ingress configuration, and forwarding the viewer JA4 header.
| /// Absent, missing, malformed or unexposed JA4 reads as `None`. | ||
| fn trusted_ja4(request: &Request) -> Option<&str> { | ||
| match request.extensions().get::<RequestIngress>()?.ja4()? { | ||
| CapturedJa4::Captured { fingerprint, .. } => Some(fingerprint.as_str()), |
There was a problem hiding this comment.
Keep the validated fingerprint type. This turns EdgeZero’s Ja4Fingerprint into text, then the device and family classifiers split it again. Pass &Ja4Fingerprint through the production path and use summary() and cipher_hash(). The current ingress lookup agrees with ctx.ja4() at the pinned revision; this is a simplification, not a provenance bug.
| /// | ||
| /// Returns the same errors as [`assemble_app`]. | ||
| #[cfg(test)] | ||
| pub(crate) fn assemble_app_with_middleware( |
There was a problem hiding this comment.
Share Fastly app assembly. The test and production paths share a router builder but duplicate startup and retained-app construction. A single assembly path with a test-only middleware hook would keep future startup changes covered by conformance.
| let known_non_browser = self.known_browser == Some(false) || self.ja4_contradiction; | ||
| match gate { | ||
| BrowserGate::Lenient => !known_non_browser, | ||
| BrowserGate::Strict => !known_non_browser && self.looks_like_browser(), |
There was a problem hiding this comment.
Distinguish a gate denial from analytics classification. A contradiction can block creation even when known_browser is Some(true). Use that distinction in the guide and changelog too: missing JA4 does not cause a contradiction but still fails strict; all disables contradiction checking only; Cloudflare can capture JA4 but lacks an EC store.
| let known_non_browser = self.known_browser == Some(false) || self.ja4_contradiction; | |
| match gate { | |
| BrowserGate::Lenient => !known_non_browser, | |
| BrowserGate::Strict => !known_non_browser && self.looks_like_browser(), | |
| let blocked_by_signals = self.known_browser == Some(false) || self.ja4_contradiction; | |
| match gate { | |
| BrowserGate::Lenient => !blocked_by_signals, | |
| BrowserGate::Strict => !blocked_by_signals && self.looks_like_browser(), |
| //! A browser's TLS `ClientHello` comes from its own TLS stack: Chromium | ||
| //! browsers use `BoringSSL`, Firefox uses NSS, and Safari and every iOS | ||
| //! browser use Apple's stack. `JA4_b`, the middle section of a JA4 | ||
| //! fingerprint, is a truncated hash of the sorted cipher-suite list. It names | ||
| //! that stack, ignores GREASE and Chromium's extension-order randomization, | ||
| //! and survives browser releases that only change extensions (`JA4_c`). |
There was a problem hiding this comment.
Narrow the classifier rationale. The module intro says every iOS browser uses Apple’s TLS stack, but the classifier deliberately does not assume that. The QUIC comment and fixture also say every HTTP/3 client must offer the same three suites, which RFC 9001 §5.3 does not require. Keep the conservative classification choices and correct the comments.
| //! A browser's TLS `ClientHello` comes from its own TLS stack: Chromium | |
| //! browsers use `BoringSSL`, Firefox uses NSS, and Safari and every iOS | |
| //! browser use Apple's stack. `JA4_b`, the middle section of a JA4 | |
| //! fingerprint, is a truncated hash of the sorted cipher-suite list. It names | |
| //! that stack, ignores GREASE and Chromium's extension-order randomization, | |
| //! and survives browser releases that only change extensions (`JA4_c`). | |
| //! `JA4_b`, the middle section of a JA4 fingerprint, hashes the sorted | |
| //! cipher-suite list. The rule uses it to recognize a small set of TLS | |
| //! client families. It does not assume which TLS stack an iOS browser | |
| //! uses, and extension-only changes do not affect this hash. |
PR #1656's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535, #1537, #1538 and #1646. CHANGELOG.md: #1525 added the allow_insecure_http entry, and #1661 reworded the ec.browser_gate entry for trusted JA4 on Axum. The resolution keeps #1525's entry first and #1661's wording of the browser-gate entry. docs/guide/edge-cookies.md: #1639 rewrote the pull-sync room sentences, and #1661 added that a trusted JA4 contradicting the User-Agent denies identity. The resolution keeps #1639's paragraph with #1661's sentence. crates/trusted-server-adapter-axum/src/identity_conformance.rs (merged clean, did not compile): #1646 added a provider-deadline test using the file's USER_AGENT constant, which #1661 replaced with the shared CHROME_USER_AGENT. The resolution uses CHROME_USER_AGENT in that test as #1661 does elsewhere.
PR #1656's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. CHANGELOG.md: main's #1501 entry and #1506's repinned EdgeZero entry sit at the top of Changed, where #1661 added the JA4 and User-Agent contradiction entry. The resolution keeps all three, base first. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1656'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.
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
The JA4 family rule is narrow and well sourced. I checked all four CIPHER_HASH_FAMILIES rows, and the QUIC row the PR leaves out, against FoxIO's ja4plus-mapping.csv at 288d3c3d, and each row matches its cited entry. Signals come from one place: IdentityApp::read_request is the only production caller of DeviceSignals::derive_with_tls_rule, and every adapter decides through it. Approving. The approval depends on Christian's open ID-7 questions being settled before merge: whether ja4_contradiction_exempt is an approved exception to ID-7's refusal, whether a contradiction should also stop writes to existing records, and the unlisted-JA4 acceptance cases on the Fastly and Axum suites that ID-7 lists. I agree with all three and have not repeated them.
Non-blocking
⛏ nitpick
QUIC_JA4sits outside the fixture group. See inline atcrates/trusted-server-core/src/test_support/ja4.rs:89.
Cross-cutting / body-level findings
-
📝 Production JA4 capture on Fastly, traced at the pinned EdgeZero
8a73c097. The conformance runner adds JA4 through a test-only middleware, so these steps show the production path separately:mainpassesFastlyRequest::from_client()throughserve, which callssend_request_with_registries_and_hooks.- That calls
dispatch_with_handles. It callscapture_request_ingress(&req)on the client request, which recordsCapturedJa4::from_runtime_tls(req.get_tls_ja4()). It also removes anyRequestIngressa prepare hook inserted. trusted_ja4reads thatRequestIngressexactly asctx.ja4()does.
The HTTP/2 fingerprint still reaches
DeviceSignalsthroughClientInfo.h2_fingerprint, soknown_browseranalytics keep their input afterderive_device_signalsis removed.
CI Status
At ef355a13, 28 checks pass and none fail. These 6 are still queued:
- integration tests
- integration tests (Fastly EC lifecycle)
- format-typescript
- Native provider acceptance script
- Fastly response diff script
- CLAUDE.md symlink guard
| captured_ja4(CHROMIUM_JA4, Ja4Source::RuntimeTls), | ||
| ); | ||
| } | ||
| /// Chromium over QUIC (`FoxIO` JA4+ mapping). Its cipher hash covers only the three |
There was a problem hiding this comment.
⛏ nitpick: QUIC_JA4 comes right after insert_browser_signals with no blank line, apart from the other fixture constants. Moving it below UNLISTED_JA4 keeps the fixtures in one group. Its wording is already covered by Christian's RFC 9001 comment on ja4_family.rs. A move can't be a single suggestion, so here is the change to apply by hand:
pub const UNLISTED_JA4: &str = "t13d1516h2_000000000000_000000000000";
/// Chromium over QUIC (`FoxIO` JA4+ mapping). ...
pub const QUIC_JA4: &str = "q13d0312h3_55b375c5d22e_06cda9e17597";QUIC_JA4 sat after insert_browser_signals with no blank line, apart from the fixture constants it belongs with. Move it next to UNLISTED_JA4.
PR #1656's new head brings #1656's strict browser gate wording, plus #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 and #1626's enforcement of stored and carried provider opt-outs. CHANGELOG.md: #1506's repin moved the EdgeZero pin entry to ef5cbf30 with EdgeZero pull request 275 at a3c5f3dd, and #1661 added its JA4 contradiction entry after that line. The resolution keeps #1506's pin entry followed by #1661's entry. crates/trusted-server-core/src/ec/device.rs: #1656's owner commit c4c6a1b says the strict gate refuses a request missing either ja4_class or platform_class, and #1661 rewrote the module doc around the new ja4_contradiction field. The resolution keeps #1661's doc with #1656's wording for the strict gate. 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.
PR #1675's new head brings #1675's switches that turn off POST /auction while the auction is disabled and the first-party creative endpoints while creative rewriting is off, together with the identity chain between #1646 and #1675 that #1667 did not carry yet: #1636's Axum after-response drain on SIGTERM, #1626's provider opt-outs and legacy EID expiry on Fastly and Axum, #1656's configurable Edge Cookie browser gate, #1661's refusal of EC creation when a trusted JA4 contradicts the User-Agent, and #1662's Fastly EC route acceptance and capped mirrored expiry. docs/guide/configuration.md: #1675 reworded the enabled row of the [auction] table to say that it also turns on POST /auction, and #1667 added the mtls_slot row, which widened the table. The resolution keeps #1675's enabled text and #1667's mtls_slot row, with the table reformatted by Prettier. Semantic break in crates/trusted-server-core/src/integrations/prebid.rs: #1675's owner commit d141923 added a test plan with no browser routes, whose ProviderConfig and AuctionPlanConfig literals predate #1667's 0985d67, which added the mtls provider field, and eaa2b3e, which added the mtls_slot plan field. The merge applies cleanly but the core tests no longer compile. The fix belongs in this link because it is where the two changes first meet. The literal gains mtls: false and mtls_slot: Default::default(), as #1667 wrote in the neighboring prebid.rs literals. Cargo.lock is unchanged.
|
Round 15 identity realignment:
This round's link updates the CHANGELOG pin text and a Each merge message says what it carries and how any conflict was resolved. |
|
Cascade of #1533's Axum startup-test port fix ( |
…tegration chain
|
Merged #1627's runtime KV removal ( At the maintainer's request, that commit removes the generic runtime KV store Only that commit was merged, not the base branch's new head. Conflicts were resolved in Checks on this head: no reference to the removed store remains and |
PR #1656'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. crates/trusted-server-core/src/ec/app/lifecycle.rs: #1661 adds the `trusted_ja4` helper next to the private `cookie_value` helper, and #1646 (through #1656) deletes `cookie_value` because identity capture now reads `ts-eids` with `cookie_value_all_fields`. The resolution keeps `trusted_ja4` and drops `cookie_value`, which has no callers left. Semantic fix in crates/trusted-server-adapter-axum/src/identity_conformance.rs: #1661 replaces the file's local `USER_AGENT` constant with the shared `CHROME_USER_AGENT`, and #1646's new response-finalization test still sent `USER_AGENT`. The test now sends `CHROME_USER_AGENT`.
|
Round 17 identity realignment:
In Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1656's new head ( Checks on this head: no conflict markers; |
Summary
JA4_b), which names the TLS stack and survives browser releases. The data is four entries from FoxIO's public JA4+ mapping (Chromium, Firefox, Safari, CPython's default context), each quoting its source row, and it lives in core as the issue asks. Cipher lists that are a TLS library's generic default (OpenSSL-style, Gocrypto/tls) are left out, and so is the QUIC hash55b375c5d22e(the three TLS 1.3 suites every HTTP/3 client offers, so Firefox and Safari over HTTP/3 would read as Chromium), so a scanning or corporate proxy built on them is never refused; Go clients are therefore not detected.DeviceSignals.ja4_contradictionfield that the browser gates read.known_browserkeeps its allowlist analytics meaning, so stored records and auction telemetry are unchanged.ctx.ja4(), already in the pinned EdgeZero revision), per EZI-3. The Fastly adapter's direct SDK JA4 read for identity is deleted. Axum applies the rule when EdgeZero's trusted JA4 proxy header is configured.feat/1520-configurable-browser-gate), whose browser gates this rule feeds.Changes
crates/trusted-server-core/src/ec/ja4_family.rsTlsFamilyclassification fromJA4_band the User-Agent family check. Entries for Chromium, Firefox, Safari and Python, each citing FoxIOja4plus-mapping.csvat288d3c3d. Unit tests.crates/trusted-server-core/src/ec/device.rsja4_contradictionfield; both browser gates refuse on it.known_browserstays the allowlist result.crates/trusted-server-core/src/ec/app/lifecycle.rsread_requestalways derives device signals from the User-Agent andctx.ja4()with the configured exemption; aDeviceSignalsextension no longer overrides them. Tests for contradicting, unknown and missing JA4 underlenientandstrict, and for each exemption value.crates/trusted-server-core/src/ec/mod.rsread_requestand ingress JA4.crates/trusted-server-adapter-cloudflare/tests/routes.rscf.botManagement.ja4says: its record store is not bound yet, so the EC route answers 501 (Cloudflare follows the MVP per #1559).crates/trusted-server-adapter-fastly/src/{app,main}.rsderive_device_signalsand its directget_tls_ja4()read. Tests put JA4 into the ingress instead of insertingDeviceSignals. A#[cfg(test)]assemble_app_with_middlewarelets the conformance runner add one middleware.crates/trusted-server-core/src/test_support/identity_conformance.rs,crates/trusted-server-adapter-{fastly,axum}/src/identity_conformance.rsContradictingJa4,BrowserEngineMismatch,CurrentFirefoxandCurrentSafariscenarios (ID-7's acceptance). Both runners deliver JA4 through EdgeZero's request ingress, so the production path runs.docs/guide/edge-cookies.md,docs/guide/configuration.md,trusted-server.example.tomlja4_contradiction_exempt.crates/trusted-server-core/src/settings.rs[ec].ja4_contradiction_exempt:off(default, every contradiction blocks),non_browser(a non-browser TLS stack behind a browser User-Agent no longer blocks; an engine mismatch still does),all(no contradiction blocks). Skipped from serialization at its default; unknown values fail loading.crates/trusted-server-core/src/test_support/ja4.rsCHANGELOG.mdCloses
Closes #1592. Plan item T12 is scoped to Fastly, which this PR verifies, and it also covers Axum. ID-7 on the remaining adapters is tracked in #1581 (Axum acceptance) and #1596 (Cloudflare); Spin creates no records yet.
Spec
Spec: server-side identity on every adapter, ID-7, DEC-18 and EZI-3 (plan ID T12).
Test plan
cargo test-fastly && cargo test-axum(Fastly 4266 passed; Axum 119 passed, after merging the updated Make the Edge Cookie browser gate configurable #1656)cargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest run(no JS changes)cd crates/trusted-server-js/lib && npm run format(no JS changes)CHANGELOG.mdcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute servecargo test-cloudflare(71 passed),cargo test-spin(90 passed), Cloudflare, Spin native and CLI clippy. Mutation checks: ignoring each exemption value, restoring theDeviceSignalsshortcut, not passing the setting, serializing the default, a Fastly middleware that drops the JA4, gates ignoringja4_contradiction, a contradiction writingknown_browser = false, restoring a Go row, and restoring the QUIC row each fail a named test. Checked against the Add server-side identity on every adapter spec and plan #1559 spec at9ea63979a: compliant, with the spec notes below.Notes for review
crypto/tlsdefaults shared by any Go program (including proxies), and FoxIO has no curl or Java rows; no fingerprint was invented. The 43-cipher OpenSSL-style Python row is left out for the same reason.lenient, refused understrict. Documented and tested.ja4_contradiction_exemptand these choices. DEC-18's "never from a platform SDK" is still not true for Fastly'sClientInfo.tls_ja4(DataDome, Read DataDome's JA4 from EdgeZero ingress and drop ClientInfo.tls_ja4 #1663) and the JA4 debug endpoint (Add JA4/TLS fingerprint debug endpoint #645), neither of which touches identity.ja4_contradiction_exempt = "non_browser", or"all"to also cover engine mismatches such as an iPad in desktop mode. The Add server-side identity on every adapter spec and plan #1559 spec (ID-7, DEC-18) should record this opt-out.ClientInfo.tls_ja4. Moving it toctx.ja4()is tracked in Read DataDome's JA4 from EdgeZero ingress and drop ClientInfo.tls_ja4 #1663.Checklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)