Pass in API key to manifest file download requests
@@ -2131,8 +2131,11 @@ class Artifact(object):
def _load_manifest(self):
if self._manifest is None:
index_file_url = self._attrs['currentManifest']['file']['url']
- with requests.get(index_file_url) as req:
- self._manifest = artifacts.ArtifactManifest.from_manifest_json(self, json.loads(req.content))
+ with requests.get(index_file_url, auth=("api", Api().api_key)) as req:
+ json_resp = json.loads(req.content)
+ if "error" in json_resp:
+ raise ValueError("Failed to download manifest file: {}".format(json_resp["error"]))
+ self._manifest = artifacts.ArtifactManifest.from_manifest_json(self, json_resp)
return self._manifest
