INNER CODE UNIT · Python
validate_catalog
RockxyApp/Rockxy · releases/validate_metadata.py:232
def validate_catalog(path: Path) -> dict[str, Any]:
catalog = load_json(path)
ensure_public_safe(path, catalog)
for key in ("schema_version", "product", "channel", "catalog_url"):
if catalog.get(key) in ("", None):
fail(f"{path} missing required top-level field: {key}")
if catalog.get("product") != "Rockxy":
fail(f"{path} product must be Rockxy")
if not str(catalog.get("catalog_url", "")).startswith(
"https://raw.githubusercontent.com/RockxyApp/Rockxy/main/releases/catalog.json"
):
fail(f"{path} catalog_url must point at the public Rockxy catalog")
releases = catalog.get("releases")
if not isinstance(releases, list) or not releases:
fail(f"{path} must contain a non-empty releases array")
if len(releases) < 2:
fail(f"{path} must keep older signed releases discoverable")