Skip to content

Commit 0e13b66

Browse files
authored
Merge pull request #272 from polyswarm/develop
base64 and 7zip support
2 parents cb39ace + 3c2b0e5 commit 0e13b66

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ dev-pypi:
2727
stage: build
2828
before_script:
2929
- pip3 install -q --upgrade pip build twine bump-my-version
30+
- pip install -q $END_TO_END_LIB@$CI_COMMIT_REF_NAME || pip install -q $END_TO_END_LIB
31+
- e2e init
3032
script:
3133
- bump-my-version bump --no-commit --no-tag dev
3234
- python -m build
33-
- twine upload --skip-existing --disable-progress-bar --non-interactive dist/*
35+
- e2e release --dev --skip-tag
3436

3537
###############################################################
3638
# Test Stage

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "polyswarm_api"
7-
version = "3.14.0"
7+
version = "3.14.1"
88
description = "Client library to simplify interacting with the PolySwarm consumer API"
99
readme = "README.md"
1010
requires-python = ">=3.10,<4"
@@ -42,7 +42,7 @@ package-dir = { "" = "src" }
4242
where = ["src"]
4343

4444
[tool.bumpversion]
45-
current_version = "3.14.0"
45+
current_version = "3.14.1"
4646
commit = true
4747
tag = false
4848
sign_tags = true

src/polyswarm_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# https://www.python.org/dev/peps/pep-0008/#module-level-dunder-names
2-
__version__ = '3.14.0'
2+
__version__ = '3.14.1'
33
__release_url__ = 'https://api.github.com/repos/polyswarm/polyswarm-api/releases/latest'
44

55
from . import api

src/polyswarm_api/api.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,14 @@ def submit(
229229
:param scan_config: The scan configuration to be used, e.g.: "default", "more-time", "most-time"
230230
:param preprocessing: Preprocessing settings to be applied to the artifact, None means no preprocessing,
231231
otherwise a dict with the following attributes can be passed:
232-
- type (string): either "zip" or "qrcode", the first mean the file is a zip that
233-
the server has to decompress to then scan the content (only one file inside allowed).
234-
"qrcode" means the file is a QR Code image with a URL as payload, and you want
235-
to scan the URL, not the actual file (artifact_type has to be "URL").
236-
- password (string, optional): will use this password to decompress the zip file.
232+
- type (string): either "zip", "base64", "7zip", or "qrcode". "zip" means the file is a
233+
zip that the server has to decompress to then scan the content (only one file inside
234+
allowed). "base64" means the file content is base64-encoded and the server has to
235+
decode it before scanning. "7zip" means the file is a 7zip archive that the server
236+
has to decompress to then scan the content (only one file inside allowed). "qrcode"
237+
means the file is a QR Code image with a URL as payload, and you want to scan the URL,
238+
not the actual file (artifact_type has to be "URL").
239+
- password (string, optional): will use this password to decompress the zip or 7zip file.
237240
:return: An ArtifactInstance resource
238241
"""
239242
logger.info('Submitting artifact of type %s', artifact_type)
@@ -757,10 +760,11 @@ def sandbox_file(
757760
the list of VMs available.
758761
:param preprocessing: Preprocessing settings to be applied to the artifact, None means no preprocessing,
759762
otherwise a dict with the following attributes can be passed:
760-
- type (string): either "zip" or "qrcode", the first means the file is a zip that
763+
- type (string): either "zip", "base64", or "qrcode". "zip" means the file is a zip that
761764
the server has to decompress to then scan the content (only one file inside allowed).
762-
"qrcode" means the file is a QR Code image with a URL as payload, and you want
763-
to scan the URL, not the actual file (artifact_type has to be "URL").
765+
"base64" means the file content is base64-encoded and the server has to decode it
766+
before scanning. "qrcode" means the file is a QR Code image with a URL as payload,
767+
and you want to scan the URL, not the actual file (artifact_type has to be "URL").
764768
- password (string, optional): will use this password to decompress the zip file.
765769
:param arguments: The arguments to be passed to the sample being sandboxed, e.g. '--some-param="<PARAM VAL>"'
766770
:return: An ArtifactInstance resource

0 commit comments

Comments
 (0)