DELETE /artifacts/{digest}: superuser only, 409 while referenced

The keep-set the hourly sweep uses is now referenced_artifacts, shared by
the sweep and the route. The volatile ring is not touched.
This commit is contained in:
2026-10-15 10:48:59 +02:00
parent 599e01b0bf
commit 7ea53ccf17
7 changed files with 144 additions and 15 deletions
+13
View File
@@ -160,6 +160,19 @@ class ArtifactStore:
self.put_file(source)
return True
def delete(self, digest: str) -> bool:
"""Remove one artifact's bytes. Returns whether this store had them.
The ring is not looked in: its frames fall out on their own.
"""
if not valid_digest(digest):
return False
try:
self._path(digest).unlink()
except FileNotFoundError:
return False
return True
def read(self, digest: str) -> Iterator[bytes]:
target = self.path(digest)
if target is None: