Skip to content

Extract native EC lifecycle and DynamoDB persistence - #1536

Open
ChristianPavilonis wants to merge 46 commits into
baseline/shared-async-ec-20261110from
baseline/native-ec-20261110
Open

ChristianPavilonis wants to merge 46 commits into
baseline/shared-async-ec-20261110from
baseline/native-ec-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Original request-local EC graph, generation/finalization restrictions and optional exact DynamoDB client.
  • Reorganize the existing working demo using EdgeZero83d7a629, not current-main forwarding compatibility.

Draft baseline review unit. Not a current-main merge candidate, deployment approval or completed current-head CI claim.

Baseline and sequence

Head: c568207dba73f022b723f9bae7ac4a130603b744. Base: baseline/shared-async-ec-20261110.

Historical main anchor: 2dd968aeebeb2cc0d5110115f64e0ad58e2e1d13. Original demo: TS2423a2ed plus separately preserved dirty inputs. Matching EdgeZero: draft431, exact revision 83d7a6296d285e135c4ea70021b19e6c8dca7e9f.

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

Area Change
This unit Original request-local EC graph, generation/finalization restrictions and optional exact DynamoDB client.
Unchanged work Original checkouts, dirty Prebid inputs, recovery references and existing PRs remain preserved.

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

Core3006 and native all-feature lifecycle/configuration suites pass; strict Core/Axum lint pass. Native static/integration routes retain their original generation restrictions. No AWS-account or fleet qualification is claimed.

  • Required current-head hosted checks complete before ready-state transition.
  • Final baseline combined-check results recorded with exact input revisions and limitations.
  • Focused failures and corrections retained rather than assertions relaxed.

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

  • Existing behavior extracted into a scoped review unit.
  • Public examples use fictional inputs and no licensed Geo data.
  • No deployment, main merge, old-RC closure or recovery deletion.
  • No new worker launched or paused experiment resumed.
  • Review readiness confirmed independently from later units.

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 d17472fd39e3ebfaaad7df432b7dce1e5bf9b990 retains original public 296e05405cbe0833b5de9bbc9b9c9c2e066092d6, previous local candidate c01d41dcbc08890d8b1c2cb2dcbae18e7f083d37 and updated parent 25500d2b9f9db5318c9f8cdf276953a413ac599d. 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 at 628474ec4a8cee8361a6927ae6b79b68fdd33a55. 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.

@prk-Jr prk-Jr 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

The native EC lifecycle extraction and the DynamoDB backend look correct to me. I checked the store against the EcKvStore contract: reads are strongly consistent, conditional writes report precondition failures as outcomes rather than errors, logically expired rows are hidden from lookup/list but still count for key_exists so withdrawal can overwrite them, and listing fails instead of returning a short result. The Axum behaviour changes (fail closed on an unreadable Cookie header, running integration request filters, /identify erroring without a selected store) now match Fastly. Approving; the four comments below are non-blocking.

Non-blocking

  • 🤔 The Axum integration-route no-generation rule has no test (inline on app.rs).
  • 🤔 CI never runs the aws-dynamodb-ec tests (inline on ec_kv.rs).
  • 📝 The guide cites a Dockerfile and a Terraform example that only arrive in #1539 / #1540 (inline on the guide).
  • ⛏ cookie_value duplicates the core cookie helper and selects headers differently (inline on app.rs).

Verification

  • Local, Rust 1.98.1: cargo test -p trusted-server-adapter-axum --features aws-dynamodb-ec --no-fail-fast passes, except native_acceptance::managed_ingress_ignores_direct_spoof_and_isolates_two_gateway_clients. That test binds a non-127.0.0.1 loopback alias, which macOS doesn't provide; the file is unchanged by this PR and passes in hosted Linux CI.
  • Mutation: changing Axum's allow_generation: false to true leaves the Axum lib, native_ec, routes, native_http and startup tests passing.
  • Not run: the ignored DynamoDB Local contract test, scripts/test-native-ec-image.mjs, and anything against AWS.

CI Status

All 17 hosted checks pass on c568207d.

