Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8ac395a
Add trusted-server-adapter-axum crate skeleton with lib + bin targets
prk-Jr Apr 17, 2026
8f0be1b
Add .gitignore to exclude target/ from axum adapter crate
prk-Jr Apr 17, 2026
0e81b2a
Add Axum platform trait implementations (config/secret/backend/geo/http)
prk-Jr Apr 17, 2026
3a0bcad
Add Axum middleware: FinalizeResponseMiddleware + AuthMiddleware
prk-Jr Apr 17, 2026
450a459
Add Axum app wiring: TrustedServerApp Hooks implementation
prk-Jr Apr 17, 2026
3e3016b
Add Axum adapter integration tests: route parity + middleware
prk-Jr Apr 17, 2026
ec2f5f5
Add CI job for Axum adapter native build and test
prk-Jr Apr 17, 2026
93ec543
Update CLAUDE.md: add Axum adapter to workspace layout and build comm…
prk-Jr Apr 17, 2026
a5a7719
Fix clippy warnings: add #[must_use], Panics doc, replace eprintln wi…
prk-Jr Apr 17, 2026
ba6ca2e
Promote axum adapter to workspace member, remove global wasm32 target
prk-Jr Apr 17, 2026
a783330
Add Axum runtime environment to integration test matrix
prk-Jr Apr 17, 2026
e2b1a61
Remove unused StatusCode import from routes integration test
prk-Jr Apr 17, 2026
8b54aca
Update docs to cover Axum dev server alongside Fastly
prk-Jr Apr 17, 2026
e967133
Reorder local dev options: Fastly first, Axum second
prk-Jr Apr 17, 2026
6059de2
Fix CI: build and pass Axum binary to integration test job
prk-Jr Apr 17, 2026
75fe0d0
fix integration test
prk-Jr Apr 18, 2026
6b6c221
Address PR16 review findings: unused deps, stale lockfile, middleware…
prk-Jr Apr 21, 2026
0a15d1d
Fix fixed-port TIME_WAIT flakiness and add send_async/select divergen…
prk-Jr Apr 21, 2026
a780034
Restore request-scoped Axum HTTP client and fix dynamic-port logging
prk-Jr Apr 22, 2026
0dcc750
Resolve PR review findings
prk-Jr Apr 27, 2026
d3138fd
Merge feature/edgezero-pr15-remove-fastly-core into PR16
prk-Jr Apr 27, 2026
6d1184d
Complete PR15 merge and restructure workspace for mixed-target adapters
prk-Jr Apr 28, 2026
9a0d38c
Set default-members to fastly adapter so Viceroy can locate the binary
prk-Jr Apr 29, 2026
978fbb2
Resolve PR review findings and add startup listen log
prk-Jr May 12, 2026
130de76
Merge feature/edgezero-pr15-remove-fastly-core into PR16
prk-Jr May 12, 2026
314575b
Fix .gitignore comment: attribute .edgezero/ to upstream framework
prk-Jr May 13, 2026
bff1adc
Remove unused backend.rs — duplicate DEFAULT_FIRST_BYTE_TIMEOUT alrea…
prk-Jr May 13, 2026
b4851c4
Fix integration test failure
prk-Jr May 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
21 changes: 18 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# No global [build] target — the workspace contains adapters for multiple targets:
# trusted-server-adapter-fastly → wasm32-wasip1 (Fastly Compute)
# trusted-server-adapter-axum → native (dev server)
# Future: trusted-server-adapter-cloudflare → wasm32-unknown-unknown
#
# Both adapters are workspace members so `-p` resolves both.
# 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]
test_details = ["test", "--target", "aarch64-apple-darwin"]
# Fastly adapter + shared crates (wasm32-wasip1 via Viceroy)
test-fastly = ["test", "--workspace", "--exclude", "trusted-server-adapter-axum", "--target", "wasm32-wasip1"]
# Axum dev server adapter (native)
test-axum = ["test", "-p", "trusted-server-adapter-axum"]
# CI convenience — runs both in sequence (shell aliases can't chain; use a script or CI steps)
# cargo test-fastly && cargo test-axum

