mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:17:40 +00:00
fix: enforce strict allowlist across pairing stores (#23017)
This commit is contained in:
committed by
GitHub
parent
617e38cec0
commit
0bd9f0d4ac
@@ -10,6 +10,26 @@ describe("mergeAllowFromSources", () => {
|
||||
}),
|
||||
).toEqual(["line:user:abc", "123", "telegram:456"]);
|
||||
});
|
||||
|
||||
it("excludes pairing-store entries when dmPolicy is allowlist", () => {
|
||||
expect(
|
||||
mergeAllowFromSources({
|
||||
allowFrom: ["+1111"],
|
||||
storeAllowFrom: ["+2222", "+3333"],
|
||||
dmPolicy: "allowlist",
|
||||
}),
|
||||
).toEqual(["+1111"]);
|
||||
});
|
||||
|
||||
it("keeps pairing-store entries for non-allowlist policies", () => {
|
||||
expect(
|
||||
mergeAllowFromSources({
|
||||
allowFrom: ["+1111"],
|
||||
storeAllowFrom: ["+2222"],
|
||||
dmPolicy: "pairing",
|
||||
}),
|
||||
).toEqual(["+1111", "+2222"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("firstDefined", () => {
|
||||
|
||||
Reference in New Issue
Block a user