Repository navigation
feat(auth): add account access domain and repository - #209
Alexander-Noah wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/review |
There was a problem hiding this comment.
No high-confidence issues found in the changed authentication domain, repository, transaction handling, or tests.
Validation: git diff --check and Python bytecode compilation passed. The full pytest/lint/type-check suite was not run locally because uv, pytest, ruff, and mypy are unavailable in this environment.
There was a problem hiding this comment.
Found one performance issue in the account-creation path. Other changed authentication contracts, repository error mapping, transaction cleanup, and tests did not reveal additional high-confidence findings.
Validation: git diff --check and Python bytecode compilation passed. The full pytest/lint/type-check suite was not run because the required tools are unavailable in this environment.
Review Complete
|
c09c050 to
e43ebb5
Compare
关联 Issue
Refs #206
变更概述
完成后端认证实施包 B1,建立账户访问领域契约、认证编排、账户仓储及事务边界,并补充对应单元测试和 PostgreSQL 并发测试。
认证领域契约
backend/src/timeflow/business/auth/contracts.pyrepr=False避免密码、密码哈希和 Token 出现在对象表示中。backend/src/timeflow/business/auth/service.pyacc_加随机 ID 生成账户 ID。backend/src/timeflow/business/auth/__init__.py账户持久化与事务
backend/src/timeflow/data/repositories/account.pyflush。backend/src/timeflow/data/account_uow.pybackend/src/timeflow/data/repositories/__init__.py自动化测试
backend/tests/business/auth/test_credentials.pybackend/tests/business/auth/test_service.pybackend/tests/data/repositories/test_account.pybackend/tests/test_postgres_auth_repository.py变更原因
Issue #206 将后端认证拆分为 B1-B5 五个实施包。
本 PR 完成 B1“领域与仓储”,为后续密码安全、JWT、HTTP 认证和 WebSocket 鉴权提供稳定的领域接口与事务基础。
认证服务通过协议依赖密码和 Token 能力,账户仓储只负责持久化操作,事务由统一工作单元管理,从而减少跨层重复逻辑并保持较低的代码冗余。
破坏性变更
无已知破坏性变更。
验证结果
uv lock --check通过backend/scripts/check.sh通过本次不包含
POST /api/v1/auth/accessHTTP 接口