abstudio-cn/Harness-totp-authenticator

abstudio-cn★ 0JavaScriptLast synced: 2026-08-16

Open on GitHub

DeepSeek Harness TOTP authenticator safety plugin

README excerpt

TOTP Authenticator 插件(DSH / DeepSeek Harness 版) 基于 RFC 6238 的 TOTP 双因素认证插件,由 openclaw 技能(原 scripts/totp.py 、 scripts/totp.js )转换为 DeepSeek Harness 动态 Cordis 插件 。除 TOTP 验证码生成外,还提供 关键操作防护门 (拦截递归删除文件夹等破坏性命令)和 首次使用绑定 (生成密钥 + 二维码 + 用户确认)。 目录结构 插件运行时会在此目录下生成两个本地文件(首次绑定后出现): 文件 说明 .totp-gate.json 绑定状态(绑定的密钥、绑定时间),插件本地持久化 totp-gate-qrcode.svg 绑定用的二维码图片(扫码或手机相机识别) 插件无 fs 服务时退化为纯内存状态(插件停止即丢失绑定)。 功能 1. totp — TOTP 验证码生成 参数 说明 secret (必填) Base32 密钥(A-Z、2-7,忽略空格/连字符/ = 填充),或完整 otpauth://totp/... URI digits 码位数,默认 6 interval 时间步长(秒),默认 30(AWS MFA 等服务用 60) verify 可选:校验候选码,返回 PASS/FAIL time 可选:指定 Unix 时间戳计算(测试/复现已知向量用),默认当前时间 兼容 Google Authenticator、Microsoft Authenticator、Authy 等。 2. 关键操作防护门 通过 tools/pre-execute 事件在 命令执行前 拦截 pwsh / bash 的破坏性命令: - 递归删除: Remove-Item -Recurse 、 rm -rf/-r 、 rd /s 、 del /s 、 [IO.Directory]::Delete(x, $true) - 批量删除:通配符删除、管道删除( Get-ChildItem Remove-Item ) - 磁盘破坏: Format-Volume 、 Clear-Disk 、 diskpart 、 format c: - 其他: git clean -f 、 git reset --hard 、 robocopy /MIR 、 find -delete 、 dd 、 mkfs 、 shred 、 sdelete - 豁免: -WhatIf 试运行不拦截 被拦截的命令不会执行;拦截提示会引导 Agent 走解锁流程。 3. 首次使用绑定(两步) 1. totp gate bind :生成新密钥 → 保存到 .totp-gate.json → 输出二维码(SVG 文件 + 聊天内预览)、 otpauth:// URI 和手工录入密钥 →…

View full README on GitHub →
Tools / Devdeepseek-harnessdsh-plugin

Category