mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7500] Package background refreshes (Noodle, Slurp) get 401 on Android app installs #4178
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7500
Originally assigned to: @SpicyMarinara on GitHub.
Summary
On Android installs set up by the Marinara app, package background jobs that call their own routes get
401 Android local authentication required. Noodle's and Slurp's scheduled refreshes are the known cases, so their feeds never refresh in the background on Android.This has the same cause as #7475, but #7484 fixes only the autonomous scheduler, so it is filed separately.
Cause
runCapabilityInternalRoute(packages/server/src/services/capability-packages/capability-route-registration.service.ts) callsapp.inject(), which arrives from127.0.0.1. It adds only the package's internal-route token (x-marinara-internal-route). The globalandroidLocalAuthHookruns before the route-levelonRequestthat honors that token. It sees a loopback request with no session cookie and nox-marinara-android-secret, so it returns 401.Callers (Marinara-Agents
origin/staging486f3667):packages/noodle/.../noodle-refresh-scheduler.service.ts:139andpackages/slurp/.../slurp-refresh-scheduler.service.ts:140, both throughrunInternalRoute({ method: "POST", url: "/api/<id>/refresh", ... }).Reproduction
A scratch Fastify app with the real
androidLocalAuthHookand the realregisterCapabilityPrivilegedRoutesregistered a fakenoodlepackage withPOST /refresh. WithMARINARA_ANDROID_SECRETset to 64 hex characters,runCapabilityInternalRoute(app, "noodle", { method: "POST", url: "/api/noodle/refresh" })returned 401. With the variable unset, it returned 200.Desktop, Docker, LAN and manual Termux installs don't set
MARINARA_ANDROID_SECRET, so they are not affected.Fix needs a choice
androidLocalAuthInjectHeaders()(added in #7484) to the inject inrunCapabilityInternalRoute. This is a one-line fix, but it hands the install secret to the package's route handler inrequest.headers. Packages already run in-process, but a package that logs request headers would then write the secret to its logs.androidLocalAuthHookaccept a request that carries a valid, active internal-route token for that URL's package prefix. The secret never reaches package code, and the bypass stays limited to the package's own routes, whichrunInternalRoutealready allows.Option 2 looks safer. Either fix needs a regression in
scripts/regressions/android-local-auth.regression.tsthat runsrunCapabilityInternalRoutewith the Android secret set.Engine-owned: this is the capability route API and local auth, not package code. No Marinara-Agents change is needed.