fix(federation): batch A production readiness — normalization, logging, security

FED-001: normalize homeInstance in processCreateEvent member skip
FED-002: normalize homeInstance in getFriendEventTargets
FED-003: normalize homeInstance in handleSizeRejection
FED-004: add warning log when queueOutboxEvent drops events (zero peer match)
FED-012: remove unused challenge from peer handshake
FED-013: reject non-HTTPS origins in validateOrigin (except localhost)
This commit is contained in:
Jannis Braun
2026-03-31 03:33:22 +02:00
parent d021ee796d
commit 70678ff198
3 changed files with 30 additions and 21 deletions
@@ -421,7 +421,8 @@ function handleSizeRejection(
.from(schema.users)
.where(eq(schema.users.id, member.userId))
.get();
if (user && (!user.homeInstance || user.homeInstance === ourOrigin)) {
const userHome = user?.homeInstance?.startsWith('http') ? user.homeInstance : user?.homeInstance ? `https://${user.homeInstance}` : null;
if (user && (!user.homeInstance || userHome === ourOrigin)) {
affectedUserIds.push(user.homeUserId || user.id);
}
}