Validate API key and model availability at connection time
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- go, postgresql
- Área
- api, authentication, backend
Línea de trabajo
Read auth.go:17-139 to understand authentication and startup messaging, then inspect connection.go around lines 113-117 where the LLM client is created before the query loop. Trace the LLMClient implementations for OpenAI and Anthropic and determine how validation and PostgreSQL FATAL errors should be handled. Done means connections reject invalid keys or unavailable models before queries, with the documented error codes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The authenticate function (auth.go:17-90) performs the PostgreSQL password
handshake - receives the StartupMessage, requests the cleartext password, and
returns the extracted credentials (provider, API key, model, options). It does
no validation.
Separately, sendStartupMessages (auth.go:93-139) sends AuthenticationOk and
startup parameters to the client - also with no validation.
Between these two calls and the query loop, nothing verifies that the API key
is valid or the model exists. The user only finds out on their first query
when the LLM API call fails.
Proposed solution
Add a Validate(ctx) error method to the LLMClient interface. Call it in
connection.go after creating the LLM client (line ~113) and before entering
the query loop (line ~117).
Each provider implements validation differently:
- OpenAI:
GET /v1/modelsor a minimal completion call - Anthropic: minimal message call or equivalent
On failure, send a PostgreSQL FATAL error and close the connection:
- Invalid API key →
FATAL 28P01 (invalid_password) - Invalid/unavailable model →
FATAL 3D000 (invalid_catalog_name)
Considerations
- Adds latency to every new connection - should use the cheapest possible API call
- Could be opt-out via a flag (
-skip-validation) for local/trusted setups
- Lenguaje dominante
- Go
- Estrellas
- 40
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
chaitin/agent-compose#770 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
v3.8.0 vanilla manifest points to non-existent images registry.k8s.io/csi-vsphere/csi-vsphere/{driver,syncer}Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertokind/bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
kubernetes-sigs/vsphere-csi-driver#4351 ·
Los mantenedores suelen responder en 1 día
-
component/gpu-kubelet-plugin component/helm needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
kubernetes-sigs/dra-driver-nvidia-gpu#1559 ·
Los mantenedores suelen responder en 1 día
-
workflow: redundant goroutine in scheduleRetryPosiblemente ocupada @moodbased la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días