[PR #191] [MERGED] fix(long-term-memory): forward saved admin secret #847

Closed
opened 2026-10-20 17:31:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/191
Author: @Promansis
Created: 8/2/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/186-ltm-admin-secret


📝 Commits (3)

  • 8ced294 fix(long-term-memory): forward saved admin secret
  • 2607e7a Merge branch 'staging' into fix/186-ltm-admin-secret
  • c2c8c33 fix(ci): avoid secret lookup on review events

📊 Changes

12 files changed (+102 additions, -53 deletions)

View changed files

📝 .github/workflows/pull-request-triage.yml (+12 -0)
➕ artifacts/long-term-memory-1.0.9.zip (+0 -0)
📝 catalog/catalog.json (+7 -7)
📝 catalog/v2/catalog.json (+7 -7)
📝 catalog/v3/catalog.json (+7 -7)
📝 packages/long-term-memory/client.js (+16 -16)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ActivityView.tsx (+2 -4)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx (+2 -4)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts (+24 -2)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-storage.regression.ts (+21 -2)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #186

Why this change

  • Long-Term Memory uses privileged package routes, but its client-side direct fetch calls omitted the X-Admin-Secret header. Remote Engine users therefore received 403 responses even when the admin secret was already saved by the Engine UI.

What changed

  • Added same-origin Long-Term Memory request authentication using the existing marinara_admin_secret local-storage value.
  • Reused the authenticated request path for debug-log and backup downloads.
  • Added client request regression coverage for present and absent saved secrets.
  • Regenerated the Long-Term Memory package payload, artifact, manifest, and catalog entries.
  • Bumped Long-Term Memory from 1.0.8 to 1.0.9.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: None; existing compatibility range retained.
  • New or changed permissions/entrypoints: None; existing privileged routes remain privileged.
  • Restart, storage, update, or uninstall impact: Package update requires the existing package restart behavior; no storage or uninstall behavior changes.

Security scope: this forwards the existing browser-saved secret only to same-origin /api/long-term-memory requests. Server-side host validation, Basic Auth, loopback/allowlist rules, required-secret checks, constant-time comparison, and CSRF handling are unchanged. Missing or invalid secrets continue to fail with 403. The secret is not placed in URLs, logs, or exported data.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Automated validation performed

  • long-term-memory-storage.regression.ts passed, including saved-secret header presence and absent-secret behavior.
  • long-term-memory-routes.regression.ts passed.
  • long-term-memory-lifecycle.regression.ts passed, including install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation.
  • node scripts/test-catalog-lanes.mjs passed.
  • node scripts/validate-catalog.mjs passed.
  • git diff --check passed.
  • unzip -t artifacts/long-term-memory-1.0.9.zip passed.

Manual verification notes

  • The lifecycle regression exercised the package manager install/reinstall and offline restart paths against the neighboring Marinara Engine checkout.
  • Browser verification against a non-loopback Raspberry Pi host with a saved admin secret remains a maintainer follow-up.
  • Negative server authentication behavior remains covered by the privileged route regression; no server gate was changed.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

Not applicable; this fixes package API authentication.

Summary by CodeRabbit

  • New Features
    • Added authenticated API requests using stored admin credentials.
    • Improved debug-log and backup exports through the shared request process.
  • Bug Fixes
    • Ensured requests use the configured endpoint and avoid cached responses.
  • Tests
    • Added coverage for credential headers and missing credentials.
  • Chores
    • Upgraded Long-Term Memory to version 1.0.9 and refreshed catalog metadata.
    • Updated pull request approval routing based on contributor association.

🔄 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-Agents/pull/191 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 8/2/2026 **Status:** ✅ Merged **Merged:** 8/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/186-ltm-admin-secret` --- ### 📝 Commits (3) - [`8ced294`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8ced294bed31b15db909f5d44374735701632267) fix(long-term-memory): forward saved admin secret - [`2607e7a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2607e7ac37b839cc58de01699f7612630402be4b) Merge branch 'staging' into fix/186-ltm-admin-secret - [`c2c8c33`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c2c8c3396c56218b068ad9ef1f468d3cdb165693) fix(ci): avoid secret lookup on review events ### 📊 Changes **12 files changed** (+102 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-triage.yml` (+12 -0) ➕ `artifacts/long-term-memory-1.0.9.zip` (+0 -0) 📝 `catalog/catalog.json` (+7 -7) 📝 `catalog/v2/catalog.json` (+7 -7) 📝 `catalog/v3/catalog.json` (+7 -7) 📝 `packages/long-term-memory/client.js` (+16 -16) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ActivityView.tsx` (+2 -4) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx` (+2 -4) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts` (+24 -2) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-storage.regression.ts` (+21 -2) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #186 ## Why this change - Long-Term Memory uses privileged package routes, but its client-side direct `fetch` calls omitted the `X-Admin-Secret` header. Remote Engine users therefore received `403` responses even when the admin secret was already saved by the Engine UI. ## What changed - Added same-origin Long-Term Memory request authentication using the existing `marinara_admin_secret` local-storage value. - Reused the authenticated request path for debug-log and backup downloads. - Added client request regression coverage for present and absent saved secrets. - Regenerated the Long-Term Memory package payload, artifact, manifest, and catalog entries. - Bumped Long-Term Memory from `1.0.8` to `1.0.9`. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: None; existing compatibility range retained. - New or changed permissions/entrypoints: None; existing privileged routes remain privileged. - Restart, storage, update, or uninstall impact: Package update requires the existing package restart behavior; no storage or uninstall behavior changes. Security scope: this forwards the existing browser-saved secret only to same-origin `/api/long-term-memory` requests. Server-side host validation, Basic Auth, loopback/allowlist rules, required-secret checks, constant-time comparison, and CSRF handling are unchanged. Missing or invalid secrets continue to fail with `403`. The secret is not placed in URLs, logs, or exported data. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Automated validation performed - `long-term-memory-storage.regression.ts` passed, including saved-secret header presence and absent-secret behavior. - `long-term-memory-routes.regression.ts` passed. - `long-term-memory-lifecycle.regression.ts` passed, including install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation. - `node scripts/test-catalog-lanes.mjs` passed. - `node scripts/validate-catalog.mjs` passed. - `git diff --check` passed. - `unzip -t artifacts/long-term-memory-1.0.9.zip` passed. ### Manual verification notes - The lifecycle regression exercised the package manager install/reinstall and offline restart paths against the neighboring Marinara Engine checkout. - Browser verification against a non-loopback Raspberry Pi host with a saved admin secret remains a maintainer follow-up. - Negative server authentication behavior remains covered by the privileged route regression; no server gate was changed. ## Documentation impact - [x] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable; this fixes package API authentication. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added authenticated API requests using stored admin credentials. * Improved debug-log and backup exports through the shared request process. * **Bug Fixes** * Ensured requests use the configured endpoint and avoid cached responses. * **Tests** * Added coverage for credential headers and missing credentials. * **Chores** * Upgraded Long-Term Memory to version 1.0.9 and refreshed catalog metadata. * Updated pull request approval routing based on contributor association. <!-- 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-20 17:31:35 +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-Agents#847
No description provided.