egress: drop the empty-provider check in providerCredential

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

メンテナーはふだん 1 日以内に返信

@cloudonly がすでに取り組んでいます。

2026年10月30日 から。

  • #3495 @cloudonly による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

cmd/atenet/internal/router/egress/credentials.goを読み、空のproviderのチェックとその直後のprovider検索を比較してください。初期チェックを削除して、リクエストが既存の検索時の拒否経路を使うようにし、credentials_test.goの関連ケースを実行してください。リクエストが引き続き拒否され、重複したチェックがなくなれば完了です。このissueは#3409に依存しているため、着手前にその変更が利用可能であることを確認してください。

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

説明

area/network kind/cleanup

From review of #3409: https://github.com/agent-substrate/substrate/pull/3409#discussion_r4407716120

Handler.providerCredential in cmd/atenet/internal/router/egress/credentials.go first denies the request when h.providers is empty and logs "policy requires credential injection but no credential provider is configured". With #3409's provider map, the lookup right after it already covers that case. No provider matches the URI's host, so the request gets the same 500 and body, and the log line "credential URI names a provider this gateway does not serve" includes serves=[].

Remove the early check so there is one denial path. The only other difference: on a gateway with no providers, an unparseable URI would log "policy names an unparseable credential URI" instead.

The "no provider configured" cases in credentials_test.go only check that the request is denied, so they should keep passing.

Depends on #3409. On main the check is if h.provider == nil, and it's still needed there because the code after it calls the single provider directly.

主要言語
Go
スター
6.1k
フォーク
676
平均マージ
2日 2時間
マージ済み PR(30日)
528

環境構築

はじめの一歩

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

agent-substrate/substrate のほかの issue

agent-substrate/substrate の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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