perf(delivery): reuse proofs within installer operations

This commit is contained in:
2026-10-20 17:55:12 +08:00
parent ebe71db564
commit 9ea709af92
3 changed files with 44 additions and 1 deletions
+4 -1
View File
@@ -9,7 +9,7 @@ import stat
import subprocess
from pathlib import Path
from . import configuration, install, preflight, service_install, services
from . import configuration, install, manifest, preflight, service_install, services
from .policy import DeliveryError, canonical, digest, fields, read_json, sha256
UNIT = "kf-sandbox-factory.service"
@@ -167,6 +167,7 @@ def generate(output: Path) -> dict:
payload = install.RELEASES / selected["release_id"] / "payload"
for name in (
"factory_service.py",
"manifest.py",
"services.py",
"service_profiles.py",
"layout.py",
@@ -199,6 +200,7 @@ def generate(output: Path) -> dict:
return result
@manifest.verified_operation
def install_unit(source: Path, expected: str) -> dict:
if os.getuid() != 0 or os.geteuid() != 0:
raise DeliveryError("factory unit installation requires root operator")
@@ -219,6 +221,7 @@ def install_unit(source: Path, expected: str) -> dict:
payload = install.RELEASES / selected["release_id"] / "payload"
for name in (
"factory_service.py",
"manifest.py",
"services.py",
"service_profiles.py",
"layout.py",
+3
View File
@@ -15,6 +15,7 @@ from . import (
configuration,
install,
journal,
manifest,
preflight,
proxy_runtime,
proxy_service,
@@ -308,6 +309,7 @@ def temporary_directories() -> None:
os.chown(temporary_directory, proxy_service.UID, proxy_service.UID)
@manifest.verified_operation
def install_proxy(source: Path, expected: str, certificate: Path, key: Path) -> dict:
if os.getuid() != 0 or os.geteuid() != 0 or os.getgid() != 0:
raise DeliveryError("root proxy installer required")
@@ -325,6 +327,7 @@ def install_proxy(source: Path, expected: str, certificate: Path, key: Path) ->
"proxy.py",
"proxy_service.py",
"proxy_install.py",
"manifest.py",
"proxy_guard.py",
"proxy_runtime.py",
):