Multi-Provider Key Scanner + Checker (OpenAI, Google, 15 Key-Typen)
- KeyPatterns.cs: Zentrale Pattern-Klasse für 15 Key-Typen (Anthropic, OpenAI, Google, AWS, GitHub, GitLab, HuggingFace, Stripe, SendGrid, Slack) - OpenAiKeyChecker.cs: Prüft sk-proj/sk-svcacct/sk- Keys via /v1/models (Org, Modelle, RPM/TPM, Tier-Erkennung Free bis 5+) - GoogleKeyChecker.cs: Prüft AIza-Keys via Gemini /v1/models (Gemini-Modelle, Maps-Key-Erkennung) - KeyScannerService + GitHubEventScannerService: Dispatch nach Key-Typ - ApiKeysEndpoint: GET /scanned/summary + ?type= Filter - Frontend: 2-stufige UI (Typ-Übersicht → Keys pro Typ)
This commit is contained in:
1 parent
eb8844a4f1
commit
c8859a89d0
9 files changed
+536
-52
No files matched your search
@@ -475,6 +475,28 @@ public partial class DatabaseService
|
||||
"SELECT * FROM scanned_keys WHERE deleted = 0 ORDER BY scanned_at DESC");
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<ScannedKeyRecord>> GetScannedKeysByType(string type)
|
||||
{
|
||||
using var conn = CreateConnection();
|
||||
return await conn.QueryAsync<ScannedKeyRecord>(
|
||||
"SELECT * FROM scanned_keys WHERE deleted = 0 AND type = @type ORDER BY scanned_at DESC",
|
||||
new { type });
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<dynamic>> GetScannedKeysSummary()
|
||||
{
|
||||
using var conn = CreateConnection();
|
||||
return await conn.QueryAsync(
|
||||
@"SELECT type,
|
||||
COUNT(*) as total,
|
||||
SUM(CASE WHEN adopted_api_key_id IS NOT NULL THEN 1 ELSE 0 END) as adopted,
|
||||
SUM(CASE WHEN status = 'valid' AND adopted_api_key_id IS NULL THEN 1 ELSE 0 END) as valid,
|
||||
SUM(CASE WHEN status = 'invalid' THEN 1 ELSE 0 END) as invalid,
|
||||
SUM(CASE WHEN status = 'unchecked' THEN 1 ELSE 0 END) as unchecked
|
||||
FROM scanned_keys WHERE deleted = 0
|
||||
GROUP BY type ORDER BY total DESC");
|
||||
}
|
||||
|
||||
public async Task<ScannedKeyRecord> GetScannedKey(string scannedKeyId)
|
||||
{
|
||||
using var conn = CreateConnection();
|
||||
|
||||
Reference in new issue
Block a user