mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:00:54 +00:00
fix: align open DM allowlist policy (#74112)
* fix: harden telegram open dm allowlist merging * fix: align open dm allowlist policy
This commit is contained in:
committed by
GitHub
parent
fda8cc2a9d
commit
bd1d1f0f2b
@@ -292,6 +292,7 @@ function createLineWebhookTestContext(params: {
|
||||
const lineConfig = {
|
||||
...(params.groupPolicy ? { groupPolicy: params.groupPolicy } : {}),
|
||||
...(params.dmPolicy ? { dmPolicy: params.dmPolicy } : {}),
|
||||
...(params.dmPolicy === "open" ? { allowFrom: ["*"] } : {}),
|
||||
};
|
||||
return {
|
||||
cfg: { channels: { line: lineConfig } },
|
||||
@@ -830,14 +831,14 @@ describe("handleLineWebhookEvents", () => {
|
||||
} as PostbackEvent;
|
||||
|
||||
const context: Parameters<typeof handleLineWebhookEvents>[1] = {
|
||||
cfg: { channels: { line: { dmPolicy: "open" } } },
|
||||
cfg: { channels: { line: { dmPolicy: "open", allowFrom: ["*"] } } },
|
||||
account: {
|
||||
accountId: "default",
|
||||
enabled: true,
|
||||
channelAccessToken: "token",
|
||||
channelSecret: "secret",
|
||||
tokenSource: "config",
|
||||
config: { dmPolicy: "open" },
|
||||
config: { dmPolicy: "open", allowFrom: ["*"] },
|
||||
},
|
||||
runtime: createRuntime(),
|
||||
mediaMaxBytes: 1,
|
||||
|
||||
@@ -335,7 +335,7 @@ async function shouldProcessLineEvent(
|
||||
return denied;
|
||||
}
|
||||
|
||||
const dmAllowed = dmPolicy === "open" || isSenderAllowed({ allow: effectiveDmAllow, senderId });
|
||||
const dmAllowed = isSenderAllowed({ allow: effectiveDmAllow, senderId });
|
||||
if (!dmAllowed) {
|
||||
if (dmPolicy === "pairing") {
|
||||
if (!senderId) {
|
||||
|
||||
Reference in New Issue
Block a user