Skip to content

Commit 0be49bb

Browse files
committed
Merge feature/edgezero-pr17-cloudflare-adapter into PR18
Conflict resolutions: - .github/workflows/test.yml: keep both PR18's benchmark smoke step and PR17's Fastly WASM release build verification step - crates/integration-tests/Cargo.toml: union of PR18's parity test deps and lints with PR17's urlencoding; lock file regenerated - crates/integration-tests/Cargo.lock: regenerated from merged manifest Semantic fixes for the hardened get_settings() brought in by PR17: - Add TrustedServerApp::routes_with_settings() to the Cloudflare adapter (mirroring the Axum seam) and split routes() into build_state_with_settings + build_router - Parity tests build both routers from shared explicit test settings instead of routes(), which now returns the startup error router for the baked placeholder secrets. Previously seven parity tests passed vacuously by comparing identical 500s - Axum and Cloudflare adapter route tests build through the settings seam; route-table introspection now inspects the real route table rather than the startup-error fallback table - Test handler regex ^/(_ts/)?admin covers the adapter-level /admin routes asserted by the 401 tests and the /_ts/admin paths required by settings validation Review follow-ups: - Update stale 2x growth comment to match MAX_GROWTH_FACTOR = 1.1 - Document the dual-bump requirement for the edgezero git rev pinned in the workspace-excluded integration-tests manifest
2 parents 254bd2e + d9e7217 commit 0be49bb

152 files changed

