ex_tianzy 71b9678d22 feat(credentials): add stage 1 encrypted server-side credential storage
Introduce an opt-in AES-256-GCM credential store keyed by environment,
application and principal. Bind ciphertext to identity, version and key ID
with authenticated data; support retained decryption keys and active-key
rotation. Use expected-version CAS to reject duplicate or stale writers.

Keep token values and scopes encrypted at rest, hide token fields from
object repr, and use fixed errors without credential contents. Add tests
for identity substitution, authenticated tampering, wrong keys, rotation,
persistence, concurrent writers and malformed inputs. Include an opt-in
PostgreSQL test using an isolated schema.

Validation: 102 passed, 2 skipped (no real PostgreSQL URL), 15 existing
uvicorn/websockets deprecation warnings. Python AST and diff checks pass.

This is stage 1 only: no public routes or existing OAuth/refresh behavior
are changed, no production key/database is initialized, and no ECS
runtime deployment or real platform requests were performed. Broker,
centralized refresh, access-token-only issuance and unbind lifecycle
integration remain subsequent stages. See deployable/CREDENTIAL_MIGRATION.md.
2026-11-04 10:04:42 +08:00

ECS 中继服务源码快照

新环境部署入口

需要部署服务时,请使用 deployable/README.md,该目录已整理统一源码、完整 Compose、配置模板、首次初始化及运维脚本。下面的快照目录保留原样用于追溯。

离线部署需另行取得 ARM64 依赖包;源码仓库不包含镜像二进制或真实运行凭据。实机验收状态见 部署检查报告。

本仓库保存 2026-10-27 从 ECS 导出的解压后源码,共 316 个原始文件,包括运行容器源码、主机源码、部署参考文件和历史补丁源码。

来源与校验

  • 原始归档:hainuo-ecs-source-20261027-165115-qb1aPw.tar.gz
  • SHA256:ac3bda5b7835b5d9c4be83c64244554e41c4bddcb94b7cf8adec43bf2efe7e9c
  • 上传前在 Windows 本地验证归档 SHA256、路径安全性和文件类型。
  • SOURCE_SHA256SUMS.json 记录 316 个原始文件的 SHA256。
  • 压缩包和外部校验文件没有作为源码提交。

目录说明

路径 内容
container-code/ 从各运行容器中导出的应用源码;服务与镜像信息见 deployed-services.tsv
host-code/ ECS 主机工作目录中的源码,可能与容器内版本不同
deployment-source/ 已安装的脚本、文档、测试及脱敏部署配置
patch-source/ 历史补丁包中的源码;存在于此处不代表全部已部署
patch-inventory.json 历史补丁来源与校验记录

使用范围

这是源码交接快照,不是可直接部署的离线交付包。Compose 中的敏感配置已脱敏;依赖二进制、离线镜像、数据库、运行时配置、证书私钥、设备身份和用户令牌不包含在内。新环境部署需要另行配置应用凭据、域名及证书、数据存储和依赖,并进行业务验收。

本次导入保留原始源码,不合并不同来源的版本,不修改 ECS 服务,也不包含仅安装在 Windows 客户端上的补丁。

上传前检查

敏感文件名及 PEM 私钥标记扫描未发现命中。凭据赋值格式扫描有 6 处命中,人工核对为测试中的 fake-app-secret / fake-secret 示例,不是运行凭据。这些检查不能保证识别所有形式的硬编码敏感信息。

S
Description
No description provided
Readme
1.2 MiB
Languages
Python 95.9%
JavaScript 2.1%
Shell 1.1%
HTML 0.8%