Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Validate API key and model availability at connection time

オープン
#3 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go, postgresql

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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/models or 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
主要言語
Go
スター
40
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。