import { Global, Module } from '@nestjs/common'; import { ThrottlerStorageModule } from '../common/throttler/throttler-storage.module'; import { ApiKeysController } from './api-keys.controller'; import { ApiKeysService } from './api-keys.service'; import { FailedAttemptLimiter } from './failed-attempt-limiter'; // Global: the app-wide auth guards need ApiKeysService to recognise keys. // ThrottlerStorageModule: the failure counters share the rate-limit table, // so the limit holds across all api pods. @Global() @Module({ imports: [ThrottlerStorageModule], controllers: [ApiKeysController], providers: [ApiKeysService, FailedAttemptLimiter], exports: [ApiKeysService], }) export class ApiKeysModule {}