[PR #2087] [MERGED] Migrate legacy Admin Access browser secret #5429

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2063-admin-secret-key


📝 Commits (2)

  • 20b897a Migrate legacy admin secret key
  • 729c409 Harden admin secret legacy migration

📊 Changes

5 files changed (+239 additions, -7 deletions)

View changed files

➕ scratch/bugfix-verification.json (+79 -0)
➕ scratch/repro-2063-admin-secret-key.mjs (+116 -0)
➕ scratch/repro-2063-output.txt (+1 -0)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+4 -5)
📝 src/shared/api/remote-runtime.ts (+39 -2)

📄 Description

Linked issue

Closes #2063

Why this change

  • Legacy Marinara stored browser Admin Access under marinara_admin_secret, while refactor only read and wrote marinara-admin-secret.
  • Users with an existing legacy browser secret could hit privileged remote-runtime flows and look unauthenticated until they re-entered the same secret.

What changed

  • Added shared Admin Access storage helpers in src/shared/api/remote-runtime.ts.
  • The helpers read the current key first, migrate a legacy-only value to the current key, trim stored values, and clear stale legacy data.
  • Settings now initializes, saves, and clears Admin Access through the shared helper so the visible field and privileged remote headers agree.

Refactor impact

Primary owner:

  • Shared API / remote runtime and shell settings.

Impact areas reviewed:

  • Remote Runtime privileged command header generation.
  • Settings Advanced Admin Access field initialization/save/clear behavior.
  • Browser localStorage compatibility for legacy and refactor key names.

Boundary notes:

  • Feature UI calls a focused shared API wrapper; no raw remote-runtime fetch or raw Tauri boundary was added.
  • No engine, Rust, schema, dependency, prompt, or release metadata changes.
  • The migration is browser-local only and does not change the remote ADMIN_SECRET contract or x-admin-secret header name.

Pressure points touched:

  • src/shared/api/remote-runtime.ts Admin Access header helper.
  • SettingsPanel Advanced Admin Access control.

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: static source repro against origin/refactor showed remote-runtime.ts had no marinara_admin_secret, readAdminSecretStorage, or writeAdminSecretStorage handling.
  • After fix: node scratch/repro-2063-admin-secret-key.mjs passed.
  • Scratch proof covered: legacy-only migration, current-key precedence when both keys exist, nonblank save trimming/current-key write, blank save clearing both keys, and no-window read returning empty.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check:line-endings passed.
  • Full pnpm check passed after rebase onto current origin/refactor.
  • Bunny review pass: pass. Non-blocking tooling note: C:\Users\celia\.codex\tools\marinara-proof-gate.mjs was not available locally, so the optional proof-gate helper could not be run.

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. It preserves an existing Admin Access setting across the legacy/refactor browser-storage key change.

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

N/A. This is a browser-storage compatibility bugfix for the existing Admin Access setting and remote-runtime header path; scratch command proof is recorded under scratch/.


🔄 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/2087 **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-2063-admin-secret-key` --- ### 📝 Commits (2) - [`20b897a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/20b897ae4d8e7493fc3fdec58f0bf9e7e7a8237b) Migrate legacy admin secret key - [`729c409`](https://github.com/Pasta-Devs/Marinara-Engine/commit/729c40992b2b47e9966fef99116a15fa5e7096db) Harden admin secret legacy migration ### 📊 Changes **5 files changed** (+239 additions, -7 deletions) <details> <summary>View changed files</summary> ➕ `scratch/bugfix-verification.json` (+79 -0) ➕ `scratch/repro-2063-admin-secret-key.mjs` (+116 -0) ➕ `scratch/repro-2063-output.txt` (+1 -0) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+4 -5) 📝 `src/shared/api/remote-runtime.ts` (+39 -2) </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 #2063 ## Why this change - Legacy Marinara stored browser Admin Access under `marinara_admin_secret`, while refactor only read and wrote `marinara-admin-secret`. - Users with an existing legacy browser secret could hit privileged remote-runtime flows and look unauthenticated until they re-entered the same secret. ## What changed - Added shared Admin Access storage helpers in `src/shared/api/remote-runtime.ts`. - The helpers read the current key first, migrate a legacy-only value to the current key, trim stored values, and clear stale legacy data. - Settings now initializes, saves, and clears Admin Access through the shared helper so the visible field and privileged remote headers agree. ## Refactor impact Primary owner: - Shared API / remote runtime and shell settings. Impact areas reviewed: - Remote Runtime privileged command header generation. - Settings Advanced Admin Access field initialization/save/clear behavior. - Browser localStorage compatibility for legacy and refactor key names. Boundary notes: - Feature UI calls a focused shared API wrapper; no raw remote-runtime fetch or raw Tauri boundary was added. - No engine, Rust, schema, dependency, prompt, or release metadata changes. - The migration is browser-local only and does not change the remote `ADMIN_SECRET` contract or `x-admin-secret` header name. Pressure points touched: - `src/shared/api/remote-runtime.ts` Admin Access header helper. - `SettingsPanel` Advanced Admin Access control. ## 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 - Before fix: static source repro against `origin/refactor` showed `remote-runtime.ts` had no `marinara_admin_secret`, `readAdminSecretStorage`, or `writeAdminSecretStorage` handling. - After fix: `node scratch/repro-2063-admin-secret-key.mjs` passed. - Scratch proof covered: legacy-only migration, current-key precedence when both keys exist, nonblank save trimming/current-key write, blank save clearing both keys, and no-window read returning empty. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check:line-endings` passed. - Full `pnpm check` passed after rebase onto current `origin/refactor`. - Bunny review pass: pass. Non-blocking tooling note: `C:\Users\celia\.codex\tools\marinara-proof-gate.mjs` was not available locally, so the optional proof-gate helper could not be run. ## 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. It preserves an existing Admin Access setting across the legacy/refactor browser-storage key change. ## 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 N/A. This is a browser-storage compatibility bugfix for the existing Admin Access setting and remote-runtime header path; scratch command proof is recorded under `scratch/`. --- <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:13 +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#5429
No description provided.