feat: Include updatedAt in encryption key response DTO (#29424)

This commit is contained in:
Stephen Wright
2026-04-29 08:16:01 +00:00
committed by GitHub
parent fb65c6155e
commit 569f94bb82
4 changed files with 8 additions and 1 deletions
@@ -4,4 +4,5 @@ export type EncryptionKeyResponseDto = {
algorithm: string | null;
status: string;
createdAt: string;
updatedAt: string;
};
@@ -41,6 +41,7 @@ describe('EncryptionKeyController', () => {
algorithm: 'aes-256-cbc',
status: 'inactive',
createdAt: '2026-01-15T00:00:00.000Z',
updatedAt: '2026-01-15T00:00:00.000Z',
},
{
id: 'k2',
@@ -48,6 +49,7 @@ describe('EncryptionKeyController', () => {
algorithm: 'aes-256-gcm',
status: 'active',
createdAt: '2026-01-15T00:00:00.000Z',
updatedAt: '2026-01-15T00:00:00.000Z',
},
]);
});
@@ -114,6 +116,7 @@ describe('EncryptionKeyController', () => {
algorithm: 'aes-256-gcm',
status: 'active',
createdAt: '2026-01-15T00:00:00.000Z',
updatedAt: '2026-01-15T00:00:00.000Z',
});
expect(result).not.toHaveProperty('value');
});
@@ -15,6 +15,7 @@ function toResponseDto(row: DeploymentKey): EncryptionKeyResponseDto {
algorithm: row.algorithm,
status: row.status,
createdAt: row.createdAt.toISOString(),
updatedAt: row.updatedAt.toISOString(),
};
}
@@ -46,7 +46,7 @@ const seedKey = async (
);
describe('GET /encryption/keys', () => {
test('returns all keys for owner with id/type/algorithm/status/createdAt (never value)', async () => {
test('returns all keys for owner with id/type/algorithm/status/createdAt/updatedAt (never value)', async () => {
const legacy = await seedKey({ algorithm: 'aes-256-cbc', status: 'inactive', value: 'legacy' });
const active = await seedKey({
algorithm: 'aes-256-gcm',
@@ -69,6 +69,7 @@ describe('GET /encryption/keys', () => {
algorithm: expect.any(String),
status: expect.any(String),
createdAt: expect.any(String),
updatedAt: expect.any(String),
});
expect(row).not.toHaveProperty('value');
}
@@ -117,6 +118,7 @@ describe('POST /encryption/keys', () => {
algorithm: 'aes-256-gcm',
status: 'active',
createdAt: expect.any(String),
updatedAt: expect.any(String),
});
expect(response.body.data).not.toHaveProperty('value');