mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 23:10:32 +00:00
fix: proxy dedup, multi-registry GC, TOCTOU and credential hygiene (#83)
- Deduplicate proxy_fetch/proxy_fetch_text into generic proxy_fetch_core with response extractor closure (removes ~50 lines of copy-paste) - GC now scans all registry prefixes, not just docker/ - Add tracing::warn to fire-and-forget cache writes in docker proxy - Mark S3 credentials as skip_serializing to prevent accidental leaks - Remove TOCTOU race in LocalStorage get/delete (redundant exists check)
This commit is contained in:
@@ -284,7 +284,9 @@ async fn download_blob(
|
||||
let key_clone = key.clone();
|
||||
let data_clone = data.clone();
|
||||
tokio::spawn(async move {
|
||||
let _ = storage.put(&key_clone, &data_clone).await;
|
||||
if let Err(e) = storage.put(&key_clone, &data_clone).await {
|
||||
tracing::warn!(key = %key_clone, error = %e, "Failed to cache blob in storage");
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -687,7 +689,9 @@ async fn get_manifest(
|
||||
let key_clone = key.clone();
|
||||
let data_clone = data.clone();
|
||||
tokio::spawn(async move {
|
||||
let _ = storage.put(&key_clone, &data_clone).await;
|
||||
if let Err(e) = storage.put(&key_clone, &data_clone).await {
|
||||
tracing::warn!(key = %key_clone, error = %e, "Failed to cache blob in storage");
|
||||
}
|
||||
});
|
||||
|
||||
state.repo_index.invalidate("docker");
|
||||
|
||||
Reference in New Issue
Block a user