Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0f36454
Generate plan for spin adapter
prk-Jr May 22, 2026
01fd4c1
Tighten the spin adapter integration plan
prk-Jr May 23, 2026
b29b377
Add Fermyon Spin adapter with EdgeZero rev bump and CI
prk-Jr May 25, 2026
89ab20a
Bump worker-build to ^0.8 for worker 0.8 compatibility
prk-Jr May 25, 2026
d5b745d
Reject digit-leading KIDs in validate_kid
prk-Jr May 27, 2026
4c4f1b6
Fix Spin adapter WASI HTTP proxy and variable encoding
prk-Jr May 27, 2026
bee7a39
Merge feature/edgezero-pr18-phase5-verification into spin adapter branch
prk-Jr May 28, 2026
a214f94
Fix Spin publisher HTML processor bypass caused by missing Host header
prk-Jr May 28, 2026
4d10761
Resolve PR 735 round-1 review findings
prk-Jr May 29, 2026
4e51206
Add Spin adapter to public docs and README
prk-Jr May 29, 2026
dc4a7d7
Fix proxy_rebuild_adds_and_removes_params test after tstoken validation
prk-Jr May 29, 2026
36e198c
Fix clippy-spin-native failures in app.rs
prk-Jr May 29, 2026
40e982b
Merge feature/edgezero-pr18-phase5-verification into PR19
prk-Jr Jun 12, 2026
75d85b0
Fix parity-crate clippy violations and bump worker for worker-build 0.8
prk-Jr Jun 12, 2026
86e6d12
Merge feature/edgezero-pr18-phase5-verification into PR19 spin adapter
prk-Jr Jun 13, 2026
7461d88
Derive trusted host and scheme from spin-full-url on the Spin adapter
prk-Jr Jun 13, 2026
7dd15b5
Route all publisher fallback methods on the Spin adapter
prk-Jr Jun 13, 2026
1d01d14
Reject deleting reserved signing params during proxy-rebuild
prk-Jr Jun 13, 2026
8098617
Keep legacy digit-leading KIDs removable via the admin API
prk-Jr Jun 13, 2026
86893a8
Pin worker-build to the locked worker version in the Cloudflare build
prk-Jr Jun 13, 2026
44e5b80
Reconstruct absolute request URIs for Spin first-party handlers
prk-Jr Jun 13, 2026
699a49a
Enforce a portable KID contract across signing adapters
prk-Jr Jun 13, 2026
a9e3134
Enforce the Spin response-size ceiling on all response paths
prk-Jr Jun 13, 2026
e346514
Align Spin Host with the trusted URI and expose GET /health
prk-Jr Jun 13, 2026
26e5a26
Exclude the Spin crate from build-fastly and check-fastly
prk-Jr Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,42 @@
# trusted-server-adapter-fastly → wasm32-wasip1 (Fastly Compute)
# trusted-server-adapter-axum → native (dev server)
# trusted-server-adapter-cloudflare → wasm32-unknown-unknown (Cloudflare Workers)
# trusted-server-adapter-spin → wasm32-wasip1 (Fermyon Spin)
#
# All adapters are workspace members so `-p` resolves each.
# default-members = [fastly] — required so Viceroy can locate the binary via `cargo run --bin`.
# Use the aliases below to target each adapter with the correct toolchain.

