mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-23 20:04:05 +02:00
crates-server/yaak-send-proxy: a stateless executor over yaak-http's HttpTransaction. It takes a rendered request, streams timeline events, the response head, body chunks and the resulting cookies back as NDJSON, and keeps nothing. Private/loopback/link-local/metadata ranges are refused after DNS on every hop (an AddressFilter on the resolver plus a per-hop URL check), with size caps, a timeout ceiling, a rate limit, host allow/deny lists and an optional token. The web host now sends through it: the wasm worker resolves and renders the request (render_http_request moved into yaak-models so it builds for wasm; re-exported from its old paths), the tab posts it, and stores what comes back where the desktop stores it. Requests needing auth plugins or template functions are refused with the reason until plugins run in the browser.
40 lines
1.4 KiB
TOML
40 lines
1.4 KiB
TOML
[package]
|
|
name = "yaak-web"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
publish = false
|
|
|
|
# The desktop's model layer, compiled for a browser tab. See src/lib.rs.
|
|
#
|
|
# Building needs a clang with a WebAssembly backend: sqlite-wasm-rs compiles
|
|
# sqlite3.c to wasm at build time, and Apple's clang cannot target it. See
|
|
# build-wasm.cjs, which points cc at Homebrew LLVM when it is present.
|
|
|
|
[package.metadata.wasm-pack.profile.release]
|
|
wasm-opt = false # Matches yaak-templates; wasm-opt has caused errors in CI
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
# The whole crate is `#![cfg(target_arch = "wasm32")]`: on a native target it
|
|
# is empty, so a workspace-wide `cargo test` neither builds SQLite's wasm shim
|
|
# for the host (which fails) nor links a browser-only runtime. Everything that
|
|
# only exists for wasm is a target-scoped dependency for the same reason.
|
|
|
|
[dependencies]
|
|
log = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true }
|
|
yaak-models = { workspace = true }
|
|
# No default features: the template exports belong to @yaakapp-internal/templates, not this module
|
|
yaak-templates = { path = "../yaak-templates", default-features = false }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
console_error_panic_hook = "0.1"
|
|
js-sys = "0.3"
|
|
serde-wasm-bindgen = "0.6.5"
|
|
sqlite-wasm-rs = "0.5"
|
|
sqlite-wasm-vfs = "0.2"
|
|
wasm-bindgen = "0.2.100"
|
|
wasm-bindgen-futures = "0.4"
|