Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2f09ed1
Add ts dev proxy design spec and implementation plan
aram356 Jun 22, 2026
cb0b209
Add trusted-server-cli crate skeleton with ts dev proxy CLI surface
aram356 Jun 22, 2026
e0c8876
Merge branch 'main' into worktree-review-ts-dev-proxy-spec
aram356 Jun 22, 2026
e3b17b6
Add rewrite core with rule matching and header outcomes
aram356 Jun 22, 2026
cba4d7e
Harden rewrite rule matching, port parsing, and test coverage
aram356 Jun 22, 2026
03c4999
Resolve proxy args and env into a concrete rule table and settings
aram356 Jun 22, 2026
f4eaadb
Merge remote-tracking branch 'iabtechlab/main' into worktree-review-t…
aram356 Jun 22, 2026
2a2e85e
Drop environment-variable support from dev proxy CLI
aram356 Jun 22, 2026
092611e
Drop env-var support from dev proxy spec and plan
aram356 Jun 22, 2026
ed37bb8
Report I/O failure distinctly when --basic-auth-file cannot be read
aram356 Jun 22, 2026
8715a7f
Add per-machine local CA with leaf minting and caching
aram356 Jun 22, 2026
9e98c07
Create CA key file with mode 0600 from first byte
aram356 Jun 22, 2026
cb67c49
Add CONNECT MITM proxy server with blind tunnel and local PAC route
aram356 Jun 22, 2026
0f649ca
Fix blind-HTTP head replay and add 403 guard test for off-loopback CO…
aram356 Jun 22, 2026
59186c3
Merge remote-tracking branch 'iabtechlab/main' into worktree-review-t…
aram356 Jun 22, 2026
cdd9d6a
Format trusted-server-cli with rustfmt
aram356 Jun 22, 2026
29dfb35
Add browser orchestration, PAC generation, and ca trust subcommands
aram356 Jun 23, 2026
5a5c5f5
Persist and recover Safari system proxy state across hard kills
aram356 Jun 23, 2026
6000366
Infer dev-proxy rule from trusted-server.toml for zero-arg use
aram356 Jun 23, 2026
41245de
Document ts dev proxy setup, trust, and troubleshooting
aram356 Jun 23, 2026
abe3d17
Format dev proxy spec and plan with Prettier
aram356 Jun 23, 2026
f1cd505
Commit trusted-server-cli lockfile with resolved dependencies
aram356 Jun 23, 2026
28e488d
Merge remote-tracking branch 'iabtechlab/worktree-review-ts-dev-proxy…
aram356 Jun 23, 2026
f409f34
Require explicit rewrite rule; drop trusted-server.toml inference
aram356 Jun 23, 2026
a289b83
Update spec, plan, and guide: rules are explicit, no toml inference
aram356 Jun 23, 2026
2f79728
Change default proxy port to 18080 to avoid 8080 collisions
aram356 Jun 23, 2026
a8ba326
Open Safari at the FROM URL on --launch safari, like Chrome and Firefox
aram356 Jun 23, 2026
e6989b5
Note Safari opens the FROM URL in the plan
aram356 Jun 23, 2026
762c1a2
Fix Safari network-service detection and elevate networksetup with sudo
aram356 Jun 23, 2026
7b83b90
Address dev-proxy review: Safari restore, PAC route, per-request Host…
aram356 Jun 23, 2026
4033fc8
Document Safari restore state/interactivity and explicit-rule order
aram356 Jun 23, 2026
9485abe
Harden Safari recovery, CA partial state, regenerate trust, Host matc…
aram356 Jun 23, 2026
668a2bf
Abort Safari config without restore record, confirm CA revocation, sh…
aram356 Jun 23, 2026
0133242
Add native CI job for the dev-proxy CLI crate and document regenerate…
aram356 Jun 23, 2026
47905d9
Address dev-proxy review round 4: macOS-only gate, regenerate abort, …
aram356 Jun 23, 2026
0602730
Scope dev-proxy deps to macOS so wasm builds fail with the clear message
aram356 Jun 24, 2026
e98f241
Support IP upstreams via an optional-valued --rewrite-host
aram356 Jun 24, 2026
442e27c
Drop the macOS-only compile_error gate; rely on macOS-scoped deps
aram356 Jun 24, 2026
7e16997
Add --resolve DNS pin and simplify --rewrite-host back to a flag
aram356 Jun 24, 2026
73dea69
Sync dev-proxy plan with --resolve + rewrite_host bool design
aram356 Jun 24, 2026
27379e9
Apply --resolve to every upstream connection, log pins at startup
aram356 Jun 24, 2026
9be877d
Send X-Forwarded-Host: FROM so first-party URLs stay on the productio…
aram356 Jun 24, 2026
c9bebdd
Address self-review nits in the dev proxy
aram356 Jun 25, 2026
c91abf3
Strip inbound Forwarded and reconcile X-Forwarded-Host docs
aram356 Jun 25, 2026
18fccb2
Merge branch 'main' into worktree-review-ts-dev-proxy-spec
aram356 Jun 29, 2026
08a1db7
Merge remote-tracking branch 'origin/main' into worktree-review-ts-de…
aram356 Jun 30, 2026
1f529a1
Address dev-proxy review: CA-regenerate, credential, scheme, browser …
aram356 Jun 30, 2026
59bb304
Address second dev-proxy review round: hop-by-hop, temp dir, CA, plat…
aram356 Jul 1, 2026
d5893bb
Merge branch 'main' into worktree-review-ts-dev-proxy-spec
aram356 Jul 1, 2026
26b1eaa
Merge origin/main, folding the dev proxy into the ts CLI
aram356 Jul 1, 2026
bbe2b2f
Merge remote-tracking branch 'iabtechlab/worktree-review-ts-dev-proxy…
aram356 Jul 1, 2026
250e8f3
Fix CI: Linux CLI clippy and edgezero dual-source parity
aram356 Jul 1, 2026
b8b72e9
Align dev-proxy webpki-roots to 1.0 to match EdgeZero
aram356 Jul 1, 2026
eefbc9f
Make integration-tests a workspace member; centralize deps in the wor…
aram356 Jul 1, 2026
3872eea
Merge remote-tracking branch 'origin/main' into worktree-review-ts-de…
aram356 Jul 1, 2026
45b2611
Organize all ts CLI commands under commands/<name>/
aram356 Jul 1, 2026
34ec9c1
Restore spin edgezero.toml; drop now-redundant CLI fmt CI step
aram356 Jul 1, 2026
94bbb7f
Unify edgezero.toml into one multi-adapter manifest
aram356 Jul 1, 2026
6a35b7f
Address PR review feedback for ts dev proxy
aram356 Jul 2, 2026
2eb346f
Address PR review feedback for ts dev proxy
aram356 Jul 2, 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
64 changes: 37 additions & 27 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,54 @@
#
# 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.
# The aliases below are grouped by adapter; each targets its adapter with the
# correct toolchain (build / check / test / clippy).