[alias]
# Fastly adapter + shared crates (wasm32-wasip1 via Viceroy)
# Excludes Axum (native-only) and Cloudflare (wasm32-unknown-unknown, separate job)
test-fastly = ["test", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--target", "wasm32-wasip1"]
# Excludes Axum (native-only), Cloudflare (wasm32-unknown-unknown), and Spin (separate wasm32-wasip1 job)
test-fastly = ["test", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
# Axum dev server adapter (native)
test-axum = ["test", "-p", "trusted-server-adapter-axum"]
# Cloudflare adapter (native host; WASM target checked separately in CI)
test-cloudflare = ["test", "-p", "trusted-server-adapter-cloudflare"]
# Cloudflare adapter WASM target check (wasm32-unknown-unknown requires --features cloudflare)
check-cloudflare = ["check", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]
# Spin adapter (native host tests; WASM target checked separately with --features spin)
test-spin = ["test", "-p", "trusted-server-adapter-spin"]
check-spin = ["check", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin"]

# Clippy — target-matched to avoid cross-target compile failures
clippy-fastly = ["clippy", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
clippy-fastly = ["clippy", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
clippy-axum = ["clippy", "-p", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--", "-D", "warnings"]
# No --all-features: the `cloudflare` feature has a compile_error! guard on
# non-wasm32 targets. WASM-feature coverage comes from `cargo check-cloudflare`.
clippy-cloudflare = ["clippy", "-p", "trusted-server-adapter-cloudflare", "--all-targets", "--", "-D", "warnings"]
clippy-spin-native = ["clippy", "-p", "trusted-server-adapter-spin", "--all-targets", "--no-default-features", "--", "-D", "warnings"]
clippy-spin-wasm = ["clippy", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin", "--lib", "--", "-D", "warnings"]

# Build — target-matched, same split as test/clippy
build-fastly = ["build", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--target", "wasm32-wasip1"]
build-fastly = ["build", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
build-axum = ["build", "-p", "trusted-server-adapter-axum"]
build-cloudflare = ["build", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]

# Check — fast compile validation, same split
check-fastly = ["check", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--target", "wasm32-wasip1"]
check-fastly = ["check", "--workspace", "--exclude", "trusted-server-adapter-axum", "--exclude", "trusted-server-adapter-cloudflare", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
check-axum = ["check", "-p", "trusted-server-adapter-axum"]

[target.'cfg(all(target_arch = "wasm32"))']
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-integration-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
if: ${{ inputs.install-viceroy == 'true' }}
shell: bash
# `.tool-versions` is the single source of truth for the Viceroy pin.
# The pin matters because upstream Viceroy > v0.16.4 has bumped MSRV
# The pin matters because upstream Viceroy v0.17+ has bumped MSRV
# beyond the rustc pin in `rust-toolchain.toml`.
run: echo "viceroy-version=$(grep '^viceroy ' .tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -131,6 +131,6 @@ runs:
env:
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:${{ inputs.origin-port }}
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
TRUSTED_SERVER__SYNTHETIC__SECRET_KEY: integration-test-secret-key
TRUSTED_SERVER__EDGE_COOKIE__SECRET_KEY: integration-test-secret-key
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
run: bash crates/trusted-server-adapter-cloudflare/build.sh
9 changes: 9 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ jobs:
- name: Run cargo clippy (Axum — native)
run: cargo clippy-axum

- name: Run cargo clippy (Cloudflare — native)
run: cargo clippy-cloudflare

- name: Run cargo clippy (Spin — native)
run: cargo clippy-spin-native

- name: Run cargo clippy (Spin — wasm32-wasip1)
run: cargo clippy-spin-wasm

format-typescript:
runs-on: ubuntu-latest
defaults:
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id: viceroy-version
# `.tool-versions` is the single source of truth so this workflow and
# `.github/actions/setup-integration-test-env/action.yml` can't drift.
# The pin matters because upstream Viceroy > v0.16.4 has bumped MSRV
# The pin matters because upstream Viceroy v0.17+ has bumped MSRV
# beyond the rustc pin in `rust-toolchain.toml`.
run: echo "viceroy-version=$(grep '^viceroy ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
Expand Down Expand Up @@ -116,6 +116,36 @@ jobs:
- name: Run Cloudflare adapter tests (native host)
run: cargo test-cloudflare

test-spin:
name: cargo check/build (spin native + wasm32-wasip1)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Retrieve Rust version
id: rust-version
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Set up Rust toolchain (native + wasm32-wasip1)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust-version }}
target: wasm32-wasip1
cache-shared-key: cargo-${{ runner.os }}

- name: Check Spin adapter (native host)
run: cargo check -p trusted-server-adapter-spin

- name: Check Spin adapter (wasm32-wasip1)
run: cargo check-spin

- name: Build Spin adapter release WASM
run: cargo build --package trusted-server-adapter-spin --target wasm32-wasip1 --features spin --release

- name: Run Spin adapter tests (native host)
run: cargo test-spin

test-parity:
name: cargo test (cross-adapter parity)
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
/pkg
/target

# local Spin CLI downloads
/spin
/spin.sig

# EdgeZero local KV store (created by edgezero-adapter-axum framework)
.edgezero/
/crates/integration-tests/target
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fastly 13.3.0
rust 1.91.1
nodejs 24.12.0
viceroy 0.16.4
viceroy 0.16.5
47 changes: 37 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ crates/
trusted-server-adapter-fastly/ # Fastly Compute entry point (wasm32-wasip1 binary)
trusted-server-adapter-axum/ # Axum dev server entry point (native binary)
trusted-server-adapter-cloudflare/ # Cloudflare Workers entry point (wasm32-unknown-unknown binary)
trusted-server-adapter-spin/ # Fermyon Spin entry point (wasm32-wasip1 component)
js/ # TypeScript/JS build — per-integration IIFE bundles
lib/ # TS source, Vitest tests, esbuild pipeline
```
Expand All @@ -31,7 +32,7 @@ Supporting files: `fastly.toml`, `trusted-server.toml`, `.env.dev`,
| Rust | 1.91.1 (pinned in `rust-toolchain.toml`) |
| WASM target | `wasm32-wasip1` |
| Node | LTS (for JS build) |
| Viceroy | Latest (Fastly local simulator) |
| Viceroy | 0.16.5 (pinned in `.tool-versions`) |

---

Expand Down Expand Up @@ -66,6 +67,21 @@ cargo check-cloudflare

# Test Cloudflare adapter (native host)
cargo test-cloudflare

# Check Spin adapter (native)
cargo check -p trusted-server-adapter-spin

# Check Spin adapter (WASM target)
cargo check-spin

# Test Spin adapter (native host)
cargo test-spin

# Production-style Spin WASM artifact used by crates/trusted-server-adapter-spin/spin.toml
cargo build --package trusted-server-adapter-spin --target wasm32-wasip1 --features spin --release

# Optional local Spin runtime smoke, if the Spin CLI is installed
spin up --from crates/trusted-server-adapter-spin
```

### Testing & Quality
Expand All @@ -76,12 +92,20 @@ cargo test-cloudflare
cargo test-fastly # Fastly adapter + core (wasm32-wasip1 via Viceroy)
cargo test-axum # Axum dev server adapter (native)
cargo test-cloudflare # Cloudflare Workers adapter (native host)
cargo test-spin # Spin adapter route tests (native host)

# Format
cargo fmt --all -- --check

# Lint
cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare
# Lint by adapter target — target-matched clippy is the blocking gate because
# the workspace has multiple wasm runtimes and runtime-specific SDKs. A plain
# `cargo clippy --workspace --all-features` would trip the cloudflare
# feature's non-wasm32 compile_error! guard.
cargo clippy-fastly
cargo clippy-axum
cargo clippy-cloudflare
cargo clippy-spin-native
cargo clippy-spin-wasm

# Check compilation (per-target aliases — bare `cargo check` fails at the workspace root)
cargo check-fastly && cargo check-axum && cargo check-cloudflare
Expand All @@ -102,7 +126,7 @@ cd crates/js/lib && node build-all.mjs
### Install prerequisites

```bash
cargo install viceroy # Fastly local test runtime
cargo install --git https://github.com/fastly/Viceroy --tag v0.16.5 viceroy
```

---
Expand Down Expand Up @@ -173,6 +197,7 @@ pub struct UserId(Uuid);
## Error Handling

- Use `error-stack` (`Report<MyError>`) — not anyhow or eyre.
- **Exception**: `crates/trusted-server-adapter-spin/src/lib.rs` entry point returns `anyhow::Result` because `edgezero_adapter_spin::run_app` forces this type at the WASM FFI boundary. Do not use `anyhow` anywhere else.
- Use `Box<dyn Error>` only in tests or prototyping.
- Use concrete error types with `Report<E>`.
- Use `ensure!()` / `bail!()` macros for early returns.
Expand Down Expand Up @@ -296,11 +321,12 @@ IntegrationRegistration::builder(ID)
Every PR must pass:

1. `cargo fmt --all -- --check`
2. `cargo clippy-fastly && cargo clippy-axum`
3. `cargo test-fastly && cargo test-axum`
4. JS build and test (`cd crates/js/lib && npx vitest run`)
5. JS format (`cd crates/js/lib && npm run format`)
6. Docs format (`cd docs && npm run format`)
2. `cargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare && cargo clippy-spin-native && cargo clippy-spin-wasm`
3. `cargo test-fastly && cargo test-axum && cargo test-cloudflare && cargo test-spin`
4. `cargo test --manifest-path crates/integration-tests/Cargo.toml --test parity`
5. JS build and test (`cd crates/js/lib && npx vitest run`)
6. JS format (`cd crates/js/lib && npm run format`)
7. Docs format (`cd docs && npm run format`)

---

Expand All @@ -310,7 +336,8 @@ Every PR must pass:
2. **Get approval** — for non-trivial changes, present a plan first.
3. **Implement incrementally** — small, testable changes. Every change should
impact as little code as possible.
4. **Test after every change** — `cargo test-fastly && cargo test-axum`.
4. **Test after every change** — run the target-matched adapter test for the
code you changed; before PR handoff, run the full CI gate list above.
5. **Explain as you go** — describe what you changed and why.
6. **If blocked** — explain what's blocking and why.

Expand Down
Loading
Loading