This repository has been archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #580 - support identityToken based repositories
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,12 +44,19 @@ public class RegistryAuthTest { | |
.password("sw4gy0lo") | ||
.email("[email protected]") | ||
.build(); | ||
|
||
private static final RegistryAuth MY_AUTH_CONFIG = RegistryAuth.builder() | ||
.serverAddress("https://narnia.mydock.io/v1/") | ||
.username("megaman") | ||
.password("riffraff") | ||
.email("[email protected]") | ||
.build(); | ||
|
||
private static final RegistryAuth IDENTITY_TOKEN_AUTH_CONFIG = RegistryAuth.builder() | ||
.serverAddress("docker.customdomain.com") | ||
.identityToken("52ce5fd5-eb60-42bf-931f-5eeec128211a") | ||
.build(); | ||
|
||
private static final RegistryAuth EMPTY_AUTH_CONFIG = RegistryAuth.builder().build(); | ||
|
||
@Rule | ||
|
@@ -69,6 +76,13 @@ public void testFromDockerConfig_FullDockerCfg() throws Exception { | |
assertThat(registryAuth, equalTo(DOCKER_AUTH_CONFIG)); | ||
} | ||
|
||
@Test | ||
public void testFromDockerConfig_IdentityToken() throws Exception { | ||
final RegistryAuth authConfig = RegistryAuth.fromDockerConfig(getTestFilePath( | ||
"dockerConfig/identityTokenConfig.json")).build(); | ||
assertThat(authConfig, equalTo(IDENTITY_TOKEN_AUTH_CONFIG)); | ||
} | ||
|
||
@Test | ||
public void testFromDockerConfig_IncompleteConfig() throws Exception { | ||
final RegistryAuth registryAuth = RegistryAuth.fromDockerConfig(getTestFilePath( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"auths": { | ||
"docker.customdomain.com": { | ||
"auth": "ZG9ja2VybWFuOg==", | ||
"email": "[email protected]", | ||
"identityToken": "52ce5fd5-eb60-42bf-931f-5eeec128211a" | ||
} | ||
} | ||
} |