[PR #5824] [MERGED] fix(capabilities): allow trusted internal package routes #6956

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5824
Author: @Gunterlie
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @Gunterlie

Base: staging ← Head: loopback-noodles-no-secret


📝 Commits (5)

  • b9e45fb fix(capabilities): allow trusted internal package routes
  • 900eec8 fix(capabilities): support nested internal route prefixes
  • a533054 fix(capabilities): preserve internal route state on retry
  • 7d81515 fix(capabilities): track overlapping route registrations
  • 4396f16 Merge remote-tracking branch 'origin/staging' into loopback-noodles-no-secret

📊 Changes

4 files changed (+192 additions, -7 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/services/capability-packages/capability-module-runtime.service.ts (+8 -2)
📝 packages/server/src/services/capability-packages/capability-route-registration.service.ts (+86 -5)
➕ scripts/regressions/capability-internal-route.regression.ts (+97 -0)

📄 Description

Linked issue

Closes #5818

Why this change

Backend Noodle and Slurp schedulers use app.inject() and fail the privileged route gate when loopback admin-secret enforcement is enabled. Browser-only X-Admin-Secret access must not be required for trusted server work.

What changed

  • Added optional package-scoped api.runInternalRoute().
  • Added server-generated internal request authorization for active package routes.
  • Kept normal external package route requests on the existing privileged gate.
  • Added positive and negative regression coverage.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated proof: pnpm check and the capability internal route regression passed. Manual browser and container checks remain for a human contributor.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No UI changes.

Summary by CodeRabbit

  • New Features

    • Trusted backend scheduler operations can run capability package routes without requiring a browser administrator secret.
    • Internal route execution supports package routes, including nested paths, and is limited to the relevant active capability package.
  • Security

    • External requests remain protected by administrator authentication.
    • Scheduling markers and forged internal headers cannot bypass authorization.
    • Internal execution is disabled when a capability package is no longer active.
    • Requests outside the package’s route scope are rejected.

🔄 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/5824 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/3/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `loopback-noodles-no-secret` --- ### 📝 Commits (5) - [`b9e45fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b9e45fb8bf5c7e8bc6db275e35d248bbf2c2e0dd) fix(capabilities): allow trusted internal package routes - [`900eec8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/900eec8e33f28d4ea7d02baed574a2f6d34ee6c6) fix(capabilities): support nested internal route prefixes - [`a533054`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a533054296c82b090931c37774b88b9094fd6cba) fix(capabilities): preserve internal route state on retry - [`7d81515`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7d8151521f4e2d4e82f7d454699bba4c1b66b9d7) fix(capabilities): track overlapping route registrations - [`4396f16`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4396f168dbc2e4f96b1f8e8015872f95539ea28f) Merge remote-tracking branch 'origin/staging' into loopback-noodles-no-secret ### 📊 Changes **4 files changed** (+192 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/services/capability-packages/capability-module-runtime.service.ts` (+8 -2) 📝 `packages/server/src/services/capability-packages/capability-route-registration.service.ts` (+86 -5) ➕ `scripts/regressions/capability-internal-route.regression.ts` (+97 -0) </details> ### 📄 Description ## Linked issue Closes #5818 ## Why this change Backend Noodle and Slurp schedulers use app.inject() and fail the privileged route gate when loopback admin-secret enforcement is enabled. Browser-only X-Admin-Secret access must not be required for trusted server work. ## What changed - Added optional package-scoped api.runInternalRoute(). - Added server-generated internal request authorization for active package routes. - Kept normal external package route requests on the existing privileged gate. - Added positive and negative regression coverage. ## Validation - [ ] pnpm check passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed CONTRIBUTING.md ### Manual verification notes Automated proof: pnpm check and the capability internal route regression passed. Manual browser and container checks remain for a human contributor. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Trusted backend scheduler operations can run capability package routes without requiring a browser administrator secret. - Internal route execution supports package routes, including nested paths, and is limited to the relevant active capability package. - **Security** - External requests remain protected by administrator authentication. - Scheduling markers and forged internal headers cannot bypass authorization. - Internal execution is disabled when a capability package is no longer active. - Requests outside the package’s route scope are rejected. <!-- 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-23 04:15:14 +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#6956
No description provided.