feat: DB-Explorer, Scanner-KeyTypes-Setting, Stripe-Checker, Anthropic-Auth-Fix, Progress-Tracking
Backend:
- Neuer Database Explorer Endpoint (GET /api/admin/db/tables, GET /api/admin/db/tables/{name})
- DatabaseService: public GetConnection() Methode
- StripeKeyChecker: 2-Schritt-Check (/v1/balance + /v1/account), erkennt Live/Test, Balance, Account-Details
- AnthropicKeyChecker: Auth-Header fix (x-api-key für API-Keys, Bearer für OAuth), 400-Handler für credit balance
- KeyPatterns: Stripe einkommentiert, Krea AI Pattern, AllTypes-Array, MinLength 4
- ServerSettingsService: string_array Typ (Get/SetStringArray), ScannerKeyTypes Setting mit Checkbox-Optionen
- ServerSettingsEndpoint: string_array Speichern (Array/CSV)
- KeyScannerService: GetActiveSearchPatterns() filtert nach ScannerKeyTypes, Progress-Tracking
- GitHubEventScannerService: CheckNewKeys nur für aktuelle Poll-Keys (statt alle unchecked), klarere Log-Meldung
Frontend:
- Database Explorer Page: Tabellenliste mit Klick -> Tabelleninhalt, Pagination, sticky Header
- Server Settings: Checkbox-Gruppe für string_array (Alle/Keine Buttons)
- API Keys: adoptedApiKeyId Fix (leerer String == null)
- Dashboard: DB-Explorer Link für Admins
- Scan-Progress: Live-Fortschritt mit Phase/Detail/Counter
This commit is contained in:
1 parent
3cd35ebbfa
commit
e61f3ef082
15 files changed
+642
-33
No files matched your search
@@ -42,12 +42,20 @@ namespace Gott.Services
|
||||
});
|
||||
|
||||
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.anthropic.com/v1/messages");
|
||||
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
|
||||
var isOAuth = apiKey.StartsWith("sk-ant-oat01-", StringComparison.OrdinalIgnoreCase);
|
||||
if (isOAuth)
|
||||
{
|
||||
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
|
||||
request.Headers.Add("anthropic-beta", "claude-code-20250219,oauth-2025-04-20");
|
||||
request.Headers.Add("User-Agent", "claude-cli/2.1.2 (external, cli)");
|
||||
request.Headers.Add("x-app", "cli");
|
||||
request.Headers.Add("anthropic-dangerous-direct-browser-access", "true");
|
||||
}
|
||||
else
|
||||
{
|
||||
request.Headers.Add("x-api-key", apiKey);
|
||||
}
|
||||
request.Headers.Add("anthropic-version", "2023-06-01");
|
||||
request.Headers.Add("anthropic-beta", "claude-code-20250219,oauth-2025-04-20");
|
||||
request.Headers.Add("User-Agent", "claude-cli/2.1.2 (external, cli)");
|
||||
request.Headers.Add("x-app", "cli");
|
||||
request.Headers.Add("anthropic-dangerous-direct-browser-access", "true");
|
||||
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
|
||||
|
||||
var resp = await client.SendAsync(request);
|
||||
@@ -69,6 +77,15 @@ namespace Gott.Services
|
||||
{
|
||||
return new KeyCheckResult { Status = "quota_exceeded", Message = "Insufficient Quota (403)", Plan = "Unknown" };
|
||||
}
|
||||
else if (statusCode == 400)
|
||||
{
|
||||
var body400 = await resp.Content.ReadAsStringAsync();
|
||||
if (body400.Contains("credit balance", StringComparison.OrdinalIgnoreCase))
|
||||
return new KeyCheckResult { Status = "billing_not_active", Message = "Gültig, aber kein Guthaben (credit balance too low)", Plan = "API Console" };
|
||||
if (body400.Contains("billing", StringComparison.OrdinalIgnoreCase) || body400.Contains("payment", StringComparison.OrdinalIgnoreCase))
|
||||
return new KeyCheckResult { Status = "billing_not_active", Message = "Gültig, aber Billing-Problem (400)", Plan = "API Console" };
|
||||
return new KeyCheckResult { Status = "error", Message = $"API-Fehler (400): {(body400.Length > 200 ? body400.Substring(0, 200) : body400)}", Plan = "Unknown" };
|
||||
}
|
||||
else if (statusCode >= 400)
|
||||
{
|
||||
return new KeyCheckResult { Status = "error", Message = $"API-Fehler ({statusCode})", Plan = "Unknown" };
|
||||
|
||||
Reference in new issue
Block a user