Skip to content

Unify the AWS example with CloudFront and durable Edge Cookie storage - #1540

Open
ChristianPavilonis wants to merge 57 commits into
baseline/native-runtime-20261110from
baseline/aws-examples-20261110
Open

ChristianPavilonis wants to merge 57 commits into
baseline/native-runtime-20261110from
baseline/aws-examples-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Provide one operator-configurable native AWS deployment example with protected CloudFront enabled in the main tfvars and retained DynamoDB Edge Cookie storage wired into configuration and task IAM.

  • Fold the former separate DynamoDB recipe into deploy/examples/native-aws-workload/retained/. One guide covers both roots, with separate operator-supplied locked state keys.
  • Keep the retained table independent of disposable task roles. The workload owns its exact-table, partition-scoped DynamoDB policy and exports the matching boundary-review document.
  • Require an explicit CloudFront choice; the committed main tfvars select the enabled dns-cutover path. Preserve origin admission, checked Geo/forwarding, disabled shared caching and explicit Geo Off support.
  • Publish matching [ec.storage] through the existing CLI envelope and require exact agreement with the retained handoff. Regenerate both envelopes byte-exact and add real runtime verification tests.
  • Document hostname/cookie scope and genuine consent transport as operator responsibilities only. No hostname validation, cookie behavior, CMP integration or consent-policy changes.

This PR retains base baseline/native-runtime-20261110 and the existing dependency selection. Its follow-up is integration into RC #1541, not a merge to main or deployment authorization. Operational deployment remains separately owned.

Review fixes

Commit db1ba337a addresses the reported envelope checksum failure, nested Terraform CI coverage, policy ownership/name collision, AWS-owned default encryption, ignored private Terraform artifacts, inaccessible deployer dependency, stale migration narrative and unused moved block. The PR description now reflects this ready-for-review example unit instead of stale draft/head claims.

The runtime regression reproduced the old default envelope's integrity failure before regeneration. Both new exact CLI fixtures now pass VerifiedConfigBlob::parse and settings validation with fictional secrets. Tests also reject data tampering and the original float-to-integer rewrite.

Checks at db1ba33

Local checks passed:

  • Both Terraform roots: recursive formatting, backend-free readonly-lock initialization and validation with Terraform 1.16.2 / AWS provider 6.64.0.
  • Credential-free plans: 8 closed-gate workload cases, 83 qualified disposable-copy cases, 1 retained-table case and the existing synthetic built-in gate delete-only plan. No cloud apply.
  • Native core: 3 AWS envelope regressions, 5 EC storage-config cases and 10 build-digest cases; targeted strict Clippy and workspace Rust formatting.
  • AWS-feature Axum suite: 110 passed, 2 existing prerequisite-dependent cases ignored. The selected four-feature application binary builds.
  • Workflow contract: 4 passed. CI Node pin guard: 30 passed. Runtime wrapper: 14 passed.
  • Docs ESLint, formatting and VitePress build; changed-line domain lint.
  • Actionlint with ShellCheck passes deployment/test workflows. Format-workflow syntax/expressions pass; full ShellCheck reproduces the same 3 pre-existing SC2086 findings on unchanged lines at the old head.

The hosted credential-free AWS offline workflow passes at exact PR commit db1ba337a: run 43306496934. It was explicitly dispatched after automatic PR runs did not appear. This is not a claim that the broader hosted suite completed.

RC integration

Merged and pushed into #1541 through 86797e0b4, preserving the RC's existing work. All changed example, regression and workflow files exactly match the PR commit. Combined local checks pass: 3,437 core unit cases, 2 explicitly selected Node regressions, 18 envelope/storage/digest cases, 110 AWS-feature Axum cases, targeted strict Clippy, docs build, workflow tests, formatting and changed-line domain lint. The unchanged Terraform input fingerprints permit reuse of the 8+83+1 passing mock-plan results. Full hosted checks at the new RC head are running, not yet claimed passed.

Limits and deferred work

The 40 workload AWS resource blocks remain behind the source-controlled qualification gate. Public account/resource/image values are fictional. No cloud identity checks, live plan/apply, secret writes, image publication, DNS change or live browser operation were performed.

