- export.rs: marqdo view export PATH --out DIR through the same ReaderRenderer; index.html + pages/<relative>.html + hash-named assets + manifest.json - export never calls Core run; refuses output inside project root and unrelated non-empty dirs; staging + atomic rename replaces only prior View exports - offline by construction: embedded asset bytes, data-URI images, relative links, no remote subresources; --no-annotations hides anchors only - HTTP hardening: max 32 concurrent requests (503), detail-free public error JSON/pages (no absolute paths/subprocess text), 30s page check budget - tools/test-export.sh (manifest hashes + file:// Chromium offline check), tools/test-security.sh, adversarial security-project browser fixture - tests/export.rs export contracts; ADR-0005; docs updated
23 lines
681 B
Bash
Executable File
23 lines
681 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Security/contract suite: HTTP boundary, CSRF/Origin, path escapes, XSS
|
|
# sanitization, export-no-exec, architectural coupling gates.
|
|
#
|
|
# Usage: tools/test-security.sh
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$repo_root"
|
|
|
|
cargo test --locked --test http_live
|
|
cargo test --locked --test rendering
|
|
cargo test --locked --test export
|
|
cargo test --locked --test no_coupling
|
|
cargo test --locked --test asset_integrity
|
|
|
|
if [[ -n "${MARQDO_FROZEN_BIN:-}" ]]; then
|
|
MARQDO_BIN="$MARQDO_FROZEN_BIN" ./tools/test-export.sh
|
|
else
|
|
echo "note: MARQDO_FROZEN_BIN not set; skipped real-core export script"
|
|
fi
|
|
echo "security: PASS"
|