fix(auth): block MCP token from app-role gates - #2451
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-02 05:23:07 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 3 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2451 +/- ##
=======================================
Coverage 95.88% 95.88%
=======================================
Files 224 224
Lines 25142 25144 +2
Branches 9142 9143 +1
=======================================
+ Hits 24108 24110 +2
Misses 421 421
Partials 613 613
🚀 New features to boost your workflow:
|
Motivation
GITTENSORY_MCP_TOKENstatic identity could flip the deployment-wide global agent kill-switch via the new operator route.Description
requireAppRoleto explicitly reject themcpstatic identity so the shared MCP token cannot satisfy operator-only app-role gates (src/api/routes.ts).GITTENSORY_MCP_TOKENis forbidden for bothGET /v1/app/kill-switchandPOST /v1/app/kill-switch, does not callsetGlobalAgentFrozen, and leaves the DB state unchanged (test/unit/routes-kill-switch.test.ts).npm run ui:openapias part of the change workflow (artifact created atapps/gittensory-ui/public/openapi.json).Testing
npx vitest run test/unit/routes-kill-switch.test.tsand all tests in that file passed (11/11).npm run typecheckand it completed with no type errors.npm run test:coverage -- --run test/unit/routes-kill-switch.test.tswhere the test file ran and passed, but the global coverage check failed as expected because the full test corpus was not executed in this targeted run; a full unsharded coverage run was attempted but did not complete in this environment.npm run test:ci) andnpm audit --audit-level=moderatewere blocked by external network/tooling issues (actionlint setup / npm audit endpoint) in this environment.Codex Task