testcontainers / testcontainers/testcontainers-java
[Enhancement]: Allow varying the OS credential key and the registry name independently
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 9
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con RegistryAuthLocator#effectiveRegistryName e DockerImageName, quindi segui il modo in cui la ricerca in Windows Credential store utilizza il valore del registro. Confronta le opzioni di override proposto, chiave di ricerca indipendente e nome predefinito forzato; il lavoro è completo quando un’immagine interna può risolvere le credenziali utilizzando una chiave distinta dal proprio host del registro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, java
- Ambito
- authentication, devops
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100