mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:00:44 +00:00
fix(matrix): skip pairing-store reads for room auth (#67325)
Merged via squash.
Prepared head SHA: 121ff3b38c
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
4f00b76925
commit
2bfd808a83
@@ -446,10 +446,11 @@ describe("matrix monitor handler pairing account scope", () => {
|
||||
});
|
||||
|
||||
it("blocks room control commands from DM-only paired senders", async () => {
|
||||
const readAllowFromStore = vi.fn(async () => ["@user:example.org"]);
|
||||
const { handler, finalizeInboundContext, recordInboundSession } =
|
||||
createMatrixHandlerTestHarness({
|
||||
isDirectMessage: false,
|
||||
readAllowFromStore: vi.fn(async () => ["@user:example.org"]),
|
||||
readAllowFromStore,
|
||||
roomsConfig: {
|
||||
"!room:example.org": { requireMention: false },
|
||||
},
|
||||
@@ -473,6 +474,7 @@ describe("matrix monitor handler pairing account scope", () => {
|
||||
|
||||
expect(recordInboundSession).not.toHaveBeenCalled();
|
||||
expect(finalizeInboundContext).not.toHaveBeenCalled();
|
||||
expect(readAllowFromStore).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("processes room messages mentioned via displayName in formatted_body", async () => {
|
||||
|
||||
@@ -586,7 +586,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
|
||||
senderNamePromise ??= getMemberDisplayName(roomId, senderId).catch(() => senderId);
|
||||
return await senderNamePromise;
|
||||
};
|
||||
const storeAllowFrom = await readStoreAllowFrom();
|
||||
const storeAllowFrom = isDirectMessage ? await readStoreAllowFrom() : [];
|
||||
const roomUsers = roomConfig?.users ?? [];
|
||||
const accessState = resolveMatrixMonitorAccessState({
|
||||
allowFrom,
|
||||
|
||||
Reference in New Issue
Block a user