Commit Graph
12 Commits
Author SHA1 Message Date
MarSeventh 18b2db1224 fix: WebDAV internal calls use dedicated API Token for authentication
- Add 'internal' token type to API Token system, hidden from the
  security settings token list
- When WebDAV is enabled, auto-create an internal API Token with
  list/upload/delete permissions, stored in WebDAV config
- When WebDAV is disabled, auto-delete the internal token
- WebDAV handler reads the internal token from config and sends it
  as Bearer auth; if missing, creates one on-the-fly as fallback
- Works across both Docker and Cloudflare deployments since the
  token is persisted in KV/D1, not in process memory
2026-05-01 20:27:37 +08:00
MarSeventh 7823315b44 fix: reduce manage mutation response payloads 2026-04-29 16:04:36 +08:00
MarSeventh 4d2796f54a refactor: unify auth logic into authCore with authScope parameter
- Extract shared authentication logic into utils/auth/authCore.js
- Replace enableBasicAuth/enableAuthCode flags with clear authScope enum (ADMIN/USER/EITHER)
- Move all auth-related files into utils/auth/ subdirectory
- Eliminate duplicated admin auth logic between _middleware.js and dualAuth.js
- Fix: user session no longer grants access to admin-only endpoints
- Fix: dualAuth no longer bypasses authCode when admin is not configured
- Update all 17 import references across the codebase
- Preserve original function signatures (userAuthCheck, dualAuthCheck) for zero caller changes
2026-04-18 13:24:53 +08:00
MarSeventh 636f23375a security: upgrade password hashing to PBKDF2 and fix API token generation
- Replace single-round SHA-256 with PBKDF2 (100k iterations) via Web Crypto API
- Auto-rehash old SHA-256/plaintext passwords to PBKDF2 on successful login
- Add timing-safe comparison to prevent timing attacks
- Replace Math.random() with crypto.getRandomValues() for API token and token ID generation
- Maintain full backward compatibility with existing SHA-256 hashes and plaintext passwords
2026-04-18 00:45:04 +08:00
MarSeventh 2628de051d feat: 添加 API Token 过期时间后端支持
- 新增 tokenExpiration.js 工具模块(过期判定、自动删除过滤)
- apiTokens.js 支持 expiresAt/autoDelete 字段的创建、更新、自动清理
- 新增 getTokenData 导出函数
- tokenValidator.js 增加过期检查逻辑
2026-03-10 10:52:01 +08:00
MarSeventh 2c1ff7241b 目录树设置和体验优化 2026-03-01 11:25:39 +08:00
MarSeventh 3dcf08e8b2 目录树设置和体验优化 2026-03-01 11:13:43 +08:00
MarSeventh 567cda2312 Feat:适配D1数据库 2025-08-22 18:20:10 +08:00
初衷 dbea752676 fix:所有模块导入/导出的兼容性问题 2025-08-13 19:09:01 +08:00
初衷 a49c1b75a3 fix:语法兼容性修复 2025-08-13 18:12:11 +08:00
初衷 e901a08af9 feat:现有的 KV 存储数据迁移到 D1 数据库 2025-08-13 16:26:04 +08:00
MarSeventh bab8dd35a6 Feat:支持备份和恢复;支持APIToken鉴权;支持指定部分默认上传设置 2025-07-31 16:22:25 +08:00