ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Credentials: Validating Provider Keys
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 10
- Ø Merge
- 2 T. 20 Std.
- Gemergte PRs (30 T.)
- 14
Beschreibung
Describe the current behavior
Currently, when a user provides an OpenAI API key through the credentials endpoint, the key is saved directly to the credentials table without any validation. This means invalid, expired, or incorrectly formatted keys can be stored in the database. Users only discover the key is invalid later when they attempt to use it for LLM operations, leading to failed requests and a poor user experience.
Describe the enhancement you'd like
Add a validity check for OpenAI API keys before saving them to the credentials table. The validation should:
- Accept the API key from the user via the credentials endpoint
- Make a test request to OpenAI's API using the provided key (e.g., a lightweight call to list models or verify credentials)
- Only save the key to the database if the validation succeeds
- Return a clear error message to the user if the key is invalid, explaining why it failed
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne beim Credentials-Endpunkt und verfolge, wie Provider-Schlüssel in die Credentials-Tabelle geschrieben werden. Überprüfe den für die Validierung verwendeten OpenAI-API-Request und die Fehlerbehandlung des Endpunkts. Verifiziere anschließend, dass gültige Schlüssel gespeichert werden, ungültige Schlüssel mit einer klaren Erklärung abgelehnt werden und eine fehlgeschlagene Validierung den Schlüssel nicht persistiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100