[alias]
# Generic: native test with an explicit host target.
test_details = ["test", "--target", "aarch64-apple-darwin"]
test_cli_macos = ["test", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]
build_cli_macos = ["build", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]
test_cli_linux = ["test", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
build_cli_linux = ["build", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
# Fastly adapter + shared crates (wasm32-wasip1 via Viceroy)
# 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", "--exclude", "trusted-server-adapter-spin", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
# --- Fastly adapter (wasm32-wasip1, run via Viceroy) ---
# Whitelist the wasm-buildable crates (the Fastly adapter + the shared crates it
# builds/tests on wasm) rather than blacklisting every native crate — so adding a
# native crate needs no change here. Axum (native), Cloudflare
# (wasm32-unknown-unknown), Spin, the CLI (native), and integration-tests
# (native) are simply not listed.
build-fastly = ["build", "-p", "trusted-server-core", "-p", "trusted-server-adapter-fastly", "-p", "trusted-server-js", "-p", "trusted-server-openrtb", "--target", "wasm32-wasip1"]
check-fastly = ["check", "-p", "trusted-server-core", "-p", "trusted-server-adapter-fastly", "-p", "trusted-server-js", "-p", "trusted-server-openrtb", "--target", "wasm32-wasip1"]
clippy-fastly = ["clippy", "-p", "trusted-server-core", "-p", "trusted-server-adapter-fastly", "-p", "trusted-server-js", "-p", "trusted-server-openrtb", "--all-targets", "--all-features", "--target", "wasm32-wasip1", "--", "-D", "warnings"]
test-fastly = ["test", "-p", "trusted-server-core", "-p", "trusted-server-adapter-fastly", "-p", "trusted-server-js", "-p", "trusted-server-openrtb", "--target", "wasm32-wasip1"]

# --- Axum adapter (native dev server) ---
build-axum = ["build", "-p", "trusted-server-adapter-axum"]
check-axum = ["check", "-p", "trusted-server-adapter-axum"]
clippy-axum = ["clippy", "-p", "trusted-server-adapter-axum", "--all-targets", "--all-features", "--", "-D", "warnings"]
test-axum = ["test", "-p", "trusted-server-adapter-axum"]

# --- Cloudflare adapter (native host + wasm32-unknown-unknown) ---
# Build/check target the WASM runtime (requires the `cloudflare` feature);
# tests and clippy run on the native host.
build-cloudflare = ["build", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]
check-cloudflare = ["check", "-p", "trusted-server-adapter-cloudflare", "--target", "wasm32-unknown-unknown", "--features", "cloudflare"]
# 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"]
test-cloudflare = ["test", "-p", "trusted-server-adapter-cloudflare"]

# --- Spin adapter (native host tests + wasm32-wasip1 target) ---
check-spin = ["check", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin"]
clippy-spin-native = ["clippy", "-p", "trusted-server-adapter-spin", "--all-targets", "--", "-D", "warnings"]
clippy-spin-wasm = ["clippy", "-p", "trusted-server-adapter-spin", "--target", "wasm32-wasip1", "--features", "spin", "--lib", "--", "-D", "warnings"]
test-spin = ["test", "-p", "trusted-server-adapter-spin"]

# Build — target-matched, same split as test/clippy
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", "--exclude", "trusted-server-adapter-spin", "--target", "wasm32-wasip1"]
check-axum = ["check", "-p", "trusted-server-adapter-axum"]
# --- ts operator CLI (native host; per-OS target overrides the wasm default) ---
build_cli_linux = ["build", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
build_cli_macos = ["build", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]
run_cli_linux = ["run", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu", "--"]
run_cli_macos = ["run", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin", "--"]
test_cli_linux = ["test", "--package", "trusted-server-cli", "--target", "x86_64-unknown-linux-gnu"]
test_cli_macos = ["test", "--package", "trusted-server-cli", "--target", "aarch64-apple-darwin"]

# When a wasm binary IS built, run it under Viceroy.
[target.'cfg(all(target_arch = "wasm32"))']
runner = "viceroy run -C ../../fastly.toml -- "
9 changes: 0 additions & 9 deletions .github/actions/setup-integration-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ inputs:
origin-port:
description: Fixed origin port baked into the WASM binary for integration tests.
required: true
check-dependency-versions:
description: Run the integration dependency version consistency check.
required: false
default: "true"
install-viceroy:
description: Install the Viceroy binary used by integration tests.
required: false
Expand Down Expand Up @@ -38,11 +34,6 @@ outputs:
runs:
using: composite
steps:
- name: Check shared dependency versions
if: ${{ inputs.check-dependency-versions == 'true' }}
shell: bash
run: ./scripts/check-integration-dependency-versions.sh

- name: Retrieve Rust version
id: rust-version
shell: bash
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-axum: "false"
Expand Down Expand Up @@ -128,7 +127,6 @@ jobs:
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-test-images: "false"
Expand Down Expand Up @@ -172,7 +170,6 @@ jobs:
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-test-images: "false"
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,41 @@ jobs:
- name: Clippy (parity test crate)
run: cargo clippy --manifest-path crates/trusted-server-integration-tests/Cargo.toml --all-targets -- -D warnings

test-cli:
# `trusted-server-cli` is a workspace member, but the workspace default target
# is wasm32-wasip1 (see .cargo/config.toml), where the crate is an empty shell
# — so the wasm workspace jobs do not exercise its real code. `ts dev proxy` is
# a macOS tool (Safari/keychain/networksetup), so validate the crate on macOS
# with an explicit native --target that overrides the wasm default.
name: cargo test (ts CLI, native)
runs-on: macos-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 }}
components: "clippy, rustfmt"
cache-shared-key: cargo-cli-${{ runner.os }}

# No separate `cargo fmt` here: `trusted-server-cli` is a workspace member,
# so the main `cargo fmt --all` job already formats it. Clippy still needs a
# native run — the workspace clippy jobs are wasm/adapter-scoped and never
# lint the CLI's host-only code (macOS dev proxy vs Linux audit differ by cfg).
- name: cargo clippy
run: |
cargo clippy --manifest-path crates/trusted-server-cli/Cargo.toml --target "$(rustc -vV | sed -n 's/host: //p')" --all-targets -- -D warnings

- name: cargo test
run: |
cargo test --manifest-path crates/trusted-server-cli/Cargo.toml --target "$(rustc -vV | sed -n 's/host: //p')"

test-typescript:
name: vitest
runs-on: ubuntu-latest
Expand Down
Loading
Loading