[build]
target = "wasm32-wasip1"
# Clippy — target-matched to avoid cross-target compile failures
clippy-fastly = ["clippy", "--workspace", "--exclude", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
clippy-axum = ["clippy", "-p", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--", "-D", "warnings"]

[target.'cfg(all(target_arch = "wasm32"))']
runner = "viceroy run -C ../../fastly.toml -- "
4 changes: 2 additions & 2 deletions .claude/agents/pr-creator.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Before creating the PR, verify the branch is healthy:

```
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace
cargo clippy-fastly && cargo clippy-axum
cargo test-fastly && cargo test-axum
cd crates/js/lib && npx vitest run
cd crates/js/lib && npm run format
cd docs && npm run format
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/pr-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ For each changed file, evaluate:
- Are new code paths tested?
- Are edge cases covered (empty input, max values, error paths)?
- If config-derived regex/pattern compilation changed: are invalid enabled-config startup failures and explicit `enabled = false` bypass cases both covered?
- Rust tests: `cargo test --workspace`
- Rust tests: `cargo test-fastly && cargo test-axum`
- JS tests: `npx vitest run` in `crates/js/lib/`

### 5. Classify findings
Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/verify-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ cargo fmt --all -- --check
### 2. Clippy

```bash
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo clippy-fastly && cargo clippy-axum
```

### 3. Rust Tests

```bash
cargo test --workspace
cargo test-fastly && cargo test-axum
```

### 4. JS Tests
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/setup-integration-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: Build the trusted-server WASM binary for integration tests.
required: false
default: "true"
build-axum:
description: Build the trusted-server-axum native binary for integration tests.
required: false
default: "true"
build-test-images:
description: Build the framework Docker images used by integration tests.
required: false
Expand Down Expand Up @@ -84,6 +88,16 @@ runs:
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1

- name: Build Axum native binary
if: ${{ inputs.build-axum == 'true' }}
shell: bash
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__EDGE_COOKIE__SECRET_KEY: integration-test-secret-key
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
run: cargo build -p trusted-server-adapter-axum

- name: Build WordPress test container
if: ${{ inputs.build-test-images == 'true' }}
shell: bash
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ jobs:
- name: Run cargo fmt
uses: actions-rust-lang/rustfmt@v1

- name: Run cargo clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Run cargo clippy (Fastly — wasm32-wasip1)
run: cargo clippy-fastly

- name: Run cargo clippy (Axum — native)
run: cargo clippy-axum

format-typescript:
runs-on: ubuntu-latest
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
ORIGIN_PORT: 8888
ARTIFACTS_DIR: /tmp/integration-test-artifacts
WASM_ARTIFACT_PATH: /tmp/integration-test-artifacts/wasm/trusted-server-adapter-fastly.wasm
AXUM_ARTIFACT_PATH: /tmp/integration-test-artifacts/axum/trusted-server-axum
DOCKER_ARTIFACT_PATH: /tmp/integration-test-artifacts/docker/test-images.tar

jobs:
Expand All @@ -32,8 +33,9 @@ jobs:

- name: Package integration test artifacts
run: |
mkdir -p "$(dirname "$WASM_ARTIFACT_PATH")" "$(dirname "$DOCKER_ARTIFACT_PATH")"
mkdir -p "$(dirname "$WASM_ARTIFACT_PATH")" "$(dirname "$AXUM_ARTIFACT_PATH")" "$(dirname "$DOCKER_ARTIFACT_PATH")"
cp target/wasm32-wasip1/release/trusted-server-adapter-fastly.wasm "$WASM_ARTIFACT_PATH"
cp target/debug/trusted-server-axum "$AXUM_ARTIFACT_PATH"
docker save \
--output "$DOCKER_ARTIFACT_PATH" \
test-wordpress:latest test-nextjs:latest
Expand Down Expand Up @@ -69,6 +71,9 @@ jobs:
name: integration-test-artifacts
path: ${{ env.ARTIFACTS_DIR }}

- name: Make binaries executable
run: chmod +x "$AXUM_ARTIFACT_PATH"

- name: Load integration test Docker images
run: docker load --input "$DOCKER_ARTIFACT_PATH"

Expand All @@ -80,6 +85,7 @@ jobs:
-- --include-ignored --skip test_wordpress_fastly --skip test_nextjs_fastly --test-threads=1
env:
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
AXUM_BINARY_PATH: ${{ env.AXUM_ARTIFACT_PATH }}
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
RUST_LOG: info

Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,30 @@ jobs:
run: cargo install --git https://github.com/fastly/Viceroy --tag v${{ steps.viceroy-version.outputs.viceroy-version }} viceroy

- name: Run tests
run: cargo test --workspace
run: cargo test-fastly

test-axum:
name: cargo test (axum native)
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
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust-version }}
cache-shared-key: cargo-${{ runner.os }}

- name: Build Axum adapter
run: cargo build -p trusted-server-adapter-axum

- name: Run Axum adapter tests
run: cargo test-axum
Comment thread
prk-Jr marked this conversation as resolved.
Comment thread
prk-Jr marked this conversation as resolved.

test-typescript:
name: vitest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/bin
/pkg
/target

# EdgeZero local KV store (created by edgezero-adapter-axum framework)
.edgezero/
Comment thread
prk-Jr marked this conversation as resolved.
/crates/integration-tests/target

# env
Expand Down
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ If you cannot read `CLAUDE.md`, follow these rules:

1. Present a plan and get approval before coding.
2. Keep changes minimal — do not refactor unrelated code.
3. Run `cargo test --workspace` after every code change.
3. Run tests after every code change — use the workspace aliases defined in `.cargo/config.toml`:
- `cargo test-fastly` — Fastly adapter + core (wasm32-wasip1 via Viceroy)
- `cargo test-axum` — Axum dev server adapter (native)
Do NOT use bare `cargo test --workspace` — it will attempt to compile the Fastly adapter for the host target.
4. Run `cargo fmt --all -- --check` and `cargo clippy --workspace --all-targets --all-features -- -D warnings`.
5. Run JS tests with `cd crates/js/lib && npx vitest run` when touching JS/TS code.
6. Use `error-stack` (`Report<E>`) for error handling — not anyhow, eyre, or thiserror.
Expand Down
19 changes: 14 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ real-time bidding integration, and publisher-side JavaScript injection.
crates/
trusted-server-core/ # Core library — shared logic, integrations, HTML processing
trusted-server-adapter-fastly/ # Fastly Compute entry point (wasm32-wasip1 binary)
trusted-server-adapter-axum/ # Axum dev server entry point (native binary)
js/ # TypeScript/JS build — per-integration IIFE bundles
lib/ # TS source, Vitest tests, esbuild pipeline
```
Expand Down Expand Up @@ -49,13 +50,21 @@ fastly compute serve

# Deploy to Fastly
fastly compute publish

# Run Axum dev server (native — no Viceroy)
cargo run -p trusted-server-adapter-axum

# Test Axum adapter only
cargo test-axum
```

### Testing & Quality

```bash
# Run all Rust tests (uses viceroy)
cargo test --workspace
# Run all Rust tests — use workspace aliases (see .cargo/config.toml)
# default-members = [fastly] so Viceroy can locate the binary via `cargo run --bin`.
cargo test-fastly # Fastly adapter + core (wasm32-wasip1 via Viceroy)
cargo test-axum # Axum dev server adapter (native)

# Format
cargo fmt --all -- --check
Expand Down Expand Up @@ -268,8 +277,8 @@ IntegrationRegistration::builder(ID)
Every PR must pass:

1. `cargo fmt --all -- --check`
2. `cargo clippy --workspace --all-targets --all-features -- -D warnings`
3. `cargo test --workspace`
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`)
Expand All @@ -282,7 +291,7 @@ 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 --workspace`.
4. **Test after every change** — `cargo test-fastly && cargo test-axum`.
5. **Explain as you go** — describe what you changed and why.
6. **If blocked** — explain what's blocking and why.

Expand Down
Loading
Loading