testcontainers / testcontainers/testcontainers-java

[Enhancement]: Allow varying the OS credential key and the registry name independently

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

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

type/enhancement
主要言語
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

RegistryAuthLocator#effectiveRegistryName と DockerImageName から始め、Windows Credential store の検索がレジストリ値をどのように使用するかを追跡します。提案されている override、独立した検索キー、強制的なデフォルト名の各オプションを比較します。内部イメージがレジストリホストとは異なるキーを使用して認証情報を解決できるようになった時点で、作業は完了です。

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

評価

技術スタック
docker, java
領域
authentication, devops
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

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

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