Commit Graph

16 Commits

Author SHA1 Message Date
f93cb3eedb Add unit tests for models and services
- Implemented unit tests for Object model including folder and file creation, properties, and path retrieval.
- Added unit tests for Setting model covering creation, unique constraints, and type enumeration.
- Created unit tests for User model focusing on user creation, uniqueness, and group relationships.
- Developed unit tests for Login service to validate login functionality, including 2FA and token generation.
- Added utility tests for JWT creation and verification, ensuring token integrity and expiration handling.
- Implemented password utility tests for password generation, hashing, and TOTP verification.
2025-12-19 19:48:05 +08:00
51b6de921b feat: Implement API routers for user, tag, vas, webdav, and slave functionalities
- Added user authentication and registration endpoints with JWT support.
- Created tag management routes for creating and deleting tags.
- Implemented value-added service (VAS) endpoints for managing storage packs and orders.
- Developed WebDAV account management routes for creating, updating, and deleting accounts.
- Introduced slave router for handling file uploads, downloads, and aria2 task management.
- Enhanced JWT utility functions for token creation and secret key management.
- Established lifespan management for FastAPI application startup and shutdown processes.
- Integrated password handling utilities with Argon2 hashing and two-factor authentication support.
2025-12-19 18:04:34 +08:00
20753f1725 feat: 添加两步验证功能,重构相关逻辑,移除冗余代码 2025-12-19 14:30:13 +08:00
b7c5d5aec7 feat: 添加两步验证功能,优化用户登录逻辑,更新相关模型和依赖 2025-12-19 14:11:24 +08:00
89e837d91c feat: 重构模型和响应结构,优化用户和对象管理逻辑,添加 Dockerfile 2025-12-18 18:28:41 +08:00
a977f5b261 优化数据表结构 2025-12-18 12:17:17 +08:00
b02a4638da feat: add database session dependency for FastAPI routes
- Introduced a new dependency in `middleware/dependencies.py` to provide an asynchronous database session using SQLModel.
- This dependency can be utilized in route functions to facilitate database operations.
2025-11-27 22:18:50 +08:00
b364b740ca feat: Enhance models and README with additional features and improvements
- Updated README to include KodBox in project vision.
- Added model descriptions for clarity in Download, File, Folder, Group, Node, Order, Policy, Redeem, Report, Request, Response, Setting, Share, SourceLink, StoragePack, Tag, Task, User, and WebDAV.
- Changed optional fields from Optional[...] to the new union type syntax (e.g., str | None).
- Improved foreign key references in models for consistency.
- Refactored relationships in models to use singular forms where appropriate.
- Updated login service to reflect changes in request model types.
2025-11-27 21:22:40 +08:00
1533d9e89c Refactor code structure for improved readability and maintainability 2025-11-27 20:56:48 +08:00
83276c8b95 优化用户登录逻辑,简化错误处理,更新密码哈希生成方式为Argon2 2025-11-01 19:41:19 +08:00
cf5539f3c2 重构模型基类 2025-09-26 06:18:59 +08:00
2a173c0566 添加Github登录,优化数据库模型 2025-09-01 00:21:06 +08:00
f3a5ae9c40 优化部分代码实现 2025-08-28 02:23:26 +08:00
9f93f6040b 完成部分Github登录回调 2025-08-27 13:49:17 +08:00
e98c46f44a 用户登录 2025-07-17 19:33:48 +08:00
557a50f539 单元测试:新建用户与用户组 2025-07-14 15:13:05 +08:00