mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-21 12:51:16 +08:00
feat: Include updatedAt in encryption key response DTO (#29424)
This commit is contained in:
@@ -4,4 +4,5 @@ export type EncryptionKeyResponseDto = {
|
||||
algorithm: string | null;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
+3
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user