import { Request, Response, NextFunction } from 'express';
type RequestContextAuthType = 'sso' | 'api_key' | 'dev';
interface RequestContext {
    tenantId: string;
    workspaceId: string;
    userId: string;
    authType: RequestContextAuthType;
    roles: string[];
    scopes: string[];
    requestId: string;
    windowId?: string;
}
interface AuthenticatedRequest extends Request {
    user?: {
        id: string;
        email: string;
        subscription: string;
    };
    requestContext?: RequestContext;
}
export declare const DEFAULT_TENANT_ID = "default-dev-tenant";
export declare const DEFAULT_WORKSPACE_ID = "default-workspace";
export declare const DEFAULT_DEV_USER_ID = "dev-user-123";
export declare const getRequestContext: (req: Request) => RequestContext | undefined;
export declare const requireRequestContext: (req: Request) => RequestContext;
/**
 * Authentication middleware - API key based (optional for dev)
 */
export declare const authenticate: (req: AuthenticatedRequest, res: Response, next: NextFunction) => Promise<void>;
export declare const attachRequestContext: (req: AuthenticatedRequest, res: Response, next: NextFunction) => Promise<void>;
/**
 * Usage check middleware - in-memory rate limiting (optional)
 */
export declare const checkUsage: (isTraceAnalysis?: boolean) => (req: AuthenticatedRequest, res: Response, next: NextFunction) => Promise<void>;
export type { AuthenticatedRequest };
export type { RequestContext, RequestContextAuthType };
//# sourceMappingURL=auth.d.ts.map