Comment thread docs/guide/native-ec-persistence.md Resolved
@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:56
Rebuild the existing native EC feature above the tag-bound async graph. Keep live conditional rows separate from immutable config snapshots, build the shared router from prepared state, and retain the publisher response owner through buffering and exactly-once EC finalization, including handled errors.

Preserve the current direct client/test seams, frame limits, trace authorization and protected Geo. Verify the real binary against pinned local DynamoDB, including stale CAS, expiry/withdrawal, lost acknowledgements and draining while storage waits. No image, live AWS or deployment qualification is implied.
aram356 added a commit that referenced this pull request Nov 25, 2026
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.
aram356 added a commit that referenced this pull request Nov 25, 2026
…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.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 6b357d5d6, a merge of #1534's new head cd6241c42. It brings the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), #1489's FinalizeRequest and request time, and #1506's repin of EdgeZero to rc/identity at d063a8e7 with main's Fastly SDK upgrade (#1671). The textual conflicts were in the Axum app.rs and startup.rs and in Cargo.lock. Resolutions:

  • Axum native EC: NativeEcRequest::finalize passes the ts-eids cookie and the SharedID request inside a FinalizeRequest, with the request time read the way the Fastly adapter reads it: once, and only for a navigation with an eligible, non-redirect response. A navigation whose clock cannot be read then writes no row and does not set the mirror, as on Fastly.
  • Record lifecycle fixture: the withdrawal race in assert_record_ec_lifecycle builds a FinalizeRequest at the current time.
  • First-party proxy: Restrict creative proxy identity disclosure #1615 builds an EC context for the first-party proxy route. This PR's build_ec_context returns the error for a malformed EC cookie instead of an empty context, so the route now answers with that error, as Fastly does on every route when EC setup fails.
  • Native startup: Standardize health and startup-failure responses across adapters #1617 splits initialize_native so that a store read, settings or state failure installs the failure router. This PR's app state construction and EC record store acquisition sit in the moved body, now prepare_native, so a missing or mismatched prepared EC record store serves the failure router (live /health, 503 elsewhere) instead of failing initialization. The panics doc moves with the expect to prepare_native.
  • Runtime environment names: Guard serving runtime environment names #1637 lets serving code read only TRUSTED_SERVER__ names, through runtime_env!, so scripts/lint-runtime-env.sh rejects this PR's std::env::var read of TS_EC_DYNAMODB_ENABLED. The switch is renamed TRUSTED_SERVER__EC_DYNAMODB_ENABLED and read through runtime_env!, and ec_kv_configuration.rs, the native EC persistence guide and scripts/test-native-ec-image.mjs use the new name. The old TS_EC_DYNAMODB_REGION, _TABLE, _NAMESPACE and _LOCAL_ENDPOINT inputs stay, since nothing reads them.
  • Cargo.lock is the base's lock with this PR's new Axum adapter dependencies (aws-config, aws-sdk-dynamodb, edgezero-store-aws and url). The Axum dev-dependency on edgezero-store-aws, which this PR adds for its DynamoDB fixture, moves to d063a8e7 with the other EdgeZero crates.

ChristianPavilonis added a commit that referenced this pull request Nov 25, 2026
…B persistence

Source: baseline/native-ec-20261110 at 6b357d5.
Takes #1534's new head fc2d56a, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.

This PR's own EdgeZero pin text moves from d063a8e7 to 459bd27d as well, in
`crates/trusted-server-adapter-axum/Cargo.toml`.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 6eb6be4d5, a merge of #1534's new head fc2d56a28, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. The merge had no conflicts. This PR's own edgezero-store-aws dependency in crates/trusted-server-adapter-axum/Cargo.toml moves from d063a8e7 to 459bd27d as well.

Takes #1534's new head 8fd3dd1, which carries #1506's repin of EdgeZero to
rc/identity at 1619078a (8edc50e), a revert that removes EdgeZero 522
(portable Fastly record providers) and 524 (outbound mTLS client
identities).

The merge is clean.

This PR's own EdgeZero pin text moves from 459bd27d to 1619078a as well, in
`crates/trusted-server-adapter-axum/Cargo.toml`.

Cargo.lock is re-resolved after the merge so it passes --locked:
+aws-sdk-dynamodb 1.120.0 +http 0.2.12.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed cc84b6d77.

