WeKnora/internal/utils
wizardchen 5241dbc39e feat(security): implement path and filename validation utilities
- Added `SafePathUnderBase` to prevent path traversal by ensuring file paths remain within a specified base directory.
- Introduced `SafeFileName` to validate and sanitize file names, disallowing path traversal and empty names.
- Implemented `SafeObjectKey` to validate object keys for storage, ensuring they do not contain path traversal sequences.
- Updated file handling methods in `cos.go`, `local.go`, and `minio.go` to utilize these new validation utilities, enhancing security against invalid file paths and names.

This update improves the robustness of file operations by enforcing strict validation rules, thereby mitigating potential security risks.
2026-03-02 21:21:49 +08:00
..
debug.go feat: 使用增强的任务ID生成器替换UUID 2026-01-14 17:09:19 +08:00
filesize.go feat: 添加可配置的文件上传大小限制 2025-12-30 14:35:10 +08:00
inject.go fix: add comprehensive SQL node validation 2026-01-26 12:00:49 +08:00
inject_test.go refactor: Centralize and simplify SQL validation logic 2026-01-21 20:39:37 +08:00
json.go feat: Add DataSchema tool for retrieving schema information from CSV and Excel files 2025-12-29 20:03:51 +08:00
security.go feat(security): implement path and filename validation utilities 2026-03-02 21:21:49 +08:00
taskid.go feat: 使用增强的任务ID生成器替换UUID 2026-01-14 17:09:19 +08:00