Backend:
- is_active komplett entfernt, durch is_public (Admin-Toggle) ersetzt
- Neues selected_api_key_id auf users-Tabelle
- AnthropicService: globaler _token entfernt, apiToken pro Request
- Token-Durchreichung: StreamChat → ProcessStream → RunAgentChat →
RunPreparer/RunReview/RunFinalizer, ExecuteTool, send_to_session
- ChatEndpoint: User-Key aus DB laden, an StreamChat übergeben
- TelegramService: Key per bot.UserId auflösen
- CronjobService: Key per job.UserId auflösen
- Neue Endpoints: GET /api/api-keys/available, PUT /api/api-keys/select/{keyId},
GET /api/api-keys/selected, PUT /api/admin/api-keys/{keyId}/public,
POST /api/admin/api-keys/check-all
- Program.cs: AnthropicService ohne Token-Parameter
Frontend:
- API-Keys-Page: Public-Toggle (Globe/Lock) statt Activate/Deactivate
- Alle prüfen Button für Batch-Key-Check
- Chat: Key-Auswahl für alle User (nicht nur Admin)
- Dummy-Badge wenn kein Key ausgewählt
- Fallback-Badge bei Key ohne Usage-Daten
- Key-Switch-Modal: apiGetAvailableKeys + apiSelectApiKey
20 lines
945 B
C#
20 lines
945 B
C#
namespace Gott.Models;
|
|
|
|
public class ApiKeyRecord
|
|
{
|
|
public long Id { get; set; }
|
|
public string KeyId { get; set; }
|
|
public string Provider { get; set; } // anthropic, gemini, openai, ...
|
|
public string Name { get; set; } // Anzeigename z.B. "Tausi Pro Key"
|
|
public string ApiKey { get; set; } // Der eigentliche Key
|
|
public bool IsPublic { get; set; } // Für alle User sichtbar/auswählbar
|
|
public string Status { get; set; } // ok, invalid, rate_limited, quota_exceeded, error
|
|
public string Plan { get; set; } // Pro, Max, Pro/Max, API Console, Unknown
|
|
public double? Usage7d { get; set; }
|
|
public double? Usage5h { get; set; }
|
|
public string CheckedAt { get; set; } // Wann zuletzt geprüft
|
|
public string SourceUrl { get; set; } // GitHub-URL (bei adoptierten Scan-Keys)
|
|
public string CreatedAt { get; set; }
|
|
public string UpdatedAt { get; set; }
|
|
}
|