WeKnora/internal/application/service/file
YG52052051 cab16dcacb
fix(storage): strip storage-backend scope in local provider path normalization (#2979)
KB deletion runs on the process-wide default file service, which is not
wrapped by BackendScopedFileService. Storage-scoped physical paths
("storage://<backend-id>/local://<tenant>/...") therefore reach the raw
local provider, fall through to the relative-path branch, and get joined
under baseDir — producing a nonexistent path so every os.Remove fails with
ENOENT and the physical files silently leak on every KB/document delete.

normalizePathForBase now strips the scope wrapper up front (both the
canonical "storage://" form and the "storage:/" form produced when a path
has been through filepath.Clean), and tolerates the cleaned "local:/"
provider scheme. Unscoped paths are unaffected.

Co-authored-by: YG52052051 <YG52052051@users.noreply.github.com>
2026-09-21 14:21:25 +08:00
..
backend_scoped.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
backend_scoped_test.go fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
cos.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
cos_parse_test.go fix(security): close the low-severity shared-space findings (#3416) 2026-09-18 22:58:46 +08:00
dummy.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
endpoint_security_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
errors.go fix: deep-copy stored files and images when cloning a knowledge base 2026-06-03 14:45:59 +08:00
factory.go fix(security): reject traversal in local prefixes, task IDs, and wiki sort 2026-09-07 11:23:45 +08:00
ks3.go fix(storage): keep the SSRF redirect policy on the KS3 client (#3440) 2026-09-20 11:12:52 +08:00
ks3_path_test.go fix(security): close the low-severity shared-space findings (#3416) 2026-09-18 22:58:46 +08:00
ks3_redirect_test.go fix(storage): keep the SSRF redirect policy on the KS3 client (#3440) 2026-09-20 11:12:52 +08:00
local.go fix(storage): strip storage-backend scope in local provider path normalization (#2979) 2026-09-21 14:21:25 +08:00
local_copy_test.go fix: deep-copy stored files and images when cloning a knowledge base 2026-06-03 14:45:59 +08:00
local_test.go fix(storage): strip storage-backend scope in local provider path normalization (#2979) 2026-09-21 14:21:25 +08:00
minio.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
object_storage_http.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
object_storage_http_test.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
obs.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
obs_test.go fix(storage): use virtual-hosted addressing for OBS bucket requests (#3273) 2026-09-15 18:18:40 +08:00
oss.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
oss_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
resolve_tenant.go refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
resource_catalog.go feat(agent): preview skill artifacts and verify installs without running them (#2823) 2026-08-27 10:30:32 +08:00
resource_catalog_test.go feat(agent): preview skill artifacts and verify installs without running them (#2823) 2026-08-27 10:30:32 +08:00
s3.go fix(storage): let object storage transfers outlive 30 seconds (#3368) 2026-09-19 21:30:55 +08:00
s3_test.go fix(s3): disable optional checksums for compatible endpoints 2026-08-31 12:25:33 +08:00
tos.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00