[PR #2051] [MERGED] Fix remote backup list admin access #5412

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2051
Author: @cha1latte
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2039-backup-list-admin


📝 Commits (1)

  • 79dd6e7 Fix remote backup list admin access

📊 Changes

4 files changed (+20 additions, -2 deletions)

View changed files

📝 src-tauri/src/commands/storage/backup.rs (+1 -1)
📝 src-tauri/src/http_server.rs (+18 -0)
📝 src/shared/api/profile-api.ts (+0 -1)
📝 src/shared/api/remote-runtime.ts (+1 -0)

📄 Description

Linked issue

Closes #2039

Why this change

  • Remote backup_list was exposed through /api/invoke without the Admin Access tier even though listed backups included server-local filesystem paths.
  • Legacy backup listing only returned non-sensitive metadata, so the refactor remote runtime should not let non-loopback callers enumerate backup paths.

What changed

  • Added backup_list to the frontend privileged remote command set so remote web clients include the Admin Access header for the command.
  • Added backup_list to the server privileged remote command set so non-loopback callers without Admin Access are rejected.
  • Removed the local path field from managed backup list entries and tightened the frontend ManagedBackup type to match.
  • Added focused Rust coverage for remote backup_list Admin Access enforcement and backup-list path redaction.

Refactor impact

Primary owner:

Remote runtime, shared API, Rust storage.

Impact areas reviewed:

  • Remote invoke privileged-command header selection.
  • /api/invoke Admin Access gate for non-loopback callers.
  • Managed backup list response shape.
  • Settings backup UI usage of backup name and createdAt.

Boundary notes:

  • Engine code is untouched.
  • React feature UI is untouched; the shared backup API type no longer accepts path.
  • Rust changes stay within the HTTP remote gate and storage backup metadata payload.

Pressure points touched:

  • src/shared/api/remote-runtime.ts privileged command set.
  • src-tauri/src/http_server.rs privileged remote command gate.
  • src-tauri/src/commands/storage/backup.rs managed backup list metadata.

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

  • Before fix, a focused invariant probe failed with backup_list missing from frontend privileged remote command set.
  • After fix, the same invariant probe passed: backup_list remote privilege and path redaction invariants passed.
  • cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture passed: 2 passed, 0 failed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture passed: 11 passed, 0 failed.
  • pnpm typecheck passed after installing locked dependencies with pnpm install --frozen-lockfile.
  • cargo check --manifest-path src-tauri/Cargo.toml passed.
  • pnpm check passed.
  • Bunny review pass completed locally before opening the draft.

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 discoverable feature or workflow.

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

No docs changes needed; this is a focused remote-runtime security/metadata fix.

UI evidence

N/A: no visible UI changed. This was verified through focused invariant, Rust security/storage tests, and the full pnpm check baseline.

Summary by CodeRabbit

  • Bug Fixes

    • Backup list response no longer includes path metadata for each backup entry.
  • Security

    • Remote requests to the backup list API now require admin authentication credentials.

🔄 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/2051 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2039-backup-list-admin` --- ### 📝 Commits (1) - [`79dd6e7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79dd6e7a8f4eed7ce59b4e3af4ddce14575c2ebd) Fix remote backup list admin access ### 📊 Changes **4 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/backup.rs` (+1 -1) 📝 `src-tauri/src/http_server.rs` (+18 -0) 📝 `src/shared/api/profile-api.ts` (+0 -1) 📝 `src/shared/api/remote-runtime.ts` (+1 -0) </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 <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #2039 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Remote `backup_list` was exposed through `/api/invoke` without the Admin Access tier even though listed backups included server-local filesystem paths. - Legacy backup listing only returned non-sensitive metadata, so the refactor remote runtime should not let non-loopback callers enumerate backup paths. ## What changed <!-- List the key changes in this PR. --> - Added `backup_list` to the frontend privileged remote command set so remote web clients include the Admin Access header for the command. - Added `backup_list` to the server privileged remote command set so non-loopback callers without Admin Access are rejected. - Removed the local `path` field from managed backup list entries and tightened the frontend `ManagedBackup` type to match. - Added focused Rust coverage for remote `backup_list` Admin Access enforcement and backup-list path redaction. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Remote runtime, shared API, Rust storage. Impact areas reviewed: - Remote invoke privileged-command header selection. - `/api/invoke` Admin Access gate for non-loopback callers. - Managed backup list response shape. - Settings backup UI usage of backup `name` and `createdAt`. Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Engine code is untouched. - React feature UI is untouched; the shared backup API type no longer accepts `path`. - Rust changes stay within the HTTP remote gate and storage backup metadata payload. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `src/shared/api/remote-runtime.ts` privileged command set. - `src-tauri/src/http_server.rs` privileged remote command gate. - `src-tauri/src/commands/storage/backup.rs` managed backup list metadata. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] 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 <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Before fix, a focused invariant probe failed with `backup_list missing from frontend privileged remote command set`. - After fix, the same invariant probe passed: `backup_list remote privilege and path redaction invariants passed`. - `cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture` passed: 2 passed, 0 failed. - `cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture` passed: 11 passed, 0 failed. - `pnpm typecheck` passed after installing locked dependencies with `pnpm install --frozen-lockfile`. - `cargo check --manifest-path src-tauri/Cargo.toml` passed. - `pnpm check` passed. - Bunny review pass completed locally before opening the draft. ## 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 discoverable feature or workflow. ## 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 No docs changes needed; this is a focused remote-runtime security/metadata fix. ## UI evidence <!-- Add before/after screenshots or recordings for visible UI changes. --> N/A: no visible UI changed. This was verified through focused invariant, Rust security/storage tests, and the full `pnpm check` baseline. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Backup list response no longer includes path metadata for each backup entry. * **Security** * Remote requests to the backup list API now require admin authentication credentials. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:05 +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#5412
No description provided.