Files
Genarrative/backend-rewrite-tasklist/01_M0_M2_FOUNDATION_AND_AUTH.md
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

28 KiB
Raw Blame History

M0 ~ M2基础设施与鉴权任务清单

M0冻结能力与重写边界

能力冻结

仓库边界

交付物

M1Rust 工作区与 Axum 基础设施

工作区搭建

Axum 基础能力

基础工程脚本

阶段验收

  • Axum 服务可独立启动 证据:./server-rs/scripts/smoke.ps1 已通过,覆盖临时启动 api-server、等待 /healthz 就绪并验证 raw / envelope 协议。
  • /healthz 返回与当前工程兼容
  • 基础 response envelope 与 request id 行为稳定 证据:cargo test -p api-server --manifest-path server-rs/Cargo.toml 已通过,覆盖 envelope 协商与 /healthz 头部回写。
  • Rust workspace 能完整编译通过 证据:cargo check -p api-server --manifest-path server-rs/Cargo.toml 已通过。

SpacetimeDB 身份表

Axum 鉴权服务

手机验证码登录

微信登录

OIDC 与 SpacetimeDB 身份透传

当前接口兼容

阶段验收

  • 密码登录主链可用 证据:cargo test -p module-auth --manifest-path server-rs/Cargo.tomlcargo test -p api-server --manifest-path server-rs/Cargo.toml 已通过,覆盖自动建号、重复登录复用、错密码 401、非法用户名 400 与 refresh cookie 写回。
  • refresh cookie 主链可用 证据:cargo test -p module-auth --manifest-path server-rs/Cargo.tomlcargo test -p api-server --manifest-path server-rs/Cargo.toml 已通过,覆盖 refresh 成功轮换、旧 token 失效、缺少 cookie 401 与失败时清理 cookie。
  • 手机验证码主链可用 证据:cargo test -p module-auth phone --manifest-path server-rs/Cargo.toml -- --nocapturecargo test -p api-server phone --manifest-path server-rs/Cargo.toml -- --nocapture 已通过,覆盖发送验证码、同场景冷却 429、验证码错误次数耗尽 429、重新发送后恢复登录,以及手机号登录建号/复用与 refresh cookie 写回。
  • 微信登录主链可用 证据:cargo test -p api-server --manifest-path server-rs/Cargo.tomlcargo test -p api-server wechat --manifest-path server-rs/Cargo.tomlcargo test -p module-auth --manifest-path server-rs/Cargo.toml 已通过,覆盖 wechat/startwechat/callback、待绑定会话签发、手机号补绑并入已有账号,以及 unionid 命中后新 openid 映射回写。
  • 所有旧鉴权接口可通过 contract 回归