mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2413] [MERGED] Harden provider config fetch safety #5595
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5595
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2413
Author: @Promansis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Promansis
Base:
refactor← Head:issue-2390-config-fetch-safety📝 Commits (1)
327e7c9Harden provider config fetch safety📊 Changes
6 files changed (+1984 additions, -239 deletions)
View changed files
📝
src-tauri/Cargo.lock(+1 -0)📝
src-tauri/crates/llm/Cargo.toml(+1 -0)📝
src-tauri/crates/llm/src/lib.rs(+382 -42)📝
src-tauri/crates/security/src/lib.rs(+142 -9)📝
src-tauri/src/commands/storage/images/providers.rs(+497 -45)📝
src-tauri/src/commands/storage/llm.rs(+961 -143)📄 Description
Linked issue
Closes #2390
Why this change
Surface
10-CONN-ERROR-config-url-and-provider-error-safetyfrom #2384 regressed from legacy connection safety: refactor config/model/test fetches treated all local/private HTTP(S) targets as allowed and read provider error bodies fully before truncating or sanitizing.What changed
Refactor impact
Primary owner:
Rust storage/provider transport and security capability helpers.
Impact areas reviewed:
src-tauri/src/commands/storage/llm.rsconnection auth/model list pathssrc-tauri/crates/security/src/lib.rsoutbound/provider URL policy helperssrc-tauri/crates/llm/src/lib.rsprovider transport error/body readssrc-tauri/src/commands/storage/images/providers.rsimage provider response parsingBoundary notes:
Rust-only change. No React UI, engine, shared API, command registration, or remote-runtime TypeScript routing changes. Local/private provider opt-ins remain environment-scoped via
PROVIDER_LOCAL_URLS_ENABLEDandIMAGE_LOCAL_URLS_ENABLED.Pressure points touched:
None of ModeSurface, GameSurface, shared mode UI,
src-tauri/src/lib.rscommand registration, or import modules were touched.Validation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
cargo check --manifest-path src-tauri/Cargo.tomlcargo test --manifest-path src-tauri/Cargo.toml -p marinara-security provider_url_policy_allows_loopback_but_blocks_private_without_opt_in -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml provider_model_url_policy_allows_loopback_but_blocks_private_targets -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml provider_model_redirect_revalidates_private_target -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml provider_config_response_body_is_capped -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml image_provider_response_body_is_capped -- --nocapturecargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm ensure_url_allowed_redacts_query_secret -- --nocaptureresponse.text(),response.bytes(), orjson::<Value>()remains on the targeted model/test/image/LLM provider response paths.Feature Discoverability
Check exactly one:
src/features/shell/discovery/because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.Reason:
Security/parity bugfix for existing provider config fetch behavior; no new user-discoverable feature.
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
No UI changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.