Skip to content

🔒 feat(mq-lang,mq-run): make HTTP module imports opt-in via --allow-http-import - #2199

Merged
harehare merged 2 commits into
mainfrom
feat/http-import-opt-in
Aug 14, 2026
Merged

🔒 feat(mq-lang,mq-run): make HTTP module imports opt-in via --allow-http-import#2199
harehare merged 2 commits into
mainfrom
feat/http-import-opt-in

Conversation

@harehare

@harehare harehare commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

http-import predates SandboxedIo and was left outside its permission boundary for compatibility, so --allow-net never gated import/include of github.com/... or https://... URLs. Add a new --allow-http-import flag (and --allow-all) required before any HTTP/GitHub import is attempted; --allowed-domain keeps scoping which hosts are reachable once enabled. Library-level defaults (LSP/FFI/WASM embedders) are unchanged.

#2194

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

…ttp-import

http-import predates SandboxedIo and was left outside its permission
boundary for compatibility, so --allow-net never gated import/include
of github.com/... or https://... URLs. Add a new --allow-http-import
flag (and --allow-all) required before any HTTP/GitHub import is
attempted; --allowed-domain keeps scoping which hosts are reachable
once enabled. Library-level defaults (LSP/FFI/WASM embedders) are
unchanged.
@codspeed-hq

codspeed-hq Bot commented Aug 14, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing feat/http-import-opt-in (29e9028) with main (dccaf63)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (334d0dc) during the generation of this report, so dccaf63 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

mq.lock trusts a URL's content on first fetch and records it with no
signal, so a new HTTP-imported module can get silently trusted mid-CI
run instead of during a reviewable local run. Add --frozen (mirrors
npm ci / cargo build --locked / Bundler's --frozen): a URL with no
existing mq.lock entry becomes a hard error instead of being recorded.
Mutually exclusive with --no-lockfile.

mq-lang's runtime error messages (HTTP import disabled, lockfile
frozen/mismatch/parse-failure) no longer embed mq-run's CLI flag
spelling, matching the host-agnostic style already used by
SandboxedIo's permission errors; mq-lang is consumed by other
front-ends (LSP, FFI, WASM) that don't share mq-run's flags.
@harehare
harehare force-pushed the feat/http-import-opt-in branch from d5fc947 to 29e9028 Compare August 14, 2026 03:33
@harehare
harehare merged commit 435ce6b into main Aug 14, 2026
12 checks passed
@harehare
harehare deleted the feat/http-import-opt-in branch August 14, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant