mirror of
https://github.com/docker/login-action.git
synced 2026-07-30 16:14:30 +08:00
log Docker Hub OIDC token exchange progress
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import {beforeEach, describe, expect, test, vi} from 'vitest';
|
||||
import * as dockerhub from '../src/dockerhub.js';
|
||||
|
||||
vi.mock('@actions/core', () => ({
|
||||
debug: vi.fn(),
|
||||
getIDToken: vi.fn(),
|
||||
info: vi.fn(),
|
||||
setSecret: vi.fn()
|
||||
@@ -83,6 +84,15 @@ describe('getOIDCToken', () => {
|
||||
expect(body.get('connection_id')).toBe(validConnectionID);
|
||||
expect(body.get('expires_in')).toBe('300');
|
||||
expect(setSecretMock).toHaveBeenCalledWith('hub-token');
|
||||
expect(core.info).toHaveBeenCalledWith('Docker Hub OIDC detected for docker.io');
|
||||
expect(core.info).toHaveBeenCalledWith('Retrieving GitHub OIDC token for Docker Hub');
|
||||
expect(core.info).toHaveBeenCalledWith('Exchanging GitHub OIDC token for Docker Hub token');
|
||||
expect(core.info).toHaveBeenCalledWith('Docker Hub OIDC token exchange succeeded');
|
||||
expect(core.debug).toHaveBeenCalledWith('Docker Hub OIDC token audience: https://identity.docker.com');
|
||||
expect(core.debug).toHaveBeenCalledWith('Docker Hub OIDC token expiration: 300s');
|
||||
expect(core.debug).toHaveBeenCalledWith('Sending Docker Hub OIDC token request to https://identity.docker.com/oauth/token');
|
||||
expect(core.debug).toHaveBeenCalledWith('Docker Hub OIDC token request returned status code 200');
|
||||
expect(core.debug).toHaveBeenCalledWith('Docker Hub OIDC token response status code: 200');
|
||||
});
|
||||
|
||||
test('uses custom token expiration', async () => {
|
||||
|
||||
Reference in New Issue
Block a user