Repository navigation
Extract the protected CloudFront Geo baseline - #1532
ChristianPavilonis wants to merge 29 commits into
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
Reviewed affb0d0a4c0a1f3b9ac00d11c12de1f45080a8ce against baseline b1216763a3c2a38df1a2909285330e818823423a. No actionable findings.
Reviewed native Geo admission and startup, request isolation, response finalization, optional-field serialization, consent handling, and affected auction consumers.
Local verification: cargo test --locked -p trusted-server-adapter-axum --all-features --test startup passed all 10 tests, including CloudFront trust rejection and error-response finalization, using Rust 1.98.1 and Node 24.12.0. Head and base were rechecked and remain unchanged.
This approval covers the historical baseline unit. Current-main compatibility and live AWS qualification remain outside scope. Main-only CodeQL did not run.
CI status: all 17 reported checks PASS at the reviewed head:
- integration tests
- integration tests (Fastly EC lifecycle)
- browser integration tests
- docs-proposal scripts
- cargo test (cross-adapter parity)
- cargo test (axum native)
- cargo fmt
- CLAUDE.md symlink guard
- cargo test (ts CLI, native) (macos-latest)
- cargo check/build/test (spin native + wasm32-wasip2)
- vitest
- cargo test (ts CLI, native) (ubuntu-latest)
- cargo check (cloudflare native + wasm32-unknown-unknown)
- cargo test
- format-docs
- format-typescript
- prepare integration artifacts
Retain the existing Geo feature head while projecting private managed outcomes into partial request-local geography. Preserve current-main trace privacy, direct outbound APIs, startup router ownership and ingress diagnostics. Do not restore backend or HTTP compatibility bridges.
aram356
left a comment
There was a problem hiding this comment.
Summary
Reviewed 0ae96ef5f against baseline/native-aws-20261110 (merge base 65ba4f3df). The CloudFront path itself is well bounded: EdgeZero handles admission, credential stripping and assertion parsing; TS reads only the immutable RequestContext::geo(); and populated fields keep their flat wire names. Changes are needed because:
- The jurisdiction rule change reaches every adapter, so Cloudflare US traffic loses server-side auctions and EC creation.
- The CloudFront tests never run in CI, and no test proves geography reaches consent.
- Native startup lost its environment diagnostic.
- At this head, the integration, Fastly EC lifecycle and browser jobs were skipped.
2 of the inline comments below carry a one-click GitHub
suggestion. Use Commit suggestion (or Add suggestion to batch for both) to apply them. The other comments describe the fix in prose because it touches several files or lines outside the diff.
Blocking
🔧 wrench
- US without a region now fails closed on every adapter (Cloudflare US auctions and EC blocked): see inline at
crates/trusted-server-core/src/consent/jurisdiction.rs:71-74 - Geography-to-consent wiring is untested (mutation survives): see inline at
crates/trusted-server-adapter-axum/src/platform.rs:166 - Native startup drops EdgeZero's environment diagnostic (suggestion): see inline at
crates/trusted-server-adapter-axum/src/main.rs:60 - Use the full
TRUSTED_SERVER__env prefix, one name everywhere: see inline atcrates/trusted-server-adapter-axum/src/native_geo.rs:14 - CloudFront tests never run in hosted CI: see Cross-cutting below
- Failed CI check skipped the integration and browser jobs at this head: see Cross-cutting below
Non-blocking
- ♻️ One core helper for geo response headers (Axum duplicates the clearing, Fastly's
Nonebranch skips it): see inline atcrates/trusted-server-adapter-axum/src/middleware.rs:183-193 - 🤔 Credential-absence assertions check the response, where the request header can't appear: see inline at
crates/trusted-server-adapter-axum/tests/startup.rs:350-351 - ⛏
derive_more::Displayanderror-stackfor the new errors: see inline atcrates/trusted-server-adapter-axum/src/native_geo.rs:27 - ⛏ Imports inside test function bodies: see inline at
crates/trusted-server-core/src/consent/jurisdiction.rs:236 - ⛏
set_response_headersdoc overclaims for Fastly (suggestion): see inline atcrates/trusted-server-core/src/geo.rs:24 - ⛏ Assertions without messages: see Cross-cutting below
Cross-cutting / body-level findings
-
🔧 CloudFront tests never run in hosted CI.
cargo test-axum(.github/workflows/test.yml,test-axumjob) runs with default features. From the new tests it runs onlycompiled_out_geo_selection_fails_before_store_preparation_and_listenandinvalid_geo_profile_fails_before_store_preparation_and_listen. Three tests, and thegeo-cloudfrontbranch ofselected_implementation_is_explicitly_validated, are only compiled byclippy-axum --all-features, never run:managed_geo_is_partial_immutable_per_request_and_finalized_on_auth_errorsadmitted_body_error_keeps_managed_geo_without_losing_framework_statusnonmatching_real_socket_peer_cannot_supply_geo
They pass locally with
cargo test -p trusted-server-adapter-axum --features geo-cloudfront. Please add that as a step in thetest-axumjob. -
🔧
prepare integration artifactsfailed, so the downstream jobs never ran at this head. The failure is inactions/upload-artifact:Failed to CreateArtifact ... Unexpected token '<', "<!DOCTYPE "... is not valid JSONafter 5 attempts. The artifacts built fine, so this is GitHub-side. As a result,integration tests,integration tests (Fastly EC lifecycle)andbrowser integration testswere skipped. The previous approval coveredaffb0d0a4, before the two EdgeZero tag merges. Please re-run the workflow so those jobs execute at the current head. No required checks are configured on this base branch, so this is a gate AGENTS.md treats as required rather than one branch protection enforces. -
⛏ Assertions without messages. AGENTS.md asks for a descriptive message on every assertion. Examples among the new tests:
crates/trusted-server-adapter-axum/src/platform.rs:241-245crates/trusted-server-core/src/platform/mod.rs:305,:311-312crates/trusted-server-core/src/consent/jurisdiction.rs:221-227,:247-248crates/trusted-server-core/src/geo.rs:243-244,:251crates/trusted-server-core/src/integrations/prebid.rs:6667crates/trusted-server-core/src/integrations/aps.rs:2437crates/trusted-server-adapter-cloudflare/src/platform.rs:893-894,:934crates/trusted-server-adapter-axum/tests/startup.rs:342-344
CI Status
- browser integration tests: SKIPPED (upstream artifact job failed)
- integration tests (Fastly EC lifecycle): SKIPPED (upstream artifact job failed)
- integration tests: SKIPPED (upstream artifact job failed)
- prepare integration artifacts: FAIL
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo test (cross-adapter parity): PASS
- cargo test (axum native): PASS
- vitest: PASS
- cargo test: PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo fmt: PASS
- format-typescript: PASS
- docs-proposal scripts: PASS
- format-docs: PASS
- CLAUDE.md symlink guard: PASS
- cargo check/build/test (spin native + wasm32-wasip2): PASS
No checks are marked required on baseline/protected-geo-20261110.
|
CREATOR: From the server-side identity plan (#1559, Part of #1529 |
Restore the reviewed shared jurisdiction policy and add Cloudflare compatibility coverage. Prove managed Geo reaches auction consent and bid requests, and capture credential stripping at the publisher origin. Run protected Geo tests in CI, retain default-off coverage, and remove duplicated documentation. SDK integration and native EC lifecycle work remain deferred. Refs #1529.
Use typed redacted reports while preserving existing profile and SDK startup messages. Add diagnostic and report-redaction regression coverage. Clarify optional Geo header guarantees and add descriptive messages to existing Geo assertions without changing their predicates. Profile retirement and shared header clearing remain deferred. Refs #1529.
Review follow-through at 7d6b7a1b9All 12 inline threads now have a fix explanation or an explicit agreed deferral and are resolved. Re-review is requested from aram356 and dhruv8sh. The PR remains draft; no reviewer verdict was dismissed.
Local checks passed for Core, all native adapters, parity, Fastly, Axum default/Geo/all features, all eight Clippy lanes, formatting and changed-lines domain lint. The final independent review found no findings. Existing ignored cases were not relabeled as passes. The temporary build-cache quota failures were corrected before the final checks. Still deferred, not claimed implemented: retiring the TS profile through #1573 and EdgeZero #482/#491, the shared Geo-header clearing follow-up, actual native EC-creation proof and final main-bound integration. These dispositions also account for the CREATOR main-port note. #1529 stays open; no live AWS/deployment qualification or merge approval is implied. |
The tree is the ported #1531 plus this pull request's own changes against #1531's previous head. EdgeZero stays pinned to rc/identity 9d02d7b3 by rev from the base, so the v0.0.12-rc-axum.202611.3 tag pin and its Cargo.lock are dropped. The pinned EdgeZero carries the geo-kv and celld-kv features, geo_capability_for and the EDGEZERO__ADAPTER__GEO settings, so the KV Geo wiring is kept. Axum startup: main keeps the hosting-option capture, the TS Geo profile and the typed hosting errors, and runs EdgeZero's run_production_app_with_options_and_initializer. EdgeZero installs the logger, as on the base, so the adapter's SimpleLogger and RUST_LOG parsing are not revived and the parse_log_level tests go with them. A hosting option failure is captured before any logger exists, so it goes through the same standard-error fallback as other early startup failures. Admitted errors: the pinned EdgeZero has no App::set_admitted_error_response_finalizer, so the initializer no longer installs one. The base's finalize middleware already renders handler errors and finalizes them, and it now applies the request's managed Geo, so the oversized-body test keeps its Geo headers and framework status. The native RC guide says an error EdgeZero renders outside the router carries no Geo or TS headers. Axum middleware: the finalize middleware reads the managed Geo outcome before dispatch and keeps the base's handler-error rendering. Core: the base's Sourcepoint TCF mirror consent test moves to the optional GeoInfo fields. Cargo.lock: no package is added; the adapter gains derive_more, serde and toml edges, and edgezero-store-celld gains the edges of its kv feature. APS tests: #1612 and this pull request each add a test after the APS wire shape test, aps_request_omits_eids_when_none and builds_aps_partial_geo_without_missing_detail. Both are kept unchanged.
|
For the identity integration chain (#1608), this PR stays on #1531, which now stacks on #1623 (T21). The chain is one line: #1489 ← #1612 ← #1623 ← #1531 ← #1532 ← #1613 ← #1616 ← #1617 ← #1615. How the port fits the base:
One behavior change. Left as they are. Checked locally at Two macOS-only failures:
|
Workflow: the Axum job keeps both #1613's native identity conformance rejection controls step and #1532's protected CloudFront Geo tests step, in that order, ahead of the finalization harness cleanup step. Fastly conformance runner: the GDPR fixture geo takes #1532's GeoInfo shape, converted as #1532 converted the same literal elsewhere. The empty city becomes None, the continent stays EU, the zero coordinates become a complete zero pair and the zero metro code stays zero. The scenario still resolves to Germany, so the GDPR consent gate and every assertion are unchanged. Fastly identity app: the test-only conformance hook in the identity app's record-store selection is untouched by #1531 and #1532, so the fixture store still reaches every request path through the identity app.
Current review follow-through
Current head: 7d6b7a1b9.
This PR remains draft. The temporary TS Geo-profile retirement waits for TS #1573 and EdgeZero's manifest binding #482/integration tag #491. The shared header-clearing refactor and pre-existing Fastly absent-Geo behavior remain explicitly deferred. Native EC-creation proof, final main-bound integration and live cloud qualification are not claimed. Issue #1529 remains open.
Historical baseline and verification receipts follow.
Summary
Draft baseline review unit. Not a current-main merge candidate, deployment approval or completed current-head CI claim.
Baseline and sequence
Head:
affb0d0a4c0a1f3b9ac00d11c12de1f45080a8ce. Base:baseline/native-aws-20261110.Historical main anchor:
2dd968aeebeb2cc0d5110115f64e0ad58e2e1d13. Original demo: TS2423a2ed plus separately preserved dirty inputs. Matching EdgeZero: draft431, exact revision83d7a6296d285e135c4ea70021b19e6c8dca7e9f.The user selected compatible-baseline cleanup. Current-main integration with EdgeZero462 and the authenticated-forwarder incompatibility are deferred. Preserve current-main PR1525/1526 ready and1527/1528 draft, with their existing bases. No excluded1499 or independent1506 implementation, relay/privacy experiment, new transport fallback, group/codec/phase design or operational deployment is included.
Changes
Closes
Refs #1530. This unit completes one part of the baseline extraction and does not close the overall tracker on its own.
Spec
Not a new feature. This is extraction of existing demo behavior and bounded build/caller corrections. Original native and EC storage design/review records remain in the baseline where applicable; they are not presented as approval of later combined source. No new forwarding, consent, timer or provider policy is designed here.
Test plan
Core3002 and native all-feature suites pass, including10 real startup cases. No production KV Geo, local Geo database, new consent authority or cloud acceptance is added.
The b67ffc6 baseline checkpoint has passing documented local gates: Fastly/default/reuse/native/Cloudflare/Spin suites, all adapter strict lint lanes, 17 cross-adapter parity cases, 1252 JS cases, CLI suites, formatting, clock/digest/proposal checks and changed-lines domain lint. Passing checks at121ebcc36 are reused only for unchanged relevant inputs; the final follow-up covers the CLI test-import and documentation-only corrections. These results are not a substitute for this PR's current-head hosted checks.
Checklist
Operational Terraform remains in trusted-server-deployer. Local checks and prototype tests do not qualify cloud access, fleet durability or a live publisher.
Hosted docs-build correction
The first hosted format-docs job caught an additional site-build gate that the original local formatter checkpoint had not run: a relative link from the native EC guide to a Terraform example outside the site. Native EC correction8b11dbad3 replaces it with the plain repository path; no dead-link check is disabled. That docs-only correction is carried through the existing upper PR identities. Native EC and final integration8985b111 both pass docs ESLint and VitePress build; the final docs formatter also passes. Runtime, dependency, image-build-context and test inputs are unchanged from b67ffc6, so their prior exact-input proofs are reused. Hosted current-head checks still control readiness.
Startup negative-probe correction
A hosted native EC case failed the no-listener probe while its child logged the expected startup validation failure. The old log has no socket endpoints, so the failure's exact subtype is not claimed confirmed. A separate controlled Linux reproduction demonstrates a successful TCP self-connection with no listening server. Native correction8490c691d distinguishes equal local/peer endpoints from a real listener; actual socket controls prove the self-connection is excluded and a real listener is still detected. Nonzero exit, expected diagnostic, secret-redaction and the original startup deadline remain required. This changes only the acceptance fixture, not production admission, transport or trust.
The earliest native unit and final9356c557 default/all-feature acceptance checks and strict lint pass, including both controls and the original failure case. Ignores remain explicit; earlier separately executed celld proof is not relabeled as a new ignored-case run. Correction is merged upward through existing PR identities without force-pushing or retargeting. Current-head hosted checks must pass; the old failure is retained rather than rerun-only waived. Runtime/API/dependency inputs remain unchanged. A fresh exact9356 producer build and real runtime smoke now pass: image
sha256:65a735d38e9dbc0573d0f6068a8b261bd202c43aea05085c2b2d6bccc91ebdbd, linux/amd64 UID/GID10001, including startup rejection and in-flight SIGTERM drain. Prior b67 image receipts remain separate; no image was pushed. All local parent runners are complete.Browser CI host compatibility
Preserved older browser failures show Playwright1.58.2 rejecting ubuntu-latest's new Ubuntu26.04 image before browser installation; later missing-executable failures are consequences, not passing browser tests. Nativeb1216763a pins only the browser job to ubuntu-24.04, leaving dependency versions, tests and assertions unchanged. Direct Actionlint1.7.12 passes at the owning native and final integration points; the first shim-only attempt could not run because no global version was configured, and is not counted as lint proof. No global tooling was changed. The only9356 ->ee7 delta is this workflow host/comment; runtime, Cargo, docs, tests and Docker-context inputs are unchanged. Actual browser execution on the supported hosted runner remains pending and must pass before readiness. No waiver or browser skip.
Reconciliation refresh above the new PR 1506 head
Merge-forward head
9075b4b391c84bc5954d7b8a92f810251d2657beretains original public852b875fe617048ea8aae39d0b74ce9a999fb1bc, previous local candidate8f517932294472b768928528c6d40db03806978dand updated parentbf3569dd9b9d30290b7b18e284642edf9f67b336. The original feature patch is unchanged. Aram's #1516 code/tests/spec are preserved upstream rather than duplicated as another owned production port. The existing PR identity, feature boundary and readiness remain intact.Fresh shared-root and combined RC qualification passes on the refreshed source. Reused JS/Chrome/storage/wrapper/Terraform evidence is explicitly fingerprinted, not claimed as a new execution. Source-image proof is bound to refreshed #1539, not a new RC release. Fresh hosted/macOS, digest-backed wrapper/RC images, other external browser/framework lanes and live AWS/publisher/CMP acceptance remain unverified. Ignored/unexecuted cases and original failed receipts are not counted as passes. Historical claims above remain bound to their named old inputs. No tag, registry publication or deployment is included.
Published snapshot; newer upstream integration pending
Published deliberately for review from the qualified #1506 checkpoint
57d7c6ad8db43601ef31c1e1d1615e6dd2aa6a6a. At publication the moving author branch was at628474ec4a8cee8361a6927ae6b79b68fdd33a55. Newer upstream bounded-response handling, per-profile RTB caps and Sourcepoint changes are not incorporated or qualified in this snapshot. Further merge-forward reconciliation and conflict resolution may be needed before merge. Local results above describe this exact qualified source, not a merge with the newer base or a release.