360 Secure SkillHub
360 安全技能中心

Approve Pairing

在 openclaw CLI 不可用时,通过读取 ~/.openclaw/credentials/<channel>-pairing.json 找到配对码对应的发送者,将其写入 <channel>-<accountId>-allowFrom.json 白名单并从待处理列表中移除,从而批准 Telegram、WhatsApp、Signal 等渠道的私信配对请求;脚本或手动步骤二选一。

分类:安全
madan-wego
madan-wego
热度 50.12
最近更新 2026-05-17 12:38:06

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add madan-wego/approve-pairing
兼容性
OpenClaw 专属
联网要求
不联网
数据出网
数据不出本机
Metadata
name
approve-pairing
description
Approve a pending DM pairing request without the openclaw CLI, by directly editing credential files. Use when `openclaw pairing approve` is unavailable (CLI not in PATH, elevated access not configured, sandbox environment). Supports telegram, whatsapp, signal, imessage, discord, slack, feishu.

approve-pairing

Approve pending DM pairing requests by writing directly to OpenClaw credential files — no CLI required.

How It Works

Pairing state lives in two files under ~/.openclaw/credentials/:

  • <channel>-pairing.json — pending requests (sender ID, code, accountId)
  • <channel>-<accountId>-allowFrom.json — approved senders allowlist

Approving = add sender ID to allowFrom file + remove code from pairing file.

Quick Approval (script)

python3 skills/approve-pairing/scripts/approve_pairing.py <channel> <code>

Example:

python3 skills/approve-pairing/scripts/approve_pairing.py telegram PWVW264M

The script:

  1. Reads ~/.openclaw/credentials/<channel>-pairing.json
  2. Finds the request matching the code
  3. Appends the sender ID to the allowFrom file
  4. Removes the code from pending requests

Manual Steps (if script unavailable)

  1. Read ~/.openclaw/credentials/<channel>-pairing.json to get id and meta.accountId
  2. Write/update ~/.openclaw/credentials/<channel>-<accountId>-allowFrom.json:
    { "version": 1, "allowFrom": ["<sender_id>"] }
    
  3. Clear the pending request from <channel>-pairing.json

Notes

  • Codes expire after 1 hour — check createdAt if approval fails
  • A gateway restart may be needed: openclaw gateway restart
  • If accountId is "default" or empty, the file is <channel>-default-allowFrom.json
  • Pending requests capped at 3 per channel; old ones must expire before new ones are created