assemblyline-v4-service 4.4.1.dev296__py3-none-any.whl → 4.4.1.dev299__py3-none-any.whl
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.
Potentially problematic release.
This version of assemblyline-v4-service might be problematic. Click here for more details.
- assemblyline_v4_service/VERSION +1 -1
- assemblyline_v4_service/common/api.py +15 -15
- assemblyline_v4_service/common/request.py +19 -13
- assemblyline_v4_service/common/task.py +30 -9
- {assemblyline_v4_service-4.4.1.dev296.dist-info → assemblyline_v4_service-4.4.1.dev299.dist-info}/METADATA +1 -1
- {assemblyline_v4_service-4.4.1.dev296.dist-info → assemblyline_v4_service-4.4.1.dev299.dist-info}/RECORD +13 -13
- test/test_common/test_request.py +3 -3
- test/test_common/test_task.py +6 -2
- test/test_healthz.py +1 -6
- test/test_run_service.py +0 -2
- {assemblyline_v4_service-4.4.1.dev296.dist-info → assemblyline_v4_service-4.4.1.dev299.dist-info}/LICENCE.md +0 -0
- {assemblyline_v4_service-4.4.1.dev296.dist-info → assemblyline_v4_service-4.4.1.dev299.dist-info}/WHEEL +0 -0
- {assemblyline_v4_service-4.4.1.dev296.dist-info → assemblyline_v4_service-4.4.1.dev299.dist-info}/top_level.txt +0 -0
assemblyline_v4_service/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.4.1.
|
|
1
|
+
4.4.1.dev299
|
|
@@ -32,11 +32,11 @@ class ServiceAPI:
|
|
|
32
32
|
if self.service_api_host.startswith('https'):
|
|
33
33
|
self.session.verify = os.environ.get('SERVICE_SERVER_ROOT_CA_PATH', '/etc/assemblyline/ssl/al_root-ca.crt')
|
|
34
34
|
|
|
35
|
-
def _with_retries(self, func, url):
|
|
35
|
+
def _with_retries(self, func, url, **kwargs):
|
|
36
36
|
retries = 0
|
|
37
37
|
while True:
|
|
38
38
|
try:
|
|
39
|
-
resp = func(url)
|
|
39
|
+
resp = func(url, **kwargs)
|
|
40
40
|
if resp.ok:
|
|
41
41
|
return resp.json()['api_response']
|
|
42
42
|
else:
|
|
@@ -60,17 +60,17 @@ class ServiceAPI:
|
|
|
60
60
|
time.sleep(min(2, 2 ** (retries - 7)))
|
|
61
61
|
|
|
62
62
|
def lookup_badlist_tags(self, tag_map: dict):
|
|
63
|
-
if DEVELOPMENT_MODE:
|
|
63
|
+
if DEVELOPMENT_MODE or not tag_map:
|
|
64
64
|
return []
|
|
65
65
|
|
|
66
66
|
if not isinstance(tag_map, dict) and not all([isinstance(x, list) for x in tag_map.values()]):
|
|
67
67
|
raise ValueError("Parameter tag_list should be a dictionary tag_type mapping to a list of tag_values.")
|
|
68
68
|
url = f"{self.service_api_host}/api/v1/badlist/tags/"
|
|
69
69
|
|
|
70
|
-
return self._with_retries(self.session.post, url,
|
|
70
|
+
return self._with_retries(self.session.post, url, json=tag_map)
|
|
71
71
|
|
|
72
72
|
def lookup_badlist(self, qhash):
|
|
73
|
-
if DEVELOPMENT_MODE:
|
|
73
|
+
if DEVELOPMENT_MODE or qhash is None:
|
|
74
74
|
return None
|
|
75
75
|
try:
|
|
76
76
|
return self._with_retries(self.session.get, f"{self.service_api_host}/api/v1/badlist/{qhash}/")
|
|
@@ -81,26 +81,26 @@ class ServiceAPI:
|
|
|
81
81
|
raise
|
|
82
82
|
|
|
83
83
|
def lookup_badlist_ssdeep(self, ssdeep):
|
|
84
|
-
if DEVELOPMENT_MODE:
|
|
84
|
+
if DEVELOPMENT_MODE or ssdeep is None:
|
|
85
85
|
return []
|
|
86
86
|
try:
|
|
87
87
|
data = {"ssdeep": ssdeep}
|
|
88
|
-
return self._with_retries(self.session.post, f"{self.service_api_host}/api/v1/badlist/ssdeep/",
|
|
88
|
+
return self._with_retries(self.session.post, f"{self.service_api_host}/api/v1/badlist/ssdeep/", json=data)
|
|
89
89
|
except ServiceAPIError as e:
|
|
90
90
|
if e.status_code == 404:
|
|
91
|
-
return
|
|
91
|
+
return []
|
|
92
92
|
else:
|
|
93
93
|
raise
|
|
94
94
|
|
|
95
95
|
def lookup_badlist_tlsh(self, tlsh):
|
|
96
|
-
if DEVELOPMENT_MODE:
|
|
96
|
+
if DEVELOPMENT_MODE or tlsh is None:
|
|
97
97
|
return []
|
|
98
98
|
try:
|
|
99
99
|
data = {"tlsh": tlsh}
|
|
100
|
-
return self._with_retries(self.session.post, f"{self.service_api_host}/api/v1/badlist/tlsh/",
|
|
100
|
+
return self._with_retries(self.session.post, f"{self.service_api_host}/api/v1/badlist/tlsh/", json=data)
|
|
101
101
|
except ServiceAPIError as e:
|
|
102
102
|
if e.status_code == 404:
|
|
103
|
-
return
|
|
103
|
+
return []
|
|
104
104
|
else:
|
|
105
105
|
raise
|
|
106
106
|
|
|
@@ -136,7 +136,7 @@ class PrivilegedServiceAPI:
|
|
|
136
136
|
self.safelist_client = SafelistClient()
|
|
137
137
|
|
|
138
138
|
def lookup_badlist_tags(self, tag_map):
|
|
139
|
-
if DEVELOPMENT_MODE:
|
|
139
|
+
if DEVELOPMENT_MODE or not tag_map:
|
|
140
140
|
return []
|
|
141
141
|
|
|
142
142
|
if not isinstance(tag_map, dict) and not all([isinstance(x, list) for x in tag_map.values()]):
|
|
@@ -145,17 +145,17 @@ class PrivilegedServiceAPI:
|
|
|
145
145
|
return self.badlist_client.exists_tags(tag_map)
|
|
146
146
|
|
|
147
147
|
def lookup_badlist(self, qhash):
|
|
148
|
-
if DEVELOPMENT_MODE:
|
|
148
|
+
if DEVELOPMENT_MODE or qhash is None:
|
|
149
149
|
return None
|
|
150
150
|
return self.badlist_client.exists(qhash)
|
|
151
151
|
|
|
152
152
|
def lookup_badlist_ssdeep(self, ssdeep):
|
|
153
|
-
if DEVELOPMENT_MODE:
|
|
153
|
+
if DEVELOPMENT_MODE or ssdeep is None:
|
|
154
154
|
return []
|
|
155
155
|
return self.badlist_client.find_similar_ssdeep(ssdeep)
|
|
156
156
|
|
|
157
157
|
def lookup_badlist_tlsh(self, tlsh):
|
|
158
|
-
if DEVELOPMENT_MODE:
|
|
158
|
+
if DEVELOPMENT_MODE or tlsh is None:
|
|
159
159
|
return []
|
|
160
160
|
return self.badlist_client.find_similar_tlsh(tlsh)
|
|
161
161
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import hashlib
|
|
2
|
+
import logging
|
|
3
3
|
import tempfile
|
|
4
4
|
from typing import Any, Dict, List, Optional, TextIO, Union
|
|
5
5
|
|
|
6
|
-
from assemblyline.common import forge
|
|
7
|
-
from assemblyline.common import log as al_log
|
|
8
|
-
from assemblyline.common.file import make_uri_file
|
|
9
|
-
from assemblyline.common.classification import Classification
|
|
10
|
-
from PIL import Image
|
|
11
|
-
|
|
12
6
|
from assemblyline_v4_service.common.api import PrivilegedServiceAPI, ServiceAPI
|
|
13
7
|
from assemblyline_v4_service.common.ocr import ocr_detections
|
|
14
8
|
from assemblyline_v4_service.common.result import Heuristic, Result, ResultKeyValueSection
|
|
15
|
-
from assemblyline_v4_service.common.task import MaxExtractedExceeded, Task
|
|
9
|
+
from assemblyline_v4_service.common.task import PARENT_RELATION, MaxExtractedExceeded, Task
|
|
16
10
|
from assemblyline_v4_service.common.utils import extract_passwords
|
|
11
|
+
from PIL import Image
|
|
12
|
+
|
|
13
|
+
from assemblyline.common import forge
|
|
14
|
+
from assemblyline.common import log as al_log
|
|
15
|
+
from assemblyline.common.classification import Classification
|
|
16
|
+
from assemblyline.common.file import make_uri_file
|
|
17
17
|
|
|
18
18
|
CLASSIFICATION = forge.get_classification()
|
|
19
19
|
WEBP_MAX_SIZE = 16383
|
|
@@ -32,7 +32,7 @@ class ServiceRequest:
|
|
|
32
32
|
def add_extracted(self, path: str, name: str, description: str,
|
|
33
33
|
classification: Optional[Classification] = None,
|
|
34
34
|
safelist_interface: Optional[Union[ServiceAPI, PrivilegedServiceAPI]] = None,
|
|
35
|
-
allow_dynamic_recursion: bool = False, parent_relation: str =
|
|
35
|
+
allow_dynamic_recursion: bool = False, parent_relation: str = PARENT_RELATION.EXTRACTED) -> bool:
|
|
36
36
|
"""
|
|
37
37
|
Add an extracted file for additional processing.
|
|
38
38
|
|
|
@@ -56,7 +56,7 @@ class ServiceRequest:
|
|
|
56
56
|
|
|
57
57
|
def add_extracted_uri(self, description: str, uri: str, params=None,
|
|
58
58
|
classification: Optional[Classification] = None, allow_dynamic_recursion: bool = False,
|
|
59
|
-
parent_relation: str =
|
|
59
|
+
parent_relation: str = PARENT_RELATION.EXTRACTED) -> bool:
|
|
60
60
|
if params:
|
|
61
61
|
self.set_uri_metadata(uri, params)
|
|
62
62
|
filepath = make_uri_file(self._working_directory, uri, params)
|
|
@@ -144,8 +144,11 @@ class ServiceRequest:
|
|
|
144
144
|
|
|
145
145
|
return data
|
|
146
146
|
|
|
147
|
-
def add_supplementary(
|
|
148
|
-
|
|
147
|
+
def add_supplementary(
|
|
148
|
+
self, path: str, name: str, description: str,
|
|
149
|
+
classification: Optional[Classification] = None,
|
|
150
|
+
parent_relation: str = PARENT_RELATION.INFORMATION
|
|
151
|
+
) -> bool:
|
|
149
152
|
"""
|
|
150
153
|
Add a supplementary file.
|
|
151
154
|
|
|
@@ -153,10 +156,13 @@ class ServiceRequest:
|
|
|
153
156
|
:param name: Display name of the supplementary file
|
|
154
157
|
:param description: Descriptive text about the supplementary file
|
|
155
158
|
:param classification: Classification of the supplementary file (default: service classification)
|
|
159
|
+
:param parent_relation: File relation to parent, if any.
|
|
156
160
|
:return: None
|
|
157
161
|
"""
|
|
158
162
|
|
|
159
|
-
return self.task.add_supplementary(
|
|
163
|
+
return self.task.add_supplementary(
|
|
164
|
+
path, name, description, classification, parent_relation=parent_relation
|
|
165
|
+
)
|
|
160
166
|
|
|
161
167
|
def drop(self) -> None:
|
|
162
168
|
"""
|
|
@@ -4,15 +4,26 @@ import os
|
|
|
4
4
|
import tempfile
|
|
5
5
|
from typing import Any, Dict, List, Optional, Union
|
|
6
6
|
|
|
7
|
+
from assemblyline_v4_service.common.api import PrivilegedServiceAPI, ServiceAPI
|
|
8
|
+
from assemblyline_v4_service.common.helper import get_service_manifest
|
|
9
|
+
from assemblyline_v4_service.common.result import Result
|
|
10
|
+
|
|
7
11
|
from assemblyline.common import forge
|
|
8
12
|
from assemblyline.common import log as al_log
|
|
9
13
|
from assemblyline.common.classification import Classification
|
|
10
14
|
from assemblyline.common.digests import get_digests_for_file, get_sha256_for_file
|
|
11
15
|
from assemblyline.common.isotime import now_as_iso
|
|
16
|
+
from assemblyline.common.str_utils import StringTable
|
|
12
17
|
from assemblyline.odm.messages.task import Task as ServiceTask
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
|
|
19
|
+
PARENT_RELATION = StringTable('PARENT_RELATION', [
|
|
20
|
+
('ROOT', 0),
|
|
21
|
+
('EXTRACTED', 1),
|
|
22
|
+
('INFORMATION', 2),
|
|
23
|
+
('DYNAMIC', 3),
|
|
24
|
+
('MEMDUMP', 4),
|
|
25
|
+
('DOWNLOADED', 5),
|
|
26
|
+
])
|
|
16
27
|
|
|
17
28
|
|
|
18
29
|
class MaxExtractedExceeded(Exception):
|
|
@@ -78,13 +89,18 @@ class Task:
|
|
|
78
89
|
classification: Optional[Classification] = None,
|
|
79
90
|
is_section_image: bool = False,
|
|
80
91
|
allow_dynamic_recursion: bool = False,
|
|
81
|
-
parent_relation: str =
|
|
92
|
+
parent_relation: str = PARENT_RELATION.EXTRACTED) -> Optional[Dict[str, str]]:
|
|
82
93
|
# Reject empty files
|
|
83
94
|
if os.path.getsize(path) == 0:
|
|
84
95
|
self.log.info(f"Adding empty extracted or supplementary files is not allowed. "
|
|
85
96
|
f"Empty file ({name}) was ignored.")
|
|
86
97
|
return
|
|
87
98
|
|
|
99
|
+
if parent_relation not in PARENT_RELATION.keys():
|
|
100
|
+
raise ValueError(
|
|
101
|
+
f"An invalid 'parent_relation' was provided: '{parent_relation}'. Possible values are: '{PARENT_RELATION.keys()}'"
|
|
102
|
+
)
|
|
103
|
+
|
|
88
104
|
# If file classification not provided, then use the default result classification
|
|
89
105
|
if not classification:
|
|
90
106
|
classification = self.service_default_result_classification
|
|
@@ -105,7 +121,7 @@ class Task:
|
|
|
105
121
|
def add_extracted(self, path: str, name: str, description: str,
|
|
106
122
|
classification: Optional[Classification] = None,
|
|
107
123
|
safelist_interface: Optional[Union[ServiceAPI, PrivilegedServiceAPI]] = None,
|
|
108
|
-
allow_dynamic_recursion: bool = False, parent_relation: str =
|
|
124
|
+
allow_dynamic_recursion: bool = False, parent_relation: str = PARENT_RELATION.EXTRACTED) -> bool:
|
|
109
125
|
|
|
110
126
|
# Service-based safelisting of files has to be configured at the global configuration
|
|
111
127
|
# Allows the administrator to be selective about the types of hashes to lookup in the safelist
|
|
@@ -142,9 +158,12 @@ class Task:
|
|
|
142
158
|
self.extracted.append(file)
|
|
143
159
|
return True
|
|
144
160
|
|
|
145
|
-
def add_supplementary(
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
def add_supplementary(
|
|
162
|
+
self, path: str, name: str, description: str,
|
|
163
|
+
classification: Optional[Classification] = None,
|
|
164
|
+
is_section_image: bool = False,
|
|
165
|
+
parent_relation: str = PARENT_RELATION.INFORMATION
|
|
166
|
+
) -> Optional[dict]:
|
|
148
167
|
if not path:
|
|
149
168
|
raise ValueError("Path cannot be empty")
|
|
150
169
|
|
|
@@ -154,7 +173,9 @@ class Task:
|
|
|
154
173
|
if not description:
|
|
155
174
|
raise ValueError("Description cannot be empty")
|
|
156
175
|
|
|
157
|
-
file = self._add_file(
|
|
176
|
+
file = self._add_file(
|
|
177
|
+
path, name, description, classification, is_section_image, parent_relation=parent_relation
|
|
178
|
+
)
|
|
158
179
|
|
|
159
180
|
if not file:
|
|
160
181
|
return None
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
assemblyline_v4_service/VERSION,sha256=
|
|
1
|
+
assemblyline_v4_service/VERSION,sha256=3bOsB5czUFhct5ojTZCT36XAMaeukmjFJMwYSQarekE,13
|
|
2
2
|
assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
assemblyline_v4_service/healthz.py,sha256=sS1cFkDLw8hUPMpj7tbHXFv8ZmHcazrwZ0l6oQDwwkQ,1575
|
|
4
4
|
assemblyline_v4_service/run_privileged_service.py,sha256=9uTfHetXR5G-EDKMDrgfWUOw34yr64-cj6Cm9eZaCbQ,14547
|
|
5
5
|
assemblyline_v4_service/run_service.py,sha256=RCqxdm-OAwJhl15BnKFkuavpQ5k6eTX3ZGeSna5JJBw,5557
|
|
6
6
|
assemblyline_v4_service/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
assemblyline_v4_service/common/api.py,sha256=
|
|
7
|
+
assemblyline_v4_service/common/api.py,sha256=n76hLmuAZ8E8K0U_uLe7eKXHzaHUu0shaeOVBZ-XNuY,6686
|
|
8
8
|
assemblyline_v4_service/common/base.py,sha256=9xufnspN99J1EHTru1fdkflRwB6PGdfyCUDvYwUIBEk,13610
|
|
9
9
|
assemblyline_v4_service/common/helper.py,sha256=xs9quuf-M1JOdKieBqOmWaOece0CtzXFhhe85xQYmuY,3289
|
|
10
10
|
assemblyline_v4_service/common/ocr.py,sha256=erKJMioiOL53i7qiEq9zve4-FnwW22twILboX19M5eQ,4555
|
|
11
11
|
assemblyline_v4_service/common/ontology_helper.py,sha256=QpwerYoS5hXjWzpx3Pmwv6j2330PQVYqxYGamjcpW3I,7890
|
|
12
|
-
assemblyline_v4_service/common/request.py,sha256=
|
|
12
|
+
assemblyline_v4_service/common/request.py,sha256=NxtWxp8-ttC72i3Vnchc3fZTRKqPQAoMC4KAVwEj8-4,11714
|
|
13
13
|
assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFSiGjp57fXW2E,32713
|
|
14
|
-
assemblyline_v4_service/common/task.py,sha256=
|
|
14
|
+
assemblyline_v4_service/common/task.py,sha256=7yNvXk5B27QookJNp4-Y1iGhV8LfhLDaYWzF-uFGWgo,13576
|
|
15
15
|
assemblyline_v4_service/common/utils.py,sha256=k2__d-V5LjB6o2IKbjVe7tJWKcKuUHto5TyT5oKhIa0,3890
|
|
16
16
|
assemblyline_v4_service/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
assemblyline_v4_service/dev/run_service_once.py,sha256=4K3ljw0MnfPGw0-6lzc_vtUYg1EbntJbbsWvNU-ZM_A,10456
|
|
@@ -23,21 +23,21 @@ assemblyline_v4_service/updater/gunicorn_config.py,sha256=p3j2KPBeD5jvMw9O5i7vAt
|
|
|
23
23
|
assemblyline_v4_service/updater/helper.py,sha256=iUR2D3BQ8nVuC6hj4EoTBLGL9DiuikFfY0Dc9Ohs--s,9426
|
|
24
24
|
assemblyline_v4_service/updater/updater.py,sha256=UDqkKF4tQQbBF13fhCQzfJcmlNhYS5iI23odbpKpofE,32131
|
|
25
25
|
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
test/test_healthz.py,sha256=
|
|
26
|
+
test/test_healthz.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
27
27
|
test/test_run_privileged_service.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
28
|
-
test/test_run_service.py,sha256=
|
|
28
|
+
test/test_run_service.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
29
29
|
test/test_common/__init__.py,sha256=uWT8xNaiOOpVznGoUPhQu_mem9ha5l8OeVhiZ_1IP2M,1209
|
|
30
30
|
test/test_common/test_api.py,sha256=rh0-0CwqLtpRfKlcUFT-T2xgmBe7nP9fCZ0jpzufKek,4666
|
|
31
31
|
test/test_common/test_base.py,sha256=3B35CTxumj1jI-Yap17aWuoruWp0DYwUwnPl-hxrpkA,13143
|
|
32
32
|
test/test_common/test_helper.py,sha256=4r5S4W7EXUx4ldq7LZny0j3oohpnskya9pjMhrWBHD4,2388
|
|
33
33
|
test/test_common/test_ocr.py,sha256=NGYI81WDvP1Ou3iU65lJwzYa37_EONYG0oj_LqKvpdk,1816
|
|
34
34
|
test/test_common/test_ontology_helper.py,sha256=snkj61_iPzU0cE1dzJounZikkG2LY-GQrDgyqYqA5Hs,7784
|
|
35
|
-
test/test_common/test_request.py,sha256=
|
|
35
|
+
test/test_common/test_request.py,sha256=q_-5_507mdb1dz1_CUqwit1_2CinxHaqAKOO-qSLFLE,11671
|
|
36
36
|
test/test_common/test_result.py,sha256=sJHJ4CXHv_FkqBFp1ELV6XsSjUhqKY4Qa1nCoyXI8Os,42088
|
|
37
|
-
test/test_common/test_task.py,sha256=
|
|
37
|
+
test/test_common/test_task.py,sha256=RWsGEN0L-xKoRAsGv2x4JZcSAySS9aBF4dwL9t7tepo,18668
|
|
38
38
|
test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
|
|
39
|
-
assemblyline_v4_service-4.4.1.
|
|
40
|
-
assemblyline_v4_service-4.4.1.
|
|
41
|
-
assemblyline_v4_service-4.4.1.
|
|
42
|
-
assemblyline_v4_service-4.4.1.
|
|
43
|
-
assemblyline_v4_service-4.4.1.
|
|
39
|
+
assemblyline_v4_service-4.4.1.dev299.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
|
|
40
|
+
assemblyline_v4_service-4.4.1.dev299.dist-info/METADATA,sha256=kdWQ5OrP8ZTp4Bkfd3xDrFRfZCLuecB-Pfby7ryNV9I,9691
|
|
41
|
+
assemblyline_v4_service-4.4.1.dev299.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
42
|
+
assemblyline_v4_service-4.4.1.dev299.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
|
|
43
|
+
assemblyline_v4_service-4.4.1.dev299.dist-info/RECORD,,
|
test/test_common/test_request.py
CHANGED
|
@@ -133,7 +133,7 @@ def test_add_image(service_request):
|
|
|
133
133
|
'description': 'description of image',
|
|
134
134
|
'is_section_image': True,
|
|
135
135
|
'name': 'image_name',
|
|
136
|
-
'parent_relation': '
|
|
136
|
+
'parent_relation': 'INFORMATION',
|
|
137
137
|
'sha256': '09bf99ab5431af13b701a06dc2b04520aea9fd346584fa2a034d6d4af0c57329'
|
|
138
138
|
},
|
|
139
139
|
{
|
|
@@ -142,7 +142,7 @@ def test_add_image(service_request):
|
|
|
142
142
|
'description': 'description of image (thumbnail)',
|
|
143
143
|
'is_section_image': True,
|
|
144
144
|
'name': 'image_name.thumb',
|
|
145
|
-
'parent_relation': '
|
|
145
|
+
'parent_relation': 'INFORMATION',
|
|
146
146
|
'sha256': '1af0e0d99845493b64cf402b3704170f17ecf15001714016e48f9d4854218901'
|
|
147
147
|
},
|
|
148
148
|
]
|
|
@@ -244,7 +244,7 @@ def test_add_supplementary(service_request):
|
|
|
244
244
|
'description': 'description',
|
|
245
245
|
'is_section_image': False,
|
|
246
246
|
'name': 'name',
|
|
247
|
-
'parent_relation': '
|
|
247
|
+
'parent_relation': 'INFORMATION',
|
|
248
248
|
'path': path,
|
|
249
249
|
'sha256': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
|
|
250
250
|
},
|
test/test_common/test_task.py
CHANGED
|
@@ -148,6 +148,10 @@ def test_task_add_file(servicetask):
|
|
|
148
148
|
with open(path, "w") as f:
|
|
149
149
|
f.write("test")
|
|
150
150
|
|
|
151
|
+
# Incorrect parent_relation
|
|
152
|
+
with pytest.raises(ValueError):
|
|
153
|
+
t._add_file(path, "name", "description", parent_relation="BLAHBLAHBLAH") is None
|
|
154
|
+
|
|
151
155
|
# File is not empty
|
|
152
156
|
assert t._add_file(path, "name", "description") == {
|
|
153
157
|
"name": "name",
|
|
@@ -257,7 +261,7 @@ def test_task_add_supplementary(servicetask):
|
|
|
257
261
|
"path": path,
|
|
258
262
|
"is_section_image": False,
|
|
259
263
|
"allow_dynamic_recursion": False,
|
|
260
|
-
"parent_relation": "
|
|
264
|
+
"parent_relation": "INFORMATION",
|
|
261
265
|
}
|
|
262
266
|
assert t.supplementary == [
|
|
263
267
|
{
|
|
@@ -268,7 +272,7 @@ def test_task_add_supplementary(servicetask):
|
|
|
268
272
|
"path": path,
|
|
269
273
|
"is_section_image": False,
|
|
270
274
|
"allow_dynamic_recursion": False,
|
|
271
|
-
"parent_relation": "
|
|
275
|
+
"parent_relation": "INFORMATION",
|
|
272
276
|
}
|
|
273
277
|
]
|
|
274
278
|
|
test/test_healthz.py
CHANGED
test/test_run_service.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|