wisent-ai/weles-client

GitHub: wisent-ai/weles-client

Weles Client 是一个面向经授权浏览器工作流的安全客户端库,提供严格的白名单管控和签名回执验证能力。

Stars: 0 | Forks: 0

# Weles 客户端 [![发布](https://img.shields.io/github/v/release/wisent-ai/weles-client?display_name=tag&sort=semver)](https://github.com/wisent-ai/weles-client/releases) [![下载量](https://img.shields.io/github/downloads/wisent-ai/weles-client/total)](https://github.com/wisent-ai/weles-client/releases) [![许可证](https://img.shields.io/github/license/wisent-ai/weles-client)](https://github.com/wisent-ai/weles-client) [![Discord](https://img.shields.io/badge/Discord-Join%20Wisent-5865F2?logo=discord&logoColor=white)](https://discord.gg/qRjpkthq54) 用于经过单独授权的 Weles 浏览器工作流的安全公共客户端和回执验证器。 此仓库特意并非 Weles 执行器。指纹伪造、浏览器补丁、提供商轮换、反机器人研究、特定于服务的轨迹、worker 调度、操作记录以及隐身配置均保留在私有的 Weles 服务仓库中。 ## 保证 该客户端: - 要求提供精确的 origin 白名单和 action 白名单; - 仅接受 HTTPS endpoint,仅在 `localhost` 上允许使用 HTTP 以用于开发; - 拒绝明文的 password、secret、token、cookie、authorization 和 proxy-auth 字段; - 将不透明的凭证引用与工作流输入分开发送; - 要求每次提交和取消都必须提供人类可读的理由; - 发送由调用者控制的幂等键,并且不执行隐藏的重试; - 支持通过显式的幂等请求进行取消; - 对暴露的错误中的敏感响应字段进行脱敏处理; - 使用调用者提供的受信任公钥验证已签名的回执; - 当显示的声明与已签名的 payload 不符时,拒绝该回执。 该客户端不能证明目标允许自动化。组织仍需对授权、可接受的使用、适用的条款、origin/action 批准以及数据处理负责。 ## 用法 ``` import { WelesClient, verifyReceipt } from '@wisent-ai/weles-client'; const client = new WelesClient({ endpoint: process.env.WELES_URL, bearer: process.env.WELES_TOKEN, organizationId: process.env.WISENT_ORGANIZATION_ID, allowedOrigins: ['https://console.example.com'], allowedActions: ['export-approved-report'], receiptKeys: { 'current-signing-key': process.env.WELES_RECEIPT_PUBLIC_KEY, }, }); const accepted = await client.submit({ origin: 'https://console.example.com', action: 'export-approved-report', input: { report: 'monthly' }, credentialRefs: ['customer-console-account'], justification: 'Export the report authorized by the account owner.', }); if (accepted.receipt) { verifyReceipt(accepted.receipt, client.receiptKeys); } ``` 客户端调用要么返回服务响应(包括存在经验证的回执时的回执),要么抛出带有稳定错误代码的 `WelesClientError`。该库从不自行记录日志。 ## 契约 任务提交包含: - `organizationId` - 精确的 `origin` - 属于白名单的 `action` - 非机密的 `input` - 不透明的 `credentialRefs` - `evidencePolicy` - 人类可读的 `justification` - 由调用者控制的 `Idempotency-Key` 已签名的回执声明绑定任务、组织、origin、action、结果和 evidence 摘要。使用者可以选择并轮换受信任的密钥集;未知的密钥会触发安全失效(fail closed)。 ## 发布状态 公共开发源代码。在不可变版本获批之前,该包清单特意没有可发布的版本。源代码的可用性并不意味着承诺提供托管式的 Weles 服务、目标授权、工作流审批或 SLA。 - 问题:[`wisent-ai/weles-client`](https://github.com/wisent-ai/weles-client/issues) - 漏洞:[私密 GitHub 安全公告](https://github.com/wisent-ai/weles-client/security/advisories/new) - 许可证:Apache License 2.0;请参阅 [`LICENSE`](LICENSE)
标签:MITM代理, Streamlit, TypeScript, 代码分析, 凭证管理, 安全插件, 客户端, 数据可视化, 签名校验, 自定义脚本, 访问控制