fix(orb): add 3 documented maintainer-session routes to the path allowlist - #8710
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…wlist automation-state, ams-miner-cohort, and pulls/:number/chat-qa each documented themselves as reachable by a maintainer's browser panel (and chat-qa is called with credentials:include from apps/loopover-ui), but were missing from canSessionAccessPath, so a real non-operator maintainer session hit the coarse 403 before the route's own requireRepoMaintainer guard could admit it. Adds the three allowlist predicates; each route's guard still scopes per-repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8710 +/- ##
==========================================
+ Coverage 90.56% 91.02% +0.46%
==========================================
Files 96 97 +1
Lines 22490 24901 +2411
Branches 3884 4659 +775
==========================================
+ Hits 20367 22665 +2298
- Misses 1945 1971 +26
- Partials 178 265 +87
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 00:15:29 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Fixes #8653
Root cause
canSessionAccessPath(src/api/routes.ts) is the coarse pre-route allowlist that runs in middleware for every non-operator browser session. Three routes callrequireRepoMaintainerinternally and each documents itself as maintainer-session-reachable — but none had a predicate in the allowlist, so a real non-operator maintainer session hit the coarse 403 before the handler's own guard could admit it:automation-state— comment: "Maintainer-gated like/settings" (which is allowlisted)ams-miner-cohort— comment: "mirrors maintainer-noise" (which is allowlisted)pulls/:number/chat-qa— comment: exposes to the maintainer panel; confirmed live —apps/loopover-ui/.../chat-qa-panel.tsxcalls it withcredentials: "include"Fix
Added three path predicates (
isRepoAutomationStatePath,isRepoAmsMinerCohortPath,isRepoChatQaPath), mirroring the existingisRepoMaintainerNoisePathshape exactly, and wired them intocanSessionAccessPath. This only decides whether a session may reach the path — each route's ownrequireRepoMaintainerstill enforces per-repo authority, so a maintainer of A reaching B still gets403 forbidden_repo.Tests
Added to
test/unit/access-boundary.test.tsfollowing its established template — for all 3 routes, a maintainer session reaches its own repo (200) and is rejected on a different maintainer's repo (403forbidden_repo). No AI mock was needed for chat-qa: with the default settings (advisoryAiRouting.chatQaoff), the real answer service returns a 200disabledstatus, so a seeded PR is enough to prove reachability.Validation
test/unit/access-boundary.test.ts: 12 passed, on a branch rebased onto currentmainroutes.ts: every added line and both branches of each new predicate coverednpm run typecheckclean;oxlintclean on the changed lines;git diff --checkclean