feat(purga): Monday eliminado completamente del sistema
14 servicios eliminados, 7 controllers local-only, crons locales, config sin MONDAY_*, frontend sin banners/avisos Monday. 552 tests API + 7 apps construidas.
This commit is contained in:
@@ -58,11 +58,10 @@ describe('authMiddleware (AUTH_ENABLED=true)', () => {
|
||||
expect(req.usuarioToken?.username).toBe('admin')
|
||||
})
|
||||
|
||||
it('deja pasar las rutas públicas sin token (health, login, webhook monday)', () => {
|
||||
it('deja pasar las rutas públicas sin token (health, login)', () => {
|
||||
const casos: Partial<Request>[] = [
|
||||
{ method: 'GET', path: '/health' },
|
||||
{ method: 'POST', path: '/auth/login' },
|
||||
{ method: 'POST', path: '/webhooks/monday' },
|
||||
]
|
||||
for (const c of casos) {
|
||||
vi.clearAllMocks()
|
||||
@@ -125,12 +124,6 @@ describe('authMiddleware (AUTH_ENABLED=true)', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('protege POST /webhooks/monday con otro método no aplica: GET /webhooks/monday pide token', () => {
|
||||
const { res, status } = resFake()
|
||||
authMiddleware(reqFake({ method: 'GET', path: '/webhooks/monday' }), res, next)
|
||||
expect(status).toHaveBeenCalledWith(401)
|
||||
})
|
||||
|
||||
it('el token interno abre solo POST /cotizaciones/alertas-inventario', () => {
|
||||
authMiddleware(
|
||||
reqFake({
|
||||
|
||||
@@ -4,12 +4,9 @@ import { verificarToken, type TokenPayload } from '../services/auth.service.js'
|
||||
|
||||
// Rutas públicas: no requieren token aunque AUTH_ENABLED=true. Se comparan
|
||||
// contra req.path, que aquí ya está relativo al mount /api.
|
||||
// Monday no puede mandar JWT, así que su webhook queda abierto (se valida por
|
||||
// firma/challenge dentro del controlador).
|
||||
const RUTAS_PUBLICAS: ReadonlyArray<{ metodo: string; ruta: string }> = [
|
||||
{ metodo: 'GET', ruta: '/health' },
|
||||
{ metodo: 'POST', ruta: '/auth/login' },
|
||||
{ metodo: 'POST', ruta: '/webhooks/monday' },
|
||||
{ metodo: 'GET', ruta: '/push/vapid-key' },
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user