import type { Mastra } from '@mastra/core/mastra'; import type { Request } from 'express'; import type { MastraModuleOptions } from '../mastra.module.js'; /** * Service that handles authentication for Mastra routes. * Called after route matching to check if auth is required. */ export declare class AuthService { private readonly mastra; private readonly options; private readonly logger; constructor(mastra: Mastra, options: MastraModuleOptions); /** * Check authentication for a request based on the matched route. * Returns the authenticated user if auth succeeds, undefined if no auth required. * Throws UnauthorizedException or ForbiddenException if auth fails. * * Type assertions (`as any`) are used because `@mastra/server/auth` types * are Hono-centric. The runtime values work with Express requests. */ authenticate(request: Request): Promise; /** * Check authorization for an authenticated user. * `authConfig` is typed as `any` because `@mastra/server/auth` doesn't * export a standalone type for the auth config object. */ private authorize; /** * Extract authentication token from request. * Supports Authorization header (Bearer token) and API key query param. */ private extractToken; } //# sourceMappingURL=auth.service.d.ts.map