Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest --config ./jest.config.js",
"test:watch": "jest --config ./jest.config.js --watch",
"test:cov": "jest --config ./jest.config.js --coverage --coverageReporters=text --coverageReporters=html --coverageReporters=lcov",
"test:unit": "jest --config ./jest.config.js --testPathPattern=spec --coverageThreshold='{\"global\":{\"branches\":35,\"functions\":35,\"lines\":35,\"statements\":35}}'",
"test:integration": "jest --config ./jest.config.js --testPathPattern=integration --passWithNoTests --coverageThreshold='{\"global\":{\"branches\":80,\"functions\":80,\"lines\":80,\"statements\":80}}'",
"test:unit": "jest --config ./jest.config.js --testPathPattern=spec",
"test:integration": "jest --config ./jest.config.js --testPathPattern=integration --passWithNoTests",
"test:e2e": "jest --config ./jest.config.js --testPathPattern=e2e --passWithNoTests",
"test:performance": "jest --config ./jest.config.js --testPathPattern=performance --passWithNoTests",
"test:security": "jest --config ./jest.config.js --testPathPattern=security --passWithNoTests",
Expand Down
2 changes: 1 addition & 1 deletion src/api-keys/api-key.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ export interface ApiKeyRequestContext {
timestamp: Date;
endpoint: string;
method: string;
}
}
4 changes: 2 additions & 2 deletions src/api-keys/dto/create-api-key.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class CreateApiKeyDto {
@IsString({ message: 'Name must be a string' })
@IsNotEmpty({ message: 'Name is required' })
@MaxLength(100, { message: 'Name must not exceed 100 characters' })
name: string;
name!: string;

@ApiProperty({
description: 'Scopes/permissions for the API key',
Expand All @@ -22,7 +22,7 @@ export class CreateApiKeyDto {
@IsArray({ message: 'Scopes must be an array' })
@ArrayMinSize(1, { message: 'At least one scope is required' })
@IsString({ each: true, message: 'Each scope must be a string' })
scopes: string[];
scopes!: string[];

@ApiPropertyOptional({
description: 'Rate limit (requests per minute) for this key. If not provided, uses global default.',
Expand Down
12 changes: 11 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ThrottlerModule } from '@nestjs/throttler';
import { ScheduleModule } from '@nestjs/schedule';
import { TerminusModule } from '@nestjs/terminus';
import { BullModule } from '@nestjs/bull';
import { APP_INTERCEPTOR, APP_GUARD } from '@nestjs/core';
import { APP_INTERCEPTOR, APP_FILTER } from '@nestjs/core';

// Core & Database
import { PrismaModule } from './database/prisma/prisma.module';
Expand All @@ -19,6 +19,8 @@ import { CacheModule } from './common/cache/cache.module';
// Logging
import { LoggingModule } from './common/logging/logging.module';
import { LoggingInterceptor } from './common/logging/logging.interceptor';
import { ResponseInterceptor } from './common/interceptors/response.interceptor';
import { AllExceptionsFilter } from './common/errors/error.filter';

// Redis
import { RedisModule } from './common/services/redis.module';
Expand Down Expand Up @@ -108,10 +110,18 @@ import { AuthRateLimitMiddleware } from './auth/middleware/auth.middleware';
AuditController, // Add the audit controller
],
providers: [
{
provide: APP_INTERCEPTOR,
useClass: ResponseInterceptor,
},
{
provide: APP_INTERCEPTOR,
useClass: LoggingInterceptor,
},
{
provide: APP_FILTER,
useClass: AllExceptionsFilter,
},
],
})
export class AppModule implements NestModule {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class AuthController {
async login(@Body() loginDto: LoginDto, @Req() req: Request) {
return this.authService.login({
email: loginDto.email,
password: loginDto.password
password: loginDto.password,
});
}

Expand Down
Loading
Loading