mirror of
https://github.com/docker/login-action.git
synced 2026-07-25 14:17:57 +00:00
test: cover Docker Hub OIDC with registry-auth
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user