From 7ee77a9e1002cc3c9e448361efe11a623bfd4fb9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 13:21:05 +0900 Subject: feat(vcs): use Composer-compatible URL-sanitize cache keys Previously each VCS mirror was keyed by sha1(url), which made cache directories opaque and incompatible with Composer's layout. Composer's GitDriver and GitDownloader both use the form Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize(\$url)), so a Mozart user migrating from Composer (or vice versa) could not share an existing cache. Reimplement GitUtil::sanitize_url to follow that pattern: redact credentials and access tokens (Url::sanitize semantics, including the GitHub token regex), then replace every byte outside [a-zA-Z0-9.] with '-'. The credential redaction also collapses URLs that differ only in their access_token to the same key. --- crates/mozart-vcs/Cargo.toml | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/mozart-vcs/Cargo.toml') diff --git a/crates/mozart-vcs/Cargo.toml b/crates/mozart-vcs/Cargo.toml index 18eff25..92b3e24 100644 --- a/crates/mozart-vcs/Cargo.toml +++ b/crates/mozart-vcs/Cargo.toml @@ -13,7 +13,6 @@ regex.workspace = true reqwest.workspace = true serde.workspace = true serde_json.workspace = true -sha1.workspace = true tokio.workspace = true tracing.workspace = true url.workspace = true -- cgit v1.3.1