mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
71 lines
2.5 KiB
YAML
71 lines
2.5 KiB
YAML
title: WhatsApp dmPolicy disabled stays quiet
|
|
|
|
scenario:
|
|
id: whatsapp-access-control-dm-disabled
|
|
surface: channels
|
|
coverage:
|
|
primary:
|
|
- channels.access-policy
|
|
objective: Verify dmPolicy disabled rejects direct messages.
|
|
successCriteria:
|
|
- The direct message produces no outbound reply.
|
|
docsRefs:
|
|
- docs/channels/whatsapp.md
|
|
codeRefs:
|
|
- extensions/whatsapp/src/monitor.ts
|
|
execution:
|
|
kind: flow
|
|
channel: whatsapp
|
|
suiteIsolation: isolated
|
|
summary: Verify WhatsApp dmPolicy disabled behavior through the canonical adapter.
|
|
config:
|
|
requiredChannelDriver: live
|
|
policyKey: dmPolicy
|
|
policyValue: disabled
|
|
conversationKind: direct
|
|
conversationId: 15550000001@s.whatsapp.net
|
|
senderId: 15550000002@s.whatsapp.net
|
|
mentionPrefix: ""
|
|
expectReply: false
|
|
markerPrefix: WHATSAPP_QA_DM_DISABLED
|
|
timeoutMs: 8000
|
|
|
|
flow:
|
|
steps:
|
|
- name: enforces configured access policy
|
|
actions:
|
|
- call: waitForGatewayHealthy
|
|
args: [{ ref: env }, 60000]
|
|
- call: waitForTransportReady
|
|
args: [{ ref: env }, 60000]
|
|
- call: patchConfig
|
|
args:
|
|
- env: { ref: env }
|
|
patch:
|
|
expr: "({ channels: { whatsapp: { [config.policyKey]: config.policyValue, ...(env.transport.accountId === 'default' ? {} : { accounts: { [env.transport.accountId]: { [config.policyKey]: config.policyValue } } }) } } })"
|
|
- resetTransport: true
|
|
- set: marker
|
|
value:
|
|
expr: "`${config.markerPrefix}_${randomUUID().slice(0, 8).toUpperCase()}`"
|
|
- set: outboundCount
|
|
value:
|
|
expr: "getTransportSnapshot().messages.filter((message) => message.direction === 'outbound').length"
|
|
- sendInbound:
|
|
conversation:
|
|
id: { ref: config.conversationId }
|
|
kind: { ref: config.conversationKind }
|
|
senderId: { ref: config.senderId }
|
|
senderName: QA Driver
|
|
text:
|
|
expr: "`${config.mentionPrefix}Reply with only this exact marker: ${marker}`"
|
|
- if:
|
|
expr: config.expectReply
|
|
then:
|
|
- waitForOutbound:
|
|
textIncludes: { ref: marker }
|
|
timeoutMs: { ref: config.timeoutMs }
|
|
else:
|
|
- waitForNoOutbound:
|
|
quietMs: { ref: config.timeoutMs }
|
|
sinceIndex: { ref: outboundCount }
|
|
detailsExpr: "`${config.markerPrefix}: expectReply=${config.expectReply}`"
|