[GH-ISSUE #5818] Allow backend scheduler calls without browser X-Admin-Secret #3208

Closed
opened 2026-10-21 06:00:35 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Gunterlie on GitHub (Sep 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5818

Originally assigned to: @Gunterlie on GitHub.

Problem

Noodle and Slurp run automatic schedules in the backend. Their schedulers call their own capability routes through app.inject(). Capability routes are registered through the host privileged-route gate, so the injected request is rejected when loopback admin-secret enforcement is enabled because it has no X-Admin-Secret header.

This makes backend schedule execution depend on a browser-only admin header. The browser header must protect external API calls. It must not be required for trusted server-side scheduler work.

Affected flows include:

  • Noodle automatic timeline refresh.
  • Slurp automatic timeline refresh.
  • Slurp automatic Creator post preparation and publication.
  • Slurp synthetic fan activity scheduling.

Relevant package calls:

  • /api/noodle/refresh from the Noodle scheduler.
  • /api/slurp/refresh from the Slurp scheduler.

Expected behavior

  • Backend scheduler calls work without a browser X-Admin-Secret header.
  • Browser calls to package routes remain protected by the privileged access gate.
  • The solution does not create a general unauthenticated bypass for Noodle or Slurp routes.
  • Internal authorization is explicit and limited to trusted server code.
  • The behavior works when MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true.

Acceptance criteria

  • Add a supported host capability for trusted internal route execution, or an equivalent narrowly scoped internal authorization mechanism.
  • Update Noodle and Slurp schedulers to use that mechanism.
  • Add regression coverage for internal scheduler calls without X-Admin-Secret.
  • Add negative coverage confirming an external request without the required access remains rejected.
  • Verify Noodle and Slurp schedule UI mutations still require normal privileged access.

Context

The current route registration applies requirePrivilegedAccess() to every capability route. The scheduler calls use app.inject() and currently send only the automatic-generation marker. The failure is in the host/package route contract, not in the browser UI.

Originally created by @Gunterlie on GitHub (Sep 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5818 Originally assigned to: @Gunterlie on GitHub. ## Problem Noodle and Slurp run automatic schedules in the backend. Their schedulers call their own capability routes through `app.inject()`. Capability routes are registered through the host privileged-route gate, so the injected request is rejected when loopback admin-secret enforcement is enabled because it has no `X-Admin-Secret` header. This makes backend schedule execution depend on a browser-only admin header. The browser header must protect external API calls. It must not be required for trusted server-side scheduler work. Affected flows include: - Noodle automatic timeline refresh. - Slurp automatic timeline refresh. - Slurp automatic Creator post preparation and publication. - Slurp synthetic fan activity scheduling. Relevant package calls: - `/api/noodle/refresh` from the Noodle scheduler. - `/api/slurp/refresh` from the Slurp scheduler. ## Expected behavior - Backend scheduler calls work without a browser `X-Admin-Secret` header. - Browser calls to package routes remain protected by the privileged access gate. - The solution does not create a general unauthenticated bypass for Noodle or Slurp routes. - Internal authorization is explicit and limited to trusted server code. - The behavior works when `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true`. ## Acceptance criteria - Add a supported host capability for trusted internal route execution, or an equivalent narrowly scoped internal authorization mechanism. - Update Noodle and Slurp schedulers to use that mechanism. - Add regression coverage for internal scheduler calls without `X-Admin-Secret`. - Add negative coverage confirming an external request without the required access remains rejected. - Verify Noodle and Slurp schedule UI mutations still require normal privileged access. ## Context The current route registration applies `requirePrivilegedAccess()` to every capability route. The scheduler calls use `app.inject()` and currently send only the automatic-generation marker. The failure is in the host/package route contract, not in the browser UI.
bsakaguchi 2026-10-21 06:00: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-Engine#3208
No description provided.