testcontainers / testcontainers/testcontainers-java
[Enhancement]: Allow varying the OS credential key and the registry name independently
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
Module
Core
Proposal
Within my corporate network, we use an internal image repository. Federated authentication of some form is active, after which the Windows Credential store contains a key/val pair, keyed on "https://index.docker.io/v1/". A problem arises when I attempt to resolve an internal image - the method org.testcontainers.utility.RegistryAuthLocator#effectiveRegistryName assumes that where a registry name is present in the DockerImageName (for arguments sake, corporate-image-repo.corp.com), this should be used as the lookup key in the credential store -
Windows Cred Store - "https://index.docker.io/v1/" : some-auth-token
final String registry = dockerImageName.getRegistry();
if (!StringUtils.isEmpty(registry)) {
//corporate-image-repo.corp.com <- lookup fails
return registry;
}
//lookup would succeed...
return StringUtils.defaultString(
DockerClientFactory.instance().getInfo().getIndexServerAddress(),
DEFAULT_REGISTRY_NAME
);
}
This results in being unable to resolve the access token from the Windows Credential store, and thus fails to pull the image from our internal repo.
I'm unsure whether this is a quirk of how our corporate federated login works, but it would be ideal to either :
- Allow override of the entire RegistryAuthLocator implementation so I can sub-class it (via testcontainers.properties) for example
- Add a field to DockerImageName allowing specification of the lookup key independent of the registry host
- Provide an option to force the default registry name for Credential store lookups
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
RegistryAuthLocator#effectiveRegistryName と DockerImageName から始め、Windows Credential store の検索がレジストリ値をどのように使用するかを追跡します。提案されている override、独立した検索キー、強制的なデフォルト名の各オプションを比較します。内部イメージがレジストリホストとは異なるキーを使用して認証情報を解決できるようになった時点で、作業は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java
- 領域
- authentication, devops
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100