DynamoDB Local and the external real Next.js fixture were not available/selected for the two ignored native cases. Actual AWS IAM/boundaries, table operations, capacity, Fargate image/volume/Agent behavior, TLS/DNS, genuine browser consent/cookie acceptance, persistence through ECS replacement and cleanup remain operator qualification work.

PITR/backups, alarms, HA, autoscaling, private networking/endpoints, WAF, customer-managed keys, IPv6, image automation, publisher/bidder/partner integrations, new signing/admin/S2S work and automated config rollback are explicitly deferred, not silently enabled.

Refs #1530. This unit does not close the overall RC tracker.

Reconciliation refresh above the new PR 1506 head

Merge-forward head 0e00253ec72538b1402146f4f3f79a4650a8cbf4 retains original public db1ba337aefca72bfcff22d6dd6aea494adc805a, previous local candidate c89c00f3a802f48065a1a19fb1d6611d09ba7e0f and updated parent f93091a3d75d9d426523b940a319998e7278fc6e. 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.

@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:52

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

Requesting changes for one blocking defect; the other comments are non-blocking.

Blocking: deploy/examples/native-aws-workload/example-envelope.json fails the runtime's own integrity check. Run through VerifiedConfigBlob::parse (the path settings_from_config_blob uses at Axum startup), it is rejected with "app-config blob failed integrity verification": the stored sha256 (5d237581…) does not match the canonical hash of data (2c2f8a22…). The cause is tinybird.access_sample_rate: the file has 0, while the CLI emits 0.0 for this f64 field, as example-noindex-envelope.json does, and the canonical form distinguishes integer from float. With the hash recomputed, the content passes full settings validation, so only the checksum is stale. Details inline.

What I checked and found consistent: store-bindings TOML vs the pinned EdgeZero NativeStoreBindings/AppConfigAgentSettings/SecretsManagerSettings schema; logical store IDs vs edgezero.toml; every EDGEZERO__ADAPTER__* key is consumed; the documented ts config push flags exist; forwarded-header trust (ALB/CloudFront to EdgeZero x-forwarded normalization); all 40 AWS resources depend directly on draft_gate (brace-balanced parse); DynamoDB IAM actions/partitions vs the Axum backend's actual calls, and the table layout vs validate_table.

Not verified here: Terraform runs (the hosted offline-checks job passed at this head), and live-AWS behavior (Fargate volume ownership, Agent with a read-only root filesystem, the execution-role aws:SourceArn condition).

Keep the existing fictional workload and retained-DynamoDB examples above the reconstructed native stack. Operational ownership remains in trusted-server-deployer. No state, table, namespace, private configuration or cloud operation changes.

Validate the reference TOML with the current typed CLI and run locked backend-free provider/schema and credential-free mock plans. Preserve all forty resource gates, exact fixed browser-host controls and the separate read-only offline workflow.
Takes #1538's new head 4d96cb8, 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.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed ffa9350ba, a merge of #1538's new head 4d96cb816, 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.

#1538's new head 321f8bc brings #1539's cf4e815, "Expect the failure router in the native container test". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 6eb448b4e, a merge of #1538's new head 321f8bc70, which brings #1539's cf4e815d4, the native container test's failure-router expectation. The merge had no conflicts. It clears local-provider-image, which failed here with "invalid-envelope must not listen".

Separately, ts dev lint domains (changed lines) still fails here on deploy/examples/native-aws-workload/README.md:76, which links two documentation hosts that are not on the URL-host allowlist. The line can become plain-text references, or the hosts can get an allowlist entry or a per-line suppression under the allowlist maintenance policy, which needs review. I left it for you.

Takes #1538's new head a9c7778, 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.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

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

Takes #1538's new head a9c7778, 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.

PR #1538's new head brings its native AWS runtime wrapper review fixes, plus the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535 and #1537.

deploy/runtime/native-aws/README.md: #1538 added a paragraph saying the image labels record only the two input digests and reflowed the UID/GID paragraph, and #1540 added the unified AWS example's provider feature list before that paragraph. The resolution keeps both added paragraphs, base first, then #1538's reflowed UID/GID paragraph.
PR #1538'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 clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
@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 e14351dfd to 5a41ec2ae:

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

