fix: preserve Docker legacy API key during rotation

This commit is contained in:
Tam Nhu Tran committed 2026-05-22 16:49:16 -04:00
1 parent 6088ebaa09
commit 30971ebb28
22 files changed
+928 -18

No files matched your search

@@ -49,6 +49,18 @@ beforeEach(() => {
calls.push(`config:${args.join(' ')}`);
},
}));
mock.module('../../../src/commands/docker/show-key-subcommand', () => ({
handleShowKey: async (args: string[]) => {
calls.push(`show-key:${args.join(' ')}`);
},
}));
mock.module('../../../src/commands/docker/finalize-key-rotation-subcommand', () => ({
handleFinalizeKeyRotation: async (args: string[]) => {
calls.push(`finalize-key-rotation:${args.join(' ')}`);
},
}));
});
afterEach(() => {
@@ -104,4 +116,13 @@ describe('docker command', () => {
expect(calls).toEqual(['help']);
expect(process.exitCode).toBe(1);
});
it('routes Docker key rotation subcommands', async () => {
const handleDockerCommand = await loadHandleDockerCommand();
await handleDockerCommand(['show-key', '--full']);
await handleDockerCommand(['finalize-key-rotation']);
expect(calls).toEqual(['show-key:--full', 'finalize-key-rotation:']);
});
});