// src/middleware/security.middleware.ts
import { Injectable, NestMiddleware } from '@nestjs/common';
import { Request, Response, NextFunction } from 'express';

@Injectable()
export class SecurityMiddleware implements NestMiddleware {
  private readonly blockedPaths = [
    '/wp-admin',
    '/wp-login',
    '/.env',
    '/config',
    '/admin',
    '/phpmyadmin',
    '/.git',
    '/api/v1/pods'
  ];

  use(req: Request, res: Response, next: NextFunction) {
    const path = req.path.toLowerCase();
    
    if (this.blockedPaths.some(blocked => path.includes(blocked))) {
      return res.status(404).send('Not Found');
    }
    
    next();
  }
}