test: cover Docker Hub OIDC with registry-auth

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-07-24 10:37:01 +02:00
parent 06fb636fac
commit b58b17c30b
4 changed files with 111 additions and 2 deletions
+19
View File
@@ -54,6 +54,25 @@ test('getAuthList skips secret masking when registry-auth password is absent', a
});
});
test('getAuthList supports password-less Docker Hub registry-auth for OIDC', async () => {
const [auth] = getAuthList({
registry: '',
username: '',
password: '',
scope: '',
ecr: '',
logout: true,
registryAuth: '- username: docker-org\n'
});
expect(auth).toMatchObject({
registry: 'docker.io',
username: 'docker-org',
password: undefined,
ecr: 'auto'
});
});
test('getAuthList masks registry-auth password when present', async () => {
const stdoutWriteSpy = vi.spyOn(process.stdout, 'write').mockImplementation(() => true);
getAuthList({