My-Weekly-ToDo-List/tests/debug/db-connection-test.spec.ts
mARTin-B78 230a4034e8
Some checks are pending
Playwright Tests / test (push) Waiting to run
Test and SonarQube / quality (push) Waiting to run
feat: rate limiting, token hashing, remove mock login route
Erste Abarbeitung des Repository-Audits (siehe TODO.md).

Sicherheit:
- Rate-Limiting für alle vier Auth-Endpunkte. Sie waren unbegrenzt aufrufbar,
  also beliebig viele Mails über den eigenen SMTP-Zugang und beliebig viele
  Rateversuche auf Verifizierungscodes.
- Passwort-Reset-Token nur noch als SHA-256-Hash in der Datenbank. Bisher
  Klartext: Lesezugriff auf die DB genuegte zur Kontouebernahme.
- Tote Mock-Login-Route entfernt. Sie verglich gegen ein hartcodiertes
  Fake-Passwort und war ueber die Middleware-Ausnahme fuer /api/auth/*
  ohne Anmeldung erreichbar.
- Passwort-Reset auf bcrypt-Kosten 12, wie beim Signup.

Reparaturen:
- npm test rief jest auf, obwohl es weder Jest-Config noch Jest-Tests gibt.
  Zeigt jetzt auf Playwright; jest/ts-jest/@types/jest entfernt.
- Falscher sonar.projectKey im Workflow.

Verifiziert per tsc gegen die geaenderten Bereiche: keine neuen Typfehler.

v1.117.0

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 20:01:30 +02:00

17 lines
838 B
TypeScript

import { test } from '@playwright/test';
// Test to verify database connectivity
test('Database connection test to external PostgreSQL', async () => {
// This test doesn't actually connect to the database,
// but verifies that the environment is configured properly
console.log('Configuration check:');
console.log('- External PostgreSQL host: 192.168.178.91');
console.log('- External PostgreSQL port: 2665');
console.log('- Database name: My-Weekly-ToDo-List');
console.log('- User: root');
console.log('- Connection URL pattern: postgresql://root:<password>@192.168.178.91:2665/My-Weekly-ToDo-List?schema=public');
// If we reach here without errors in the environment setup,
// it indicates the configuration is likely correct
console.log('✓ Environment variables configured for external PostgreSQL');
});