feat(auth): add POST /login with Playwright automation and SQLite session storage

- automates file-key login on the ID portal using Playwright/Chromium
- captures token, cookies, and localStorage after successful redirect
- stores session data in SQLite via TypeORM (better-sqlite3)
- sessions are keyed by sessionName (auto-generated UUID if not provided)
- login URL, cabinet redirect URL, keys dir, and DB path are all configurable via env
This commit is contained in:
ars9 committed 2026-04-07 12:07:13 +03:00
1 parent 70f016d113
commit 41dbddd2a1
12 files changed
+1478 -22

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString } from 'class-validator';
export class LoginDto {
@ApiProperty({
description: 'Key identifier — filename (without extension) from the keys/ directory',
example: '3273334361',
})
@IsString()
key: string;
@ApiPropertyOptional({
description: 'Session name to store credentials under. Auto-generated UUID if omitted.',
example: 'my-test-session',
})
@IsOptional()
@IsString()
sessionName?: string;
}