MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _fetch_manifest

Function _fetch_manifest

apps/plugins/api_views.py:800–816  ·  view source on GitHub ↗

Fetch a remote manifest JSON, validate structure, return (data, verified).

(url, public_key_text=None)

Source from the content-addressed store, hash-verified

798
799
800def _fetch_manifest(url, public_key_text=None):
801 """Fetch a remote manifest JSON, validate structure, return (data, verified)."""
802 _validate_fetch_url(url)
803 with http_requests.get(url, timeout=MANIFEST_FETCH_TIMEOUT, stream=True) as resp:
804 resp.raise_for_status()
805 body = b"".join(resp.iter_content(8192))
806 data = json.loads(body)
807 # Accept both top-level {manifest: {plugins: [...]}} and {plugins: [...]}
808 if "manifest" in data and "plugins" in data["manifest"]:
809 signature = data.get("signature")
810 verified = _verify_manifest_signature(
811 data["manifest"], signature, public_key_text
812 )
813 return data, verified
814 if "plugins" in data:
815 return {"manifest": data}, None
816 raise ValueError("Manifest JSON missing 'manifest.plugins' list")
817
818
819class PluginRepoListCreateAPIView(PluginAuthMixin, APIView):

Callers 4

refresh_plugin_reposFunction · 0.85
postMethod · 0.85
postMethod · 0.85
postMethod · 0.85

Calls 3

_validate_fetch_urlFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected