Files
member-platform/docs/TASKPLAN_BACKEND.md
2026-03-29 23:29:49 +08:00

36 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Backend TaskPlan
## 目標
提供可被前端穩定串接的 memberapi包含身份驗證、權限快照、權限管理與 Authentik 同步能力。
## 已完成
- [x] FastAPI 專案骨架與分層api/service/repository/model
- [x] `GET /healthz`
- [x] `GET /me`
- [x] `GET /me/permissions/snapshot`
- [x] `POST /admin/permissions/grant`
- [x] `POST /admin/permissions/revoke`
- [x] `POST /internal/users/upsert-by-sub`
- [x] `GET /internal/permissions/{authentik_sub}/snapshot`
- [x] `POST /internal/authentik/users/ensure`
- [x] API client 驗證(`X-Client-Key` + `X-API-Key`
- [x] Authentik JWT 驗證JWKS
- [x] DB schema 初始化 SQL + migration SQL
- [x] 基本測試與 lint
## 進行中(建議近期)
- [ ] 增加 Alembic migration 正式流程
- [ ] 補齊更多 API 測試admin/internal success + fail cases
- [ ] 增加 request id / logging 格式
## 待辦(上線前)
- [ ] 加入 rate limit依 client 或 IP
- [ ] 針對 admin API 加 audit log授權/撤銷行為)
- [ ] 加上 CORS 白名單與反向代理配置驗證
- [ ] 製作部署腳本systemd / container
## 驗收條件
- [ ] 前端可完成 `/me` + `/me/permissions/snapshot` + grant/revoke 全流程
- [ ] 401/403/404/503 錯誤碼與文件一致
- [ ] 至少一輪 staging smoke test 通過