Files
new-api-key-usage/apps/server/src
skycurtain 3ffbd030b9 feat(server): 数据层与密钥(阶段 1)——crypto / 时间工具 / env 加载 + 建表
- crypto:HKDF 派生 hmac/aes 子密钥;HMAC-SHA256 指纹(key_hash);AES-256-GCM 加解密(nonce||tag||ct)
- time:北京时间 +08:00 ISO 序列化、Unix 秒转换、expires_at 0→null、输入宽容解析
- load-env:从仓库根 .env 显式加载(Bun 只自动加载 cwd 的 .env);drizzle.config 同步接入
- 单测 15 项全绿(bun test);db:push 后四表在库(api_keys 17 列 / usage_logs 23 列 + 索引齐)
2026-09-15 00:18:21 +08:00
..