1
1
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2025-12-07 21:13:10 +00:00

19 Commits

Author SHA1 Message Date
Sunwuyuan
7a010faa54
1 2025-11-23 16:48:27 +08:00
Sunwuyuan
c545612c9c
规范代码格式 2025-11-16 16:15:05 +08:00
Sunwuyuan
4ec10acfcf
feat: 增强错误处理,统一JWT过期返回格式,添加业务错误码支持 2025-11-16 16:11:31 +08:00
Sunwuyuan
4ae023afb0
feat: 添加设备信息提取功能,增强 UUID 认证中间件的错误处理 2025-11-16 14:46:05 +08:00
SunWuyuan
296473633c
feat: 为新设备添加默认自动登录配置 2025-11-02 11:53:55 +08:00
SunWuyuan
2ab90ffebc
feat: Implement Refresh Token system with enhanced security and user experience
- Added refresh token support in the account model with new fields: refreshToken, refreshTokenExpiry, and tokenVersion.
- Created a new token management utility (utils/tokenManager.js) for generating and verifying access and refresh tokens.
- Updated JWT utility (utils/jwt.js) to maintain backward compatibility while introducing new token generation methods.
- Enhanced middleware for JWT authentication to support new token types and automatic token refreshing.
- Expanded API endpoints in routes/accounts.js to include refresh token functionality, logout options, and token info retrieval.
- Introduced automatic token refresh mechanism in the front-end integration examples.
- Comprehensive migration checklist and documentation for the new refresh token system.
- Added database migration script to accommodate new fields in the Account table.
2025-11-02 09:48:03 +08:00
SunWuyuan
bb61e6e6f5
feat: Add AutoAuth functionality and enhance Apps API
- Introduced AutoAuth model to manage automatic authorization configurations for devices.
- Added new endpoint to obtain token via namespace and password for automatic authorization.
- Implemented functionality to set student names for student-type tokens.
- Enhanced AppInstall model to include deviceType and isReadOnly fields.
- Updated device creation to allow custom namespaces and ensure uniqueness.
- Added routes for managing AutoAuth configurations, including CRUD operations.
- Implemented checks for read-only tokens in KV operations.
- Created detailed API documentation for AutoAuth and new Apps API endpoints.
- Added migration scripts to accommodate new database schema changes.
2025-11-01 19:31:46 +08:00
SunWuyuan
aec482cbcb
cskv 2025-10-06 10:49:48 +08:00
SunWuyuan
7b1e224f70
继续一大堆功能实现 2025-10-03 21:22:18 +08:00
SunWuyuan
521522c1d2
更新到一半 2025-10-02 12:07:50 +08:00
SunWuyuan
35d05df925
Refactor project structure by reorganizing imports, removing unused files, and updating .gitignore to include additional environment and build directories. Delete legacy migration scripts and Docker configurations to streamline the codebase. 2025-05-25 09:25:58 +08:00
SunWuyuan
cf646d619f
Add bcrypt and js-base64 dependencies in package.json and pnpm-lock.yaml. Enhance authentication middleware in auth.js with password hint functionality and improve error handling. Update device management routes in kv.js to support password hint retrieval and modification, ensuring better security and user experience. 2025-05-18 14:33:16 +08:00
SunWuyuan
b312756d5f
Refactor authentication middleware in auth.js to improve site key validation and device access control. Update access types to use an enum in the Prisma schema. Enhance rate limiting in rateLimiter.js for API and write operations. Modify routes in kv.js to support new access types and password management features, including a new endpoint for password removal. 2025-05-18 10:54:41 +08:00
SunWuyuan
3bff254a22
Implement device authentication middleware and Prisma model for device management. Update routes to include device info retrieval and password management, enhancing security and functionality. 2025-05-17 20:02:55 +08:00
SunWuyuan
69887f9c47
Update batch rate limiter in rateLimiter.js to allow 10 operations per minute instead of 5, enhancing throughput for bulk operations. 2025-05-11 13:50:22 +08:00
SunWuyuan
810491fd2f
Enable static file serving in app.js, implement a batch import endpoint in kv.js for bulk key-value pair uploads, and add a corresponding rate limiter. Enhance the front-end in index.ejs with a form for batch data import and improve styling for better user experience. 2025-05-11 12:04:06 +08:00
SunWuyuan
6897a082e7
Integrate OpenTelemetry instrumentation into app.js, add global and method-based rate limiting middleware, and enhance CORS configuration. Update package.json to include new dependencies for OpenTelemetry and rate limiting tests. 2025-05-11 11:30:26 +08:00
SunWuyuan
4c8e38e805
Refactor app.js to streamline routing by removing unused API endpoints and integrating the KV store router directly. Clean up errorHandler.js by removing unnecessary comments and imports. 2025-05-10 13:50:19 +08:00
SunWuyuan
eeacc317a9
app.js 重构为 ES 模块,新增 KV 存储功能,并实现请求超时中间件。更新 package.json 中的依赖项并移除未使用的路由。完善 README,补充项目特性与安装使用说明。 2025-05-10 13:47:02 +08:00