Lines changed: 21826 additions & 4472 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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ check-cloudflare = ["check", "-p", "trusted-server-adapter-cloudflare", "--targe
2121
# Clippy — target-matched to avoid cross-target compile failures
2222
clippy-fastly = ["clippy", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
2323
clippy-axum = ["clippy", "-p", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--", "-D", "warnings"]
24-
clippy-cloudflare = ["clippy", "-p", "trusted-server-adapter-cloudflare", "--all-targets", "--all-features", "--", "-D", "warnings"]
24+
# No --all-features: the `cloudflare` feature has a compile_error! guard on
25+
# non-wasm32 targets. WASM-feature coverage comes from `cargo check-cloudflare`.
26+
clippy-cloudflare = ["clippy", "-p", "trusted-server-adapter-cloudflare", "--all-targets", "--", "-D", "warnings"]
2527

2628
[target.'cfg(all(target_arch = "wasm32"))']
2729
runner = "viceroy run -C ../../fastly.toml -- "

.claude/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,31 @@
2222
"Bash(git branch:*)",
2323
"Bash(git diff:*)",
2424
"Bash(git log:*)",
25+
"Bash(git show:*)",
2526
"Bash(git status:*)",
27+
"Bash(gh pr view:*)",
28+
"Bash(gh pr list:*)",
29+
"Bash(gh pr diff:*)",
30+
"Bash(gh pr checks:*)",
31+
"Bash(gh issue view:*)",
32+
"Bash(gh issue list:*)",
33+
"Bash(gh run view:*)",
34+
"Bash(gh run list:*)",
35+
"Bash(gh repo view:*)",
2636
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__new_page",
37+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_pages",
38+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__select_page",
39+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__navigate_page",
40+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_screenshot",
41+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_snapshot",
42+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_console_messages",
43+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__get_console_message",
44+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_network_requests",
45+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__get_network_request",
46+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__wait_for",
47+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__performance_start_trace",
2748
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__performance_stop_trace",
49+
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__performance_analyze_insight",
2850
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__evaluate_script"
2951
]
3052
},

.github/actions/setup-integration-test-env/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ runs:
8888
env:
8989
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:${{ inputs.origin-port }}
9090
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
91-
TRUSTED_SERVER__EDGE_COOKIE__SECRET_KEY: integration-test-secret-key
91+
TRUSTED_SERVER__EC__PASSPHRASE: integration-test-ec-secret-padded-32
92+
TRUSTED_SERVER__EC__PARTNERS: >-
93+
[{"name":"Integration Test Partner","source_domain":"inttest.example.com","bidstream_enabled":true,"api_token":"integration-test-token-alpha-32-bytes-ok"},{"name":"Integration Test Partner 2","source_domain":"inttest2.example.com","bidstream_enabled":true,"api_token":"integration-test-token-bravo-32-bytes-ok"}]
9294
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
9395
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
9496

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Closes #
2323

2424
<!-- How did you verify this works? Check all that apply -->
2525

26-
- [ ] `cargo test --workspace`
27-
- [ ] `cargo clippy --workspace --all-targets --all-features -- -D warnings`
26+
- [ ] `cargo test-fastly && cargo test-axum`
27+
- [ ] `cargo clippy-fastly && cargo clippy-axum`
2828
- [ ] `cargo fmt --all -- --check`
2929
- [ ] JS tests: `cd crates/js/lib && npx vitest run`
3030
- [ ] JS format: `cd crates/js/lib && npm run format`

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
uses: actions-rust-lang/setup-rust-toolchain@v1
6767
with:
6868
toolchain: ${{ steps.rust-version.outputs.rust-version }}
69+
# wasm32-wasip1 is required by the "Verify Fastly WASM release
70+
# build" step below; the axum build and tests are native.
71+
target: wasm32-wasip1
6972
cache-shared-key: cargo-${{ runner.os }}
7073

7174
- name: Build Axum adapter
@@ -78,6 +81,14 @@ jobs:
7881
# -- --test runs each benchmark as a regular test (no timing harness) so CI stays fast
7982
run: cargo bench -p trusted-server-core --bench html_processor_bench -- --test
8083

84+
- name: Verify Fastly WASM release build
85+
env:
86+
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:8080
87+
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
88+
TRUSTED_SERVER__EC__PASSPHRASE: integration-test-ec-secret-padded-32
89+
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
90+
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
91+
8192
test-cloudflare:
8293
name: cargo check (cloudflare native + wasm32-unknown-unknown)
8394
runs-on: ubuntu-latest

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If you cannot read `CLAUDE.md`, follow these rules:
2121
- `cargo test-fastly` — Fastly adapter + core (wasm32-wasip1 via Viceroy)
2222
- `cargo test-axum` — Axum dev server adapter (native)
2323
Do NOT use bare `cargo test --workspace` — it will attempt to compile the Fastly adapter for the host target.
24-
4. Run `cargo fmt --all -- --check` and `cargo clippy --workspace --all-targets --all-features -- -D warnings`.
24+
4. Run `cargo fmt --all -- --check` and `cargo clippy-fastly && cargo clippy-axum`.
2525
5. Run JS tests with `cd crates/js/lib && npx vitest run` when touching JS/TS code.
2626
6. Use `error-stack` (`Report<E>`) for error handling — not anyhow, eyre, or thiserror.
2727
7. Use `log` macros (not `println!`) and `expect("should ...")` (not `unwrap()`).

CLAUDE.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ cargo test-cloudflare # Cloudflare Workers adapter (native host)
8181
cargo fmt --all -- --check
8282

8383
# Lint
84-
cargo clippy --workspace --all-targets --all-features -- -D warnings
84+
cargo clippy-fastly && cargo clippy-axum
8585

8686
# Check compilation
8787
cargo check
@@ -229,6 +229,14 @@ impl core::error::Error for MyError {}
229229
- Format messages with present-tense verbs.
230230
- Use `log-fastly` as the backend for Fastly Compute.
231231

232+
## Other guidelines
233+
234+
- Use only example or fictional information in comments, tests, docs, examples,
235+
and similar non-runtime materials. (eg. for urls use: example.com domains only)
236+
- Do not write or commit real domains, customer names, credentials,
237+
configuration values, or other potentially sensitive real-world information in
238+
comments, tests, docs, or examples.
239+
232240
---
233241

234242
## Git Commit Conventions
@@ -386,7 +394,7 @@ both runtime behavior and build/tooling changes.
386394
| `crates/trusted-server-core/src/tsjs.rs` | Script tag generation with module IDs |
387395
| `crates/trusted-server-core/src/html_processor.rs` | Injects `<script>` at `<head>` start |
388396
| `crates/trusted-server-core/src/publisher.rs` | `/static/tsjs=` handler, concatenates modules |
389-
| `crates/trusted-server-core/src/edge_cookie.rs` | Edge Cookie (EC) ID generation |
397+
| `crates/trusted-server-core/src/ec/` | EC identity subsystem (generation, consent, cookies) |
390398
| `crates/trusted-server-core/src/cookies.rs` | Cookie handling |
391399
| `crates/trusted-server-core/src/consent/mod.rs` | GDPR and broader consent management |
392400
| `crates/trusted-server-core/src/http_util.rs` | HTTP abstractions and request utilities |
@@ -402,6 +410,7 @@ both runtime behavior and build/tooling changes.
402410
- Do not use `unwrap()` in production code — use `expect("should ...")`.
403411
- Do not use thiserror — use `derive_more::Display` + `impl Error`.
404412
- Do not use wildcard imports (except `use super::*` in test modules).
405-
- Do not commit `.env` files or secrets.
413+
- Do not commit `.env` files, secrets, or potentially sensitive real-world
414+
information in comments, tests, docs, examples, or configuration files.
406415
- Do not make large refactors without approval.
407416
- Always run tests and linting before committing.

0 commit comments

Comments
 (0)