import type { CanActivate, ExecutionContext } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { AuthService } from '../services/auth.service.js'; /** * Guard that bridges to Mastra's authentication system. * Checks for @Public() decorator to skip auth. * * **IMPORTANT: This guard is for custom user routes, NOT for Mastra API routes.** * * Mastra routes (agents, workflows, etc.) use AuthService internally which has * access to route-specific auth configuration (customRouteAuthConfig, isProtectedPath, * canAccessPublicly). This guard is a simplified version for when you want to * protect your own NestJS routes with Mastra's auth config. * * Differences from AuthService (used internally for Mastra routes): * - Does NOT check `customRouteAuthConfig` * - Does NOT check `isProtectedPath` / `canAccessPublicly` from @mastra/server/auth * - Has simpler dev playground detection (just checks header + config) * * @example * ```typescript * // Protect a custom route with Mastra auth * @Controller('my-custom') * @UseGuards(MastraAuthGuard) * export class MyController { * @Get('protected') * protectedRoute() { ... } * * @Get('open') * @Public() // Skip auth for this route * openRoute() { ... } * } * ``` */ export declare class MastraAuthGuard implements CanActivate { private readonly reflector; private readonly authService; private readonly logger; constructor(reflector: Reflector, authService: AuthService); canActivate(context: ExecutionContext): Promise; } //# sourceMappingURL=mastra-auth.guard.d.ts.map