mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
refactor(mcp): the demo-mode write block runs once, in the registry's tool gate
Every write tool used to open with its own demo check, 196 copies across 30 tool files, most of them injecting AuthService for nothing else. The registry now takes a toolGate (built from the container) that runs before each registered tool handler, and TREK's gate refuses a demo account on every tool not annotated read-only with the same canned result. The per-tool checks, the AuthService injections, AuthService.isDemoUser and the AuthModule imports that only fed them are gone; ESLint refuses a demo check in a tool file, and a registry-wide test calls every write tool as the demo account.
This commit is contained in:
@@ -66,8 +66,8 @@ import { AllowedFileTypesModule } from '../files/allowed-file-types.module';
|
||||
* AuthModule when BudgetMcp's demo guard moved off AuthService, so this module
|
||||
* imports it and UserCleanupService injects BudgetService (which retired
|
||||
* budget.bridge). AuthService is
|
||||
* exported for the in-container consumers (the domain *.mcp.ts demo guards,
|
||||
* OidcService, PasskeyEnabledGuard); PasskeyService for AdminService's passkey
|
||||
* exported for the in-container consumers (VacayMcp, OidcService,
|
||||
* PasskeyEnabledGuard); PasskeyService for AdminService's passkey
|
||||
* reset; UserCleanupService for the two account-deletion paths (AdminService)
|
||||
* and the guest deletion in TripsService; everything outside the container goes
|
||||
* through auth.bridge.ts.
|
||||
|
||||
Reference in New Issue
Block a user