polyswarm-api 3.5.1__tar.gz → 3.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polyswarm-api-3.5.1/src/polyswarm_api.egg-info → polyswarm-api-3.6.0}/PKG-INFO +1 -1
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/setup.py +1 -1
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/__init__.py +1 -1
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/api.py +16 -2
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/resources.py +4 -1
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0/src/polyswarm_api.egg-info}/PKG-INFO +1 -1
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/LICENSE +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/MANIFEST.in +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/README.md +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/requirements.txt +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/setup.cfg +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/core.py +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/exceptions.py +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api/settings.py +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api.egg-info/SOURCES.txt +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api.egg-info/dependency_links.txt +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api.egg-info/requires.txt +0 -0
- {polyswarm-api-3.5.1 → polyswarm-api-3.6.0}/src/polyswarm_api.egg-info/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@ with open('README.md', 'r') as readme:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name='polyswarm-api',
|
|
12
|
-
version='3.
|
|
12
|
+
version='3.6.0',
|
|
13
13
|
description='Client library to simplify interacting with the PolySwarm consumer API',
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type='text/markdown',
|
|
@@ -245,7 +245,7 @@ class PolyswarmAPI(object):
|
|
|
245
245
|
scan_config=scan_config,
|
|
246
246
|
community=self.community).result()
|
|
247
247
|
instance.upload_file(artifact)
|
|
248
|
-
return resources.ArtifactInstance.update(self, id=instance.id).result()
|
|
248
|
+
return resources.ArtifactInstance.update(self, id=instance.id, community=self.community).result()
|
|
249
249
|
else:
|
|
250
250
|
raise exceptions.InvalidValueException('Artifacts should be a path to a file or a LocalArtifact instance')
|
|
251
251
|
|
|
@@ -716,11 +716,25 @@ class PolyswarmAPI(object):
|
|
|
716
716
|
vm_slug=vm_slug,
|
|
717
717
|
network_enabled=network_enabled).result()
|
|
718
718
|
task.upload_file(artifact)
|
|
719
|
-
return resources.SandboxTask.update_file(self, id=task.id).result()
|
|
719
|
+
return resources.SandboxTask.update_file(self, id=task.id, community=self.community).result()
|
|
720
720
|
else:
|
|
721
721
|
raise exceptions.InvalidValueException(
|
|
722
722
|
'Artifacts should be a path to a file or a LocalArtifact instance')
|
|
723
723
|
|
|
724
|
+
def sandbox_url(self, url, provider_slug, vm_slug, browser=None):
|
|
725
|
+
logger.info('Sandboxing url in provider %s vm %s', provider_slug, vm_slug)
|
|
726
|
+
artifact = resources.LocalArtifact.from_content(self, url, artifact_name=url, artifact_type='URL')
|
|
727
|
+
task = resources.SandboxTask.create_file(self,
|
|
728
|
+
artifact_name=url,
|
|
729
|
+
artifact_type="URL",
|
|
730
|
+
community=self.community,
|
|
731
|
+
provider_slug=provider_slug,
|
|
732
|
+
vm_slug=vm_slug,
|
|
733
|
+
browser=browser,
|
|
734
|
+
network_enabled=True).result()
|
|
735
|
+
task.upload_file(artifact)
|
|
736
|
+
return resources.SandboxTask.update_file(self, id=task.id, community=self.community).result()
|
|
737
|
+
|
|
724
738
|
def sandbox_providers(self):
|
|
725
739
|
"""
|
|
726
740
|
List sandboxes available in polyswarm.
|
|
@@ -307,7 +307,10 @@ class ArtifactInstance(core.BaseJsonResource, core.Hashable):
|
|
|
307
307
|
self.votes = [Vote(v, api=api, scanfile=self) for v in content.get('votes', [])]
|
|
308
308
|
self.window_closed = content.get('window_closed')
|
|
309
309
|
self.polyscore = float(content['polyscore']) if content.get('polyscore') is not None else None
|
|
310
|
-
|
|
310
|
+
if content.get('permalink'):
|
|
311
|
+
self.permalink = content.get('permalink')
|
|
312
|
+
else:
|
|
313
|
+
self.permalink = settings.DEFAULT_PERMALINK_BASE + '/' + str(self.hash) + '/' + str(self.id)
|
|
311
314
|
|
|
312
315
|
self._malicious_assertions = None
|
|
313
316
|
self._benign_assertions = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|