d93c518a14
Co-authored-by: Cursor <cursoragent@cursor.com>
1.1 KiB
1.1 KiB
Changelog — 文件管理 Phase 5 加固
| 项 | 内容 |
|---|---|
| 日期 | 2026-06-01 |
| 类型 | 加固 / 测试 |
摘要
完成设计文档 Phase 5:ls -la 解析抽到 unix_ls.py 并补单测;browse 优先 --time-style=long-iso;read-file 走 exec_ssh_command_with_fallback;remote_write_bytes 尊重 files_elevation(off 不 sudo、always 跳过 SFTP 直走 sudo tee)。
动机
统一可测的列表解析、可排序的 ISO 时间、只读文件在 root 属主下可读,并与服务器提权策略一致。
涉及文件
server/utils/unix_ls.pyserver/api/sync_v2.py(browse、read-file、write-file、upload)server/infrastructure/ssh/asyncssh_pool.pytests/test_file_permissions.py(新建)tests/test_unix_ls.pydocs/audit/2026-06-01-posix-path-batch-review.md
迁移 / 重启
- 无 DB 变更;需重启后端;前端无必改项(时间列展示 ISO 字符串更易排序)。
验证
pytest tests/test_file_permissions.py tests/test_unix_ls.py tests/test_files_elevation.py -q
ruff check server/utils/unix_ls.py server/infrastructure/ssh/asyncssh_pool.py