feat(auth): add GET /keys to list available key identifiers

This commit is contained in:
2026-04-07 12:40:03 +03:00
parent 9898fb6472
commit 238ce0289c
2 changed files with 15 additions and 1 deletions
+7
View File
@@ -40,6 +40,13 @@ export class AuthService {
);
}
listKeys(): string[] {
if (!fs.existsSync(this.keysDir)) return [];
return fs.readdirSync(this.keysDir)
.filter(f => f.endsWith('.json'))
.map(f => path.basename(f, '.json'));
}
async login(keyId: string, sessionName?: string): Promise<{ token: string; sessionName: string }> {
const resolvedSession = sessionName ?? crypto.randomUUID();