feat: relax group DM authority check for trusted peers
Remove sourceInstance === ownerHomeInstance check for incremental member_add. Allows federated users to create group DMs on non-home instances. HMAC trust boundary + attribution check remain.
This commit is contained in:
@@ -2384,11 +2384,9 @@ function processMemberAddEvent(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate authority: only the owner's instance can add members
|
// Authority note: any HMAC-verified peer can relay member_add events.
|
||||||
if (channel.ownerHomeInstance && sourceInstance !== channel.ownerHomeInstance) {
|
// The HMAC signature proves the event came from a trusted peer.
|
||||||
rejected.push({ messageId: event.messageId, reason: 'unauthorized_source' });
|
// The attribution check below still validates that addedBy belongs to the source instance.
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attribution: adder must belong to source instance (FED-010)
|
// Attribution: adder must belong to source instance (FED-010)
|
||||||
if (event.membership.addedBy && !verifyAttribution(event.membership.addedBy.homeInstance, sourceInstance)) {
|
if (event.membership.addedBy && !verifyAttribution(event.membership.addedBy.homeInstance, sourceInstance)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user