The AWS example README links Terraform's S3 backend permissions page and
AWS's IAM PassRole guide. Those are real documentation hosts that the
URL-host lint rejects on changed lines. The links stay, and the line
carries an allow-domain comment that names both hosts, as the lint
policy allows for intentional references.
PR #1538's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678) and #1535's move of the consent-update test host to publisher.example.com for the URL-host lint. The merge is clean.
aram356 added a commit that referenced this pull request Dec 2, 2026
PR #1662'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.
aram356 added a commit that referenced this pull request Dec 2, 2026
It brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's and #1540's URL-host lint fixes, and #1622's move of the new GPP bridge tests into its split test file, carried up to every tip: #1653, #1654, #1655, #1622, #1660, #1666, #1659, #1709, #1710, #1713 and #1557. #1503 is already contained. The octopus tree is the conflict-free union of the tips.
@aram356

aram356 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Round 13: a3e907367 keeps the Terraform S3 backend and IAM PassRole links in deploy/examples/native-aws-workload/README.md and marks that line with <!-- allow-domain: developer.hashicorp.com, docs.aws.amazon.com -->, which the URL-host lint accepts for intentional references. f1d57e6c9 then merges #1538's new head, which carries #1535's fix. rc/identity is now at 59a2774d0.

PR #1538'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 #1538's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
aram356 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 added a commit that referenced this pull request Dec 3, 2026
PR #1646's new head brings the identity chain above #1540 that #1667 did not carry yet: #1566's move of the identity stack onto the native EC stack, #1624's SharedID creation and write-back from the EC record, #1641's lazily opened EC record store in core, #1642's verified identity lookups and saved /auction body EIDs, and #1646's Axum identity through the shared application.

crates/trusted-server-adapter-axum/src/app.rs: #1667 added mtls_auction_provider_fails_startup before Axum's enabled_identity_provider_fails_startup, and #1646 renamed that test to unknown_identity_provider_fails_startup because Axum now runs identity providers. The resolution keeps #1667's mTLS startup test followed by #1646's renamed test.

crates/trusted-server-cli/src/checked_app_config.rs: #1667 extended the adapter doc to say that the Fastly-only split also holds for auction providers that set mtls, and #1646 rewrote it to say that Fastly and Axum run the shared coordinators. The resolution says that Fastly and Axum run identity providers and that only Fastly accepts mtls auction providers. The semantic fix below then replaces that function.

Semantic break in crates/trusted-server-cli/src/checked_app_config.rs and run.rs: #1646 moved the Axum target of ts config push and diff from ProviderlessAppConfig to CheckedAppConfig by making adapter_runs_identity_providers return true for axum, and #1667 placed its reject_auction_mtls check only in ProviderlessAppConfig. The merge compiles, but the CLI then accepts an mtls auction provider for Axum that the Axum adapter refuses at startup. The fix belongs in this link because it is where the two changes first meet. adapter_runs_identity_providers becomes adapter_support, which returns ProvidersAndMtls for fastly, ProvidersOnly for axum and Neither for every other adapter, and push and diff match on it. A new NoMtlsAppConfig adds only the reject_auction_mtls check to CheckedAppConfig, and ProviderlessAppConfig now wraps NoMtlsAppConfig and adds reject_enabled_providers, so the mTLS rejection exists once. validate stays adapter-agnostic on CheckedAppConfig. The tests cover the adapter mapping, an Axum target that rejects an mtls auction provider under auction_providers and accepts an enabled identity provider, a Fastly target that accepts the mtls provider, and Cloudflare and Spin targets that reject both. The CLI paragraph of the auction provider mTLS spec now names NoMtlsAppConfig for Axum.

Cargo.lock matches #1646's new head: next to #1667's, it adds only #1646's trusted-server-identity-providers dependency of the Axum adapter; 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 871daa116 to 4249fe01a:

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): bc59b9197 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 233f0e3cf, on top of bc59b9197.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped.

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

PR #1538'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 233f0e3cf to aad9fe005:

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 252cc9a3e, on top of aad9fe005.

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 #1538's new head (bf22f2678), 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