Skip to content

Commit 224fcaf

Browse files
committed
Merge origin/main into server-side-ad-templates-impl
Adopt main's ts-CLI config model over the branch's build-time embedding: drop the build.rs config generation and [build-dependencies], accept the trusted-server.toml deletion, remove the now-orphaned creative_slot_build_check module, and migrate the [creative_opportunities] example into trusted-server.example.toml. Slot validation is preserved via Settings::prepare_runtime, which the CLI runs at config push time. Adopt main's refactored EdgeZero finalize path in the Fastly adapter and centralize the per-user Set-Cookie cache-privacy guard in send_edgezero_response so it covers every EdgeZero send path. Fix three core test helpers for main's Body::into_bytes -> Option change.
2 parents 9a64c17 + b260260 commit 224fcaf

95 files changed

Lines changed: 9562 additions & 3224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
# trusted-server-adapter-axum → native (dev server)
44
# trusted-server-adapter-cloudflare → wasm32-unknown-unknown (Cloudflare Workers)
55
# trusted-server-adapter-spin → wasm32-wasip1 (Fermyon Spin)
6+
# trusted-server-cli → native (operator CLI)
67
#
78
# All adapters are workspace members so `-p` resolves each.
89
# default-members = [fastly] — required so Viceroy can locate the binary via `cargo run --bin`.
910
# Use the aliases below to target each adapter with the correct toolchain.
1011