Takes #1534's new head 8fd3dd1, 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.

This PR's own EdgeZero pin text moves from 459bd27d to 1619078a as well, in crates/trusted-server-adapter-axum/Cargo.toml.

Cargo.lock is re-resolved after the merge so it passes --locked: +aws-sdk-dynamodb 1.120.0 +http 0.2.12.

- Test that a consented browser navigation to an integration route
  issues no identity and writes no row, with a publisher-page control.
- Read ts-eids with the core cookie helper instead of a local copy.
- Correct the build_ec_context doc: prepare_request already drops
  non-UTF-8 Cookie fields, so the cookie read error is defensive.
- Document provider-less Axum EC finalization and identify behavior.
- Run the Axum tests with aws-dynamodb-ec in CI.
@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Review follow-up in 9d41f0f, on top of cc84b6d77. Each inline thread has its own reply.

  • CI never ran the DynamoDB provider tests (point in @dhruv8sh's review summary): the test-axum job now also runs cargo test --locked -p trusted-server-adapter-axum --features aws-dynamodb-ec. The DynamoDB Local test stays ignored.
  • Port note from @aram356 (Add server-side identity on every adapter spec and plan #1559): the adapter's own DynamoDB store was already replaced by the shared EdgeZero record backend in 5764dea. The TS_EC_DYNAMODB_* names left in scripts/test-native-ec-image.mjs belong to the old store. The guide already says that script must be adapted before it counts as acceptance, so this follow-up leaves it unchanged.

Local checks on 9d41f0f:

  • cargo fmt --check and cargo clippy-axum are clean.
  • Axum tests pass with and without aws-dynamodb-ec. The ignored DynamoDB Local test was not run.
  • adapter_identity_guard passes.
  • actionlint passes on test.yml, run with shellcheck off.
  • Prettier passes on the guide.

Hosted checks on the new head are still pending.

@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 native (Axum) EC lifecycle support. It introduces a shared core RecordEcKvStore over EdgeZero record bindings, opted into via TRUSTED_SERVER__EC_DYNAMODB_ENABLED and the aws-dynamodb-ec feature. Publisher, auction and page-bids routes now share one dispatch_ec_route, which runs request filters and finalizes EC exactly once, failures included, so withdrawal is never lost. The core adapter, layout and lifecycle tests are well built.

One blocking problem remains: the PR adds a 981-line smoke script that its own docs say targets the old, removed backend. It cannot pass against this code.

Blocking

🔧 wrench

  • New test-native-ec-image.mjs configures a backend this PR removes — see inline at scripts/test-native-ec-image.mjs:470

Non-blocking

♻ refactor

  • edgezero-store-aws git rev duplicated outside the workspace pin — see inline at crates/trusted-server-adapter-axum/Cargo.toml:54

👍 praise

  • Finalize-exactly-once, including error paths — see inline at crates/trusted-server-adapter-axum/src/app.rs:455
  • Cluster count now passes a complete <hash>. partition — see inline at crates/trusted-server-core/src/ec/kv.rs:1191

Cross-cutting / body-level findings

  • 📝 The DynamoDB Local lifecycle proof is not exercised in CI — The new CI step runs cargo test -p trusted-server-adapter-axum --features aws-dynamodb-ec. But record_dynamodb.rs is #[ignore] and needs EDGEZERO_AWS_TEST_DYNAMODB_ENDPOINT, so CI only covers selection and configuration. Real Add/CAS race and paging behaviour against DynamoDB stays a manual check. Please mention this in the PR description, or add a follow-up to run it against a DynamoDB Local service container.
  • 📝 When both are selected, the EC store becomes the default KV store instead of geo_index — kv_store_metadata in app.rs makes trusted_server_kv the default whenever EC records and Geo KV are both selected. Before this PR, geo_index was the default. If anything resolves the default KV binding rather than geo_index by name, that is a silent behaviour change for geo-kv deployments. Please confirm nothing depends on the default here.

AWS_REGION: 'us-east-1',
AWS_DEFAULT_REGION: 'us-east-1',
TRUSTED_SERVER__EC_DYNAMODB_ENABLED: 'true',
TS_EC_DYNAMODB_REGION: 'us-east-1',

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.

🔧 wrench: This script configures a backend this PR removes.

The smoke test still selects the old TS-owned connector:

  • It sets TS_EC_DYNAMODB_REGION, TS_EC_DYNAMODB_TABLE, TS_EC_DYNAMODB_NAMESPACE and TS_EC_DYNAMODB_LOCAL_ENDPOINT (lines 470–473).
  • It inspects the old ec:{namespace} / ec-allocator:{namespace} partitions (lines 183–184).

This PR's own guide (docs/guide/native-ec-persistence.md) says those variables "do not configure another TS-owned provider". It also says this script "targets the previous TS-owned backend and must be adapted before it can count as new-format image acceptance." The script never writes a [kv.trusted_server_kv] record binding, so with TRUSTED_SERVER__EC_DYNAMODB_ENABLED=true, record_ec::acquire fails with "native EC record store is not prepared" and the app never becomes ready.

Adding a new ~1000-line script that is known to be broken will mislead anyone who runs it as acceptance.

Proposed fix (apply manually; it touches the whole file and the docs): either

  1. drop scripts/test-native-ec-image.mjs from this PR and the paragraph about it in the guide, then reintroduce it once it is adapted, or
  2. adapt it now: write a store-bindings TOML with [kv.trusted_server_kv] provider = "aws-dynamodb-records", remove the TS_EC_DYNAMODB_* env vars, and replace the ec: / ec-allocator: partition checks with checks against the new layout-qualified partition keys.

edgezero-adapter-axum = { workspace = true, features = ["axum", "test-utils"] }
base64 = { workspace = true }
reqwest = { workspace = true, features = ["blocking"] }
edgezero-store-aws = { git = "https://github.com/IABTechLab/edgezero", rev = "1619078a665188c1c282375ec9c11cd1b4f64ee7", default-features = false, features = ["dynamodb-records"] }

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.

♻ refactor: edgezero-store-aws copies the EdgeZero git rev here instead of taking it from [workspace.dependencies], where every other edgezero-* crate is pinned. The next workspace rev bump will leave this dev-dependency on the old commit. Cargo then builds two copies of edgezero-core, and RecordLayout / KvHandle from the two copies are different types, which breaks record_dynamodb.rs in a confusing way.

Proposed fix (apply manually; it needs an entry in the root Cargo.toml too, so it can't be a one-file suggestion):

# Cargo.toml [workspace.dependencies]
edgezero-store-aws = { git = "https://github.com/IABTechLab/edgezero", rev = "1619078a665188c1c282375ec9c11cd1b4f64ee7", default-features = false }

# crates/trusted-server-adapter-axum/Cargo.toml [dev-dependencies]
edgezero-store-aws = { workspace = true, features = ["dynamodb-records"] }

)
.await?;
owner.attach(response).map_err(publisher_owner_error)
// Finalize exactly once, including failures, so withdrawal is not lost.

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: Each route's result goes through ec.finalize exactly once, including filter short-circuits and handler errors. Withdrawal therefore always expires the cookie and writes the tombstone, even when the publisher origin fails. Gating the graph on browser || ec_consent_withdrawn keeps revocation working for hardened UAs without minting identities for them.

// The delimiter makes this a complete IP-hash partition, not a partial
// prefix. The backend already attaches store context to list failures,
// so propagate without re-wrapping.
let partition_prefix = format!("{hash_prefix}.");

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: Appending the . delimiter turns the cluster count into a query over a complete partition, which matches EcRecordLayout::validate_partition. It also closes the gap where a bare-hash prefix could match unrelated keys. The graph_cluster_count_uses_a_complete_record_partition test covers the marker exclusion nicely.

PR #1534's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637 and #1533.

.github/workflows/test.yml: #1532 added a step that runs the Axum tests with the geo-kv feature, and #1536 added one with the aws-dynamodb-ec feature at the same place. The resolution keeps both steps, base first.
PR #1534'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.

The merge is textually clean, but #1536's crate-level pin would have required a second EdgeZero source, so this link moves it.

crates/trusted-server-adapter-axum/Cargo.toml: #1536's edgezero-store-aws dependency for its dynamodb-records feature named rev 1619078a. It now names 8a73c0978806bdb60caccb17a6ddf34e14f3bd5e, the workspace pin from #1506, so the lock keeps one EdgeZero source.

Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged. Against #1534's head, the lock keeps only #1536's own aws-sdk-dynamodb and http 0.2 entries for that feature.
@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 9d41f0fb0 to 96989f72b:

This PR's crate-level edgezero-store-aws rev in crates/trusted-server-adapter-axum/Cargo.toml now names EdgeZero 8a73c097, so the workspace keeps one EdgeZero source.

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

PR #1534'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 #1534'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 and #1627's Spin store reads and retained runtime coverage.

crates/trusted-server-adapter-axum/src/app.rs: #1617's owner commit replaced startup_unavailable_response with startup_unavailable_router in the health imports, and #1536 added the navigation and request-filter imports next to them. The resolution keeps both.

crates/trusted-server-adapter-axum/Cargo.toml (merged clean, failed --locked): #1536's crate-level edgezero-store-aws dependency named rev 8a73c097. It now names ef5cbf30878e0c6cdb8c706117c02add75493531, the workspace pin from #1506, so the lock keeps one EdgeZero source.

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. Against #1534's head the lock keeps only #1536's own aws-sdk-dynamodb and http 0.2 entries.
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1540's new head brings the identity chain's commits since #1667 last merged it at afc4f5d, including the EdgeZero repins up to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, main's #1501, #1525's plain HTTP opt-in for auction providers, and this round's owner commits on #1535, #1613, #1616, #1617, #1625, #1627, #1635, #1637 and #1639.

Cargo.toml and crates/trusted-server-adapter-axum/Cargo.toml: #1667 pinned EdgeZero at d063a8e7, and the chain now pins rc/identity ef5cbf30, which keeps the client certificate API #1667 uses. The files merge cleanly to the chain's pin, so #1667 no longer carries its own.

crates/trusted-server-core/src/auction/mod.rs: #1501 from main, which the chain carries, moved the APS provider test literal into the shared aps_provider_map helper, and #1667 added `mtls: false` to that literal. The resolution calls the helper and adds `mtls: false` to it.

docs/guide/auction-orchestration.md: #1525 reworded the endpoint and allow_insecure_http rows of the provider field table, and #1667 added the mtls row below them. The resolution keeps #1525's rows followed by #1667's mtls row.

docs/guide/configuration.md: #1525 added the allow_insecure_http row to the provider field table and the plain HTTP warning after the loopback exception, and #1667 added the mtls row and the note that an mtls provider needs an https endpoint. The resolution keeps #1525's table with #1667's mtls row last, and #1525's warning followed by #1667's note.

docs/guide/error-reference.md: #1616's owner commit replaced "TLS is always verified" with the adapter and platform TLS policy wording, and #1667 added the outbound client identity bullet after it. The resolution keeps #1616's wording followed by #1667's bullet.

crates/trusted-server-core/src/auction/plan.rs (semantic fix): #1525's 23e4bdd removed the local is_false helper from plan.rs and serializes allow_insecure_http through crate::settings::is_false, and #1667's mtls field still named the local helper. The mtls field now uses crate::settings::is_false too.

crates/trusted-server-adapter-axum/tests/native_ec.rs (semantic fix): #1536's 9d41f0f added an APS ProviderConfig literal to the Axum native EC tests, and #1667 added the required mtls field to ProviderConfig. The literal now sets `mtls: false`.

Cargo.lock matches #1540's new head: next to #1667's, it changes only the EdgeZero package sources (d063a8e7 to 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 2d8c79190 to 82a894278:

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): c34d8849e 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 149adf6bc, on top of c34d8849e.

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. The merge was clean apart from docs/guide/edgezero.md. The removal adds a trusted_server_kv inventory row saying nothing reads that store, which is not true on this branch, so the row is left out.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1534's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. 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 149adf6bc to f0750bd84:

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

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 81111bb3f, on top of f0750bd84.

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 #1534's new head (38c65bae6), which carries 48930c270 and nothing else new to this branch. It was clean.

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

4 participants