fix: trim whatsapp admission sender identity · openclaw/openclaw@eb67ac5
shakkernerd
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -187,9 +187,7 @@ describe("checkInboundAccessControl admission contract", () => {
|
187 | 187 | }, |
188 | 188 | sender: { |
189 | 189 | id: "+15550001111", |
190 | | -dmSenderId: "+15550001111", |
191 | 190 | isSamePhone: false, |
192 | | -isDmSenderSamePhone: false, |
193 | 191 | }, |
194 | 192 | ingress: { |
195 | 193 | admission: "dispatch", |
@@ -255,7 +253,8 @@ describe("checkInboundAccessControl admission contract", () => {
|
255 | 253 | groupSessionId: groupJid, |
256 | 254 | }); |
257 | 255 | expect(result.admission.sender.id).toBe(participantJid); |
258 | | -expect(result.admission.sender.dmSenderId).toBe(groupJid); |
| 256 | +expect(result.admission.sender).not.toHaveProperty("dmSenderId"); |
| 257 | +expect(result.admission.conversation.kind).toBe("group"); |
259 | 258 | }); |
260 | 259 | |
261 | 260 | it("does not authorize unresolved group participant JIDs as phone allowlist entries", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -191,7 +191,6 @@ export async function checkInboundAccessControl(params: {
|
191 | 191 | isGroup: params.group, |
192 | 192 | conversationId, |
193 | 193 | senderId: admissionSenderId, |
194 | | -dmSenderId: params.from, |
195 | 194 | }), |
196 | 195 | }; |
197 | 196 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,9 +60,7 @@ export type WhatsAppInboundAdmission = {
|
60 | 60 | }; |
61 | 61 | sender: { |
62 | 62 | id: string; |
63 | | -dmSenderId: string; |
64 | 63 | isSamePhone: boolean; |
65 | | -isDmSenderSamePhone: boolean; |
66 | 64 | }; |
67 | 65 | ingress: WhatsAppInboundIngressDecision; |
68 | 66 | senderAccess: WhatsAppInboundSenderAccess; |
@@ -96,7 +94,6 @@ export function buildWhatsAppInboundAdmission(params: {
|
96 | 94 | isGroup: boolean; |
97 | 95 | conversationId: string; |
98 | 96 | senderId: string; |
99 | | -dmSenderId: string; |
100 | 97 | }): WhatsAppInboundAdmission { |
101 | 98 | return { |
102 | 99 | accountId: params.policy.account.accountId, |
@@ -109,9 +106,7 @@ export function buildWhatsAppInboundAdmission(params: {
|
109 | 106 | }, |
110 | 107 | sender: { |
111 | 108 | id: params.senderId, |
112 | | -dmSenderId: params.dmSenderId, |
113 | 109 | isSamePhone: params.policy.isSamePhone(params.senderId), |
114 | | -isDmSenderSamePhone: params.policy.isSamePhone(params.dmSenderId), |
115 | 110 | }, |
116 | 111 | ingress: { |
117 | 112 | admission: params.access.ingress.admission, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,9 +23,7 @@ function createAdmission(): NonNullable<WebInboundCallbackMessage["admission"]>
|
23 | 23 | }, |
24 | 24 | sender: { |
25 | 25 | id: "+15550000002", |
26 | | -dmSenderId: "123@g.us", |
27 | 26 | isSamePhone: false, |
28 | | -isDmSenderSamePhone: false, |
29 | 27 | }, |
30 | 28 | ingress: { |
31 | 29 | admission: "dispatch", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -233,7 +233,6 @@ describe("web monitor inbox", () => {
|
233 | 233 | }, |
234 | 234 | sender: { |
235 | 235 | id: "+999", |
236 | | -dmSenderId: "+999", |
237 | 236 | }, |
238 | 237 | senderAccess: { |
239 | 238 | allowed: true, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。