1112
[alias]
13+
test_details = ["test", "--target", "aarch64-apple-darwin"]
14+
test_cli_macos = ["test", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]
15+
build_cli_macos = ["build", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]
16+
test_cli_linux = ["test", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
17+
build_cli_linux = ["build", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
1218
# Fastly adapter + shared crates (wasm32-wasip1 via Viceroy)
1319
# Excludes Axum (native-only), Cloudflare (wasm32-unknown-unknown), and Spin (separate wasm32-wasip1 job)
1420
test-fastly = ["test", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]

.github/workflows/format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- name: Run cargo clippy (Spin — wasm32-wasip1)
4848
run: cargo clippy-spin-wasm
4949

50+
- name: Run host-target CLI clippy
51+
run: cargo clippy --package trusted-server-cli --target x86_64-unknown-linux-gnu --all-targets --all-features -- -D warnings
52+
5053
format-typescript:
5154
runs-on: ubuntu-latest
5255
defaults:

.github/workflows/integration-tests.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
install-viceroy: "false"
3434
build-cloudflare: "true"
3535

36+
- name: Generate integration Viceroy configs
37+
run: ./scripts/generate-integration-viceroy-configs.sh
38+
env:
39+
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
40+
3641
- name: Package integration test artifacts
3742
run: |
3843
mkdir -p "$(dirname "$WASM_ARTIFACT_PATH")" "$(dirname "$AXUM_ARTIFACT_PATH")" "$(dirname "$DOCKER_ARTIFACT_PATH")" "$CF_BUILD_ARTIFACT_PATH"
@@ -107,6 +112,7 @@ jobs:
107112
AXUM_BINARY_PATH: ${{ env.AXUM_ARTIFACT_PATH }}
108113
CLOUDFLARE_WRANGLER_DIR: ${{ github.workspace }}/crates/trusted-server-adapter-cloudflare
109114
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
115+
VICEROY_CONFIG_PATH: ${{ env.ARTIFACTS_DIR }}/configs/viceroy-legacy.toml
110116
RUST_LOG: info
111117

112118
integration-tests-edgezero:
@@ -150,11 +156,7 @@ jobs:
150156
env:
151157
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
152158
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
153-
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template-edgezero.toml
154-
# Opt into the EdgeZero entry-point canary in test_ec_lifecycle_fastly.
155-
# Only set here, so the legacy integration-tests job runs the same
156-
# scenarios through legacy_main without asserting the EdgeZero-only 405.
157-
EXPECT_EDGEZERO_ENTRY_POINT: "true"
159+
VICEROY_CONFIG_PATH: ${{ env.ARTIFACTS_DIR }}/configs/viceroy-edgezero.toml
158160
RUST_LOG: info
159161

160162
browser-tests:
@@ -202,7 +204,7 @@ jobs:
202204
env:
203205
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
204206
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
205-
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml
207+
VICEROY_CONFIG_PATH: ${{ env.ARTIFACTS_DIR }}/configs/viceroy-legacy.toml
206208
TEST_FRAMEWORK: nextjs
207209
PLAYWRIGHT_HTML_REPORT: playwright-report-nextjs
208210
run: npx playwright test
@@ -221,7 +223,7 @@ jobs:
221223
env:
222224
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
223225
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
224-
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml
226+
VICEROY_CONFIG_PATH: ${{ env.ARTIFACTS_DIR }}/configs/viceroy-legacy.toml
225227
TEST_FRAMEWORK: wordpress
226228
PLAYWRIGHT_HTML_REPORT: playwright-report-wordpress
227229
run: npx playwright test

.github/workflows/test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@ jobs:
7979
# -- --test runs each benchmark as a regular test (no timing harness) so CI stays fast
8080
run: cargo bench -p trusted-server-core --bench html_processor_bench -- --test
8181

82+
- name: Run host-target CLI tests
83+
run: cargo test --package trusted-server-cli --target x86_64-unknown-linux-gnu
84+
8285
- name: Verify Fastly WASM release build
83-
env:
84-
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:8080
85-
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
86-
TRUSTED_SERVER__EC__PASSPHRASE: integration-test-ec-secret-padded-32
87-
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
8886
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
8987

9088
test-cloudflare:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
# env
2323
.env*
24+
trusted-server.toml
25+
js-assets.toml
2426

2527
# backup
2628
**/*.rs.bk

CLAUDE.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ crates/
1818
trusted-server-adapter-axum/ # Axum dev server entry point (native binary)
1919
trusted-server-adapter-cloudflare/ # Cloudflare Workers entry point (wasm32-unknown-unknown binary)
2020
trusted-server-adapter-spin/ # Fermyon Spin entry point (wasm32-wasip1 component)
21+
trusted-server-cli/ # Host-target `ts` operator CLI
2122
trusted-server-js/ # TypeScript/JS build — per-integration IIFE bundles
2223
lib/ # TS source, Vitest tests, esbuild pipeline
2324
```
2425

25-
Supporting files: `fastly.toml`, `trusted-server.toml`, `.env.dev`,
26-
`rust-toolchain.toml`, `CONTRIBUTING.md`.
26+
Supporting files: `edgezero.toml`, `fastly.toml`,
27+
`trusted-server.example.toml`, `.env.dev`, `rust-toolchain.toml`,
28+
`CONTRIBUTING.md`. Operator-owned `trusted-server.toml` files are gitignored.
2729

2830
## Toolchain
2931

@@ -96,6 +98,11 @@ cargo test-axum # Axum dev server adapter (native)
9698
cargo test-cloudflare # Cloudflare Workers adapter (native host)
9799
cargo test-spin # Spin adapter route tests (native host)
98100

101+
# Run host-target CLI tests (workspace default target is wasm32-wasip1)
102+
# Use your host triple, for example x86_64-unknown-linux-gnu on CI/Linux
103+
# or aarch64-apple-darwin on Apple Silicon macOS.
104+
cargo test --package trusted-server-cli --target <host-triple>
105+
99106
# Format
100107
cargo fmt --all -- --check
101108

@@ -311,10 +318,12 @@ IntegrationRegistration::builder(ID)
311318

312319
| File | Purpose |
313320
| --------------------- | ---------------------------------------------------------- |
314-
| `fastly.toml` | Fastly service configuration and build settings |
315-
| `trusted-server.toml` | Application settings (ad servers, KV stores, ID templates) |
316-
| `rust-toolchain.toml` | Pins Rust version to 1.95.0 |
317-
| `.env.dev` | Local development environment variables |
321+
| `edgezero.toml` | EdgeZero app/platform manifest and logical stores |
322+
| `fastly.toml` | Fastly service configuration and build settings |
323+
| `trusted-server.example.toml` | Source-controlled Trusted Server app-config template |
324+
| `trusted-server.toml` | Operator-owned app config; gitignored; `ts config push` publishes it as an EdgeZero blob envelope |
325+
| `rust-toolchain.toml` | Pins Rust version to 1.95.0 |
326+
| `.env.dev` | Local development environment variables |
318327

319328
---
320329

0 commit comments

Comments
 (0)