mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
1a9855cf70
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.
42 lines
2.3 KiB
TypeScript
42 lines
2.3 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
|
import { TripShareController, SharedController } from './share.controller';
|
|
import { ShareService } from './share.service';
|
|
import { ShareMcp } from './share.mcp';
|
|
import { SettingsModule } from '../settings/settings.module';
|
|
import { PermissionsModule } from '../permissions/permissions.module';
|
|
import { QueryHelpersModule } from '../query-helpers/query-helpers.module';
|
|
import { PlacePhotosModule } from '../place-photos/place-photos.module';
|
|
import { StorageModule } from '../storage/storage.module';
|
|
import { McpSharedModule } from '../mcp-shared/mcp-shared.module';
|
|
import { Reservations } from '../../db/entities/Reservations.entity';
|
|
import { ShareTokens } from '../../db/entities/ShareTokens.entity';
|
|
import { Trips } from '../../db/entities/Trips.entity';
|
|
import { Days } from '../../db/entities/Days.entity';
|
|
import { DayAssignments } from '../../db/entities/DayAssignments.entity';
|
|
import { DayNotes } from '../../db/entities/DayNotes.entity';
|
|
import { Places } from '../../db/entities/Places.entity';
|
|
import { PackingItems } from '../../db/entities/PackingItems.entity';
|
|
import { BudgetItems } from '../../db/entities/BudgetItems.entity';
|
|
import { Categories } from '../../db/entities/Categories.entity';
|
|
import { CollabMessages } from '../../db/entities/CollabMessages.entity';
|
|
|
|
// `MikroOrmModule.forFeature([Reservations, ...])` registers every repository
|
|
// `ShareService`'s `@InjectRepository` constructor params need (Plan 3d Task 4
|
|
// already registered `Reservations`; Plan 3h Task 6 adds `ShareTokens` — this
|
|
// file's own table — plus the nine cross-domain tables its public-share reads
|
|
// (SH7-9,11-16) touch, without importing each owning module: this file stays a
|
|
// leaf the way `PublicApiModule`'s own `Trips`-only `forFeature` already does
|
|
// for the same reason).
|
|
@Module({
|
|
imports: [
|
|
McpSharedModule, SettingsModule, PermissionsModule, QueryHelpersModule, PlacePhotosModule, StorageModule,
|
|
MikroOrmModule.forFeature([
|
|
Reservations, ShareTokens, Trips, Days, DayAssignments, DayNotes, Places, PackingItems, BudgetItems, Categories, CollabMessages,
|
|
]),
|
|
],
|
|
controllers: [TripShareController, SharedController],
|
|
providers: [ShareService, ShareMcp],
|
|
})
|
|
export class ShareModule {}
|