Add test to verify normal instance blocking still works

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-20 14:08:06 +00:00
parent 2b09157c2a
commit 27b1846429
1 changed files with 27 additions and 0 deletions

View File

@ -201,5 +201,32 @@ describe('InboxProcessorService', () => {
}
);
});
test('should still block direct requests from blocked instances', async () => {
const jobData = {
signature: {
keyId: 'https://blocked.example.com/actor#main-key', // Direct from blocked instance
},
activity: {
type: 'Create',
actor: 'https://blocked.example.com/users/testuser',
id: 'https://blocked.example.com/activities/1',
object: {
type: 'Note',
id: 'https://blocked.example.com/notes/1',
content: 'test note',
attributedTo: 'https://blocked.example.com/users/testuser',
},
},
};
const job = {
data: jobData,
} as Bull.Job;
// Should be blocked at the primary federation check (before user resolution)
const result = await inboxProcessorService.process(job);
assert.strictEqual(result, 'Blocked request: blocked.example.com');
});
});
});