[PR #1903] [MERGED] Reject unsupported storage entities #5343

Closed
opened 2026-10-22 04:15:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1903
Author: @Promansis
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-1892-storage-allowlist


📝 Commits (2)

  • d7314d8 Reject unsupported storage entities
  • 6ffadd4 Guard storage duplicate entities

📊 Changes

2 files changed (+191 additions, -48 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+140 -3)
📝 src-tauri/src/http_dispatch.rs (+51 -45)

📄 Description

Linked issue

Closes #1892

Why this change

  • Generic storage commands accepted any syntactically safe collection name, which let unsupported entities create new JSON collection files under data/collections.
  • The storage command boundary needs to reject unsupported entities before callers reach file-backed persistence.

What changed

  • Added an explicit supported-entity registry for generic storage commands.
  • Validated storage_list, storage_get, storage_create, storage_update, and storage_delete before touching FileStorage.
  • Routed remote runtime storage_get, storage_create, and storage_update through the same entity command helpers used by desktop commands.
  • Added regression coverage for unsupported entity rejection and supported entity behavior.

Refactor impact

Primary owner:

Rust storage and remote runtime.

Impact areas reviewed:

  • Tauri generic storage commands.
  • Hostable /api/invoke storage dispatch.
  • Message projection/materialization behavior.
  • Connection masking and connection-folder validation behavior.

Boundary notes:

  • The supported collection contract now lives at the Rust generic storage command owner.
  • Remote dispatch delegates to the same command helpers for generic get/create/update behavior instead of duplicating storage access.
  • No React, engine, or shared API wrapper changes.

Pressure points touched:

  • src-tauri/src/http_dispatch.rs
  • Generic storage command helpers in src-tauri/src/commands/storage/commands/entities.rs

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands_reject_unsupported_entities
  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands_still_accept_supported_entities
  • cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_create_rejects_unsupported_entity
  • cargo check --manifest-path src-tauri/Cargo.toml

Feature Discoverability

Check exactly one:

  • Updated 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.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new user-discoverable workflow or feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

No UI changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1903 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-1892-storage-allowlist` --- ### 📝 Commits (2) - [`d7314d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7314d87b596e9d3b2f3218c3c6767e2f39b6efb) Reject unsupported storage entities - [`6ffadd4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6ffadd43058b55e23055ba9234a285246d07f3b8) Guard storage duplicate entities ### 📊 Changes **2 files changed** (+191 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+140 -3) 📝 `src-tauri/src/http_dispatch.rs` (+51 -45) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1892 ## Why this change - Generic storage commands accepted any syntactically safe collection name, which let unsupported entities create new JSON collection files under `data/collections`. - The storage command boundary needs to reject unsupported entities before callers reach file-backed persistence. ## What changed - Added an explicit supported-entity registry for generic storage commands. - Validated `storage_list`, `storage_get`, `storage_create`, `storage_update`, and `storage_delete` before touching `FileStorage`. - Routed remote runtime `storage_get`, `storage_create`, and `storage_update` through the same entity command helpers used by desktop commands. - Added regression coverage for unsupported entity rejection and supported entity behavior. ## Refactor impact Primary owner: Rust storage and remote runtime. Impact areas reviewed: - Tauri generic storage commands. - Hostable `/api/invoke` storage dispatch. - Message projection/materialization behavior. - Connection masking and connection-folder validation behavior. Boundary notes: - The supported collection contract now lives at the Rust generic storage command owner. - Remote dispatch delegates to the same command helpers for generic get/create/update behavior instead of duplicating storage access. - No React, engine, or shared API wrapper changes. Pressure points touched: - `src-tauri/src/http_dispatch.rs` - Generic storage command helpers in `src-tauri/src/commands/storage/commands/entities.rs` ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands_reject_unsupported_entities` - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands_still_accept_supported_entities` - `cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_create_rejects_unsupported_entity` - `cargo check --manifest-path src-tauri/Cargo.toml` ## Feature Discoverability Check exactly one: - [ ] Updated `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. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new user-discoverable workflow or feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5343
No description provided.