Add registry-backed module package releases
This commit is contained in:
@@ -167,6 +167,7 @@ def validate_manifest(
|
||||
"composition",
|
||||
"signatures",
|
||||
},
|
||||
optional={"package_lock"},
|
||||
label="distribution manifest",
|
||||
)
|
||||
if payload.get("schema_version") != "1":
|
||||
@@ -200,6 +201,12 @@ def validate_manifest(
|
||||
_https_url(deployer.get("url"), "deployer.url")
|
||||
_sha256(deployer.get("sha256"), "deployer.sha256")
|
||||
|
||||
if "package_lock" in payload:
|
||||
package_lock = _object(payload.get("package_lock"), "package_lock")
|
||||
_exact_keys(package_lock, required={"url", "sha256"}, label="package_lock")
|
||||
_https_url(package_lock.get("url"), "package_lock.url")
|
||||
_sha256(package_lock.get("sha256"), "package_lock.sha256")
|
||||
|
||||
images = _object(payload.get("images"), "images")
|
||||
if set(images) != {"api", "web"}:
|
||||
raise DistributionError("images must contain exactly api and web")
|
||||
@@ -630,10 +637,12 @@ def _exact_keys(
|
||||
value: Mapping[str, Any],
|
||||
*,
|
||||
required: set[str],
|
||||
optional: set[str] | None = None,
|
||||
label: str,
|
||||
) -> None:
|
||||
optional = optional or set()
|
||||
missing = sorted(required - set(value))
|
||||
extra = sorted(set(value) - required)
|
||||
extra = sorted(set(value) - required - optional)
|
||||
if missing or extra:
|
||||
detail = []
|
||||
if missing:
|
||||
|
||||
Reference in New Issue
Block a user