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>
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
// Test to verify the application can connect to the external PostgreSQL database
|
|
// This test targets your running application at port 9323
|
|
test('Application connects to external PostgreSQL database', async ({ page }) => {
|
|
// Navigate to your running application
|
|
await page.goto('http://localhost:9323');
|
|
|
|
// Basic sanity check that the application is loading
|
|
await expect(page).toHaveTitle(/My Weekly To Do List/);
|
|
|
|
// If we can reach this point, it means the application is running
|
|
// and should be attempting to connect to the configured database
|
|
console.log('✓ Application is running and should connect to external database at 192.168.178.91:2665');
|
|
});
|
|
|
|
test('Verify database connection details are configured', async () => {
|
|
// Just verify that we're using the correct database configuration
|
|
// This is more of a configuration verification than actual connection test
|
|
console.log('Database configuration:');
|
|
console.log(' Host: 192.168.178.91');
|
|
console.log(' Port: 2665');
|
|
console.log(' Database: My-Weekly-ToDo-List');
|
|
console.log(' User: root');
|
|
console.log(' Connection method: PostgreSQL');
|
|
console.log('✓ All configuration details set for external PostgreSQL');
|
|
}); |