Track online backup source IP and add detailed recovery output
CI / verify (push) Waiting to run

This commit is contained in:
Sucukdeluxe
2026-09-22 05:02:21 +02:00
parent 560966fa2a
commit 43b77401c6
15 changed files with 147 additions and 26 deletions
+12 -1
View File
@@ -60,7 +60,8 @@ function createFixture(overrides = {}) {
id: entry.id,
displayKey: `${key.slice(0, 9)}${key.slice(-4)}`,
createdAt: entry.createdAt,
expiresAt: entry.expiresAt ?? null
expiresAt: entry.expiresAt ?? null,
...(entry.sourceIp ? { sourceIp: entry.sourceIp } : {})
});
},
getKey: async (entryId) => {
@@ -101,6 +102,7 @@ function createFixture(overrides = {}) {
events.push('upload');
assert.equal(uploadedRecord, record);
if (overrides.uploadError) throw overrides.uploadError;
return overrides.uploadMetadata;
},
deleteBackup: async (value) => {
events.push(`delete:${value}`);
@@ -176,6 +178,15 @@ function deleteVerifier(value) {
}
describe('transactional online backup manager', () => {
it('keeps server-provided source IP in the committed and listed metadata', async () => {
const fixture = createFixture({ initialKey: null, uploadMetadata: { sourceIp: '2001:db8::1' } });
const created = await fixture.manager.createManaged();
assert.equal(created.ok, true);
assert.equal(created.entry.sourceIp, '2001:db8::1');
const listed = await fixture.manager.listManaged();
assert.equal(listed.entries[0].sourceIp, '2001:db8::1');
assert.ok(!JSON.stringify(listed).includes(key));
});
it('creates in prepare, upload, commit order and returns only the sanitized entry', async () => {
const fixture = createFixture({ initialKey: null });