fs2aun-proxy (Python)
飞书消息通过 AUN 代理转发到目标 AID 的单进程代理服务。
安装
python -m venv .venv && . .venv/bin/activate
python -m pip install -e ".[dev]"
测试 / 检查
python -m pytest -q
python -m ruff check .
python -m mypy
运行
fs2aun-proxy serve -c config.toml
fs2aun-proxy fs-user create -c config.toml # 扫码创建/授权飞书机器人并写回 [feishu] app_id/app_secret
fs2aun-proxy aid create newbot.agentid.pub -c config.toml # 创建本地 AUN AID 身份,不自动切换 [aun] aid
fs2aun-proxy bind create -c config.toml alice.agent
fs2aun-proxy bind create -c config.toml # 省略 AID 时使用 [aun] default_aid_dst
fs2aun-proxy bind list -c config.toml
fs2aun-proxy bind remove -c config.toml ou_x alice.agent
curl -H "Authorization: Bearer $FS2AUN_ADMIN_TOKEN" http://127.0.0.1:8286/binds
配置
见 config.example.toml。敏感项(admin.token、bind.token_secret、bind.session_secret、feishu.app_secret、aun.encryption_seed)须 >= 32 字节,可用 FS2AUN_* 环境变量覆盖。
架构
单进程服务,包含以下模块:
- config — TOML 配置加载与校验
- models — Pydantic 数据模型(AunMessage、Binding 等)
- storage — 原子性 JSON 文件存储(带 FileLock)
- dedup — 持久化 / 内存 TTL 去重
- router — 绑定表、关联 ID、反向路由(asyncio.Lock 保护)
- ack — 待发送表与 ACK 状态机
- feishu — 飞书 REST 发送、OAuth 解析、Webhook 安全校验
- aun — AUN 网关 WebSocket 客户端
- bind — 绑定 Token、所有权授权、Challenge 存储
- oauth — OAuth Session AES-GCM 加密 Cookie
- service — 代理核心逻辑(飞书→AUN、AUN→飞书)
- http_app — FastAPI 应用(Webhook、OAuth 回调、管理 API)
- cli — 命令行入口(serve / webserve / fs-user create / aid create / bind create|list|remove)
Metadata
Release files for fs2aun-proxy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fs2aun_proxy-0.1.0.tar.gz | 226.5 kB | Without provenance | Details for fs2aun_proxy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fs2aun_proxy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fs2aun_proxy-0.1.0-py3-none-any.whl |
Total release size: 282.4 kB
Release files / fs2aun_proxy-0.1.0.tar.gz
| Download URL | fs2aun_proxy-0.1.0.tar.gz |
|---|---|
| Size | 226.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3befcca3e8821793d166d99942f827de7aff0c7fac0da0ce381cf2c3ee5c5216
|
|
BLAKE2b-256 checksum How to use checksums |
7ab45405dfce4d8ca52c9e21673a0d635a3831ee655cfe9bbe141a75f0cc6ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / fs2aun_proxy-0.1.0-py3-none-any.whl
| Download URL | fs2aun_proxy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 56.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f66371ded73b1913b85b18d02bad40b0b6e50c2a315303041d550c1eddfe7b47
|
|
BLAKE2b-256 checksum How to use checksums |
3b1e9f47dec07ce6b330d7d62088d9a1c346ba6fc6bdbd67b349604366e22849
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for fs2aun-proxy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.