assemblyline-v4-service 4.5.0.1__py3-none-any.whl → 4.5.1.dev0__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.

@@ -1 +1 @@
1
- 4.5.0.1
1
+ 4.5.1.dev0
@@ -202,6 +202,9 @@ class ServiceRequest:
202
202
  """
203
203
  return self.task.get_param(name)
204
204
 
205
+ def partial(self) -> None:
206
+ self.task.partial()
207
+
205
208
  @property
206
209
  def result(self) -> Result:
207
210
  """
@@ -69,7 +69,8 @@ class Task:
69
69
  self.min_classification = task.min_classification.value
70
70
  self.max_extracted = task.max_files
71
71
  self.metadata = task.metadata
72
- self.result: Optional[Result] = None
72
+ self.partial_result: bool = False
73
+ self.result: Result = Result()
73
74
  self.safelist_config: Dict[str, Any] = task.safelist_config
74
75
  self.service_config: Dict[str, Any] = dict(task.service_config)
75
76
  self.service_context: Optional[str] = None
@@ -254,11 +255,15 @@ class Task:
254
255
  type=self.file_type,
255
256
  size=self.file_size,
256
257
  drop_file=self.drop_file,
258
+ partial=self.partial_result,
257
259
  temp_submission_data=self.temp_submission_data,
258
260
  )
259
261
 
260
262
  return result
261
263
 
264
+ def partial(self) -> None:
265
+ self.partial_result = True
266
+
262
267
  def save_error(self, stack_info: str, recoverable: bool) -> None:
263
268
  self.error_message = stack_info
264
269
 
@@ -97,6 +97,7 @@ class RunService:
97
97
  min_classification=forge.get_classification().UNRESTRICTED,
98
98
  max_files=501, # TODO: get the actual value
99
99
  ttl=3600
100
+
100
101
  ))
101
102
 
102
103
  LOG.info(f"Starting task with SID: {service_task.sid}")
@@ -32,4 +32,4 @@ def perform_check():
32
32
 
33
33
 
34
34
  if __name__ == '__main__':
35
- perform_check()
35
+ perform_check()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: assemblyline-v4-service
3
- Version: 4.5.0.1
3
+ Version: 4.5.1.dev0
4
4
  Summary: Assemblyline 4 - Service base
5
5
  Home-page: https://github.com/CybercentreCanada/assemblyline-v4-service/
6
6
  Author: CCCS Assemblyline development team
@@ -1,6 +1,6 @@
1
- assemblyline_v4_service/VERSION,sha256=sN7A4hYxrUFsQk3N7yZz7AYTQZVRAKZFbN32Lrd0_Lo,8
1
+ assemblyline_v4_service/VERSION,sha256=tihKsYXrkYV1JcrkKoMgPTQedjk_wl0d4ZAkFLNIA5Y,11
2
2
  assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- assemblyline_v4_service/healthz.py,sha256=3QGBg0EZuXC6UN411HFwpLNEop9UvS9feFhvBUTP-k4,1576
3
+ assemblyline_v4_service/healthz.py,sha256=sS1cFkDLw8hUPMpj7tbHXFv8ZmHcazrwZ0l6oQDwwkQ,1575
4
4
  assemblyline_v4_service/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  assemblyline_v4_service/run_privileged_service.py,sha256=qd4DmHo5G_Tpv8tb0A96qNfCGuXBu5MlIKB205z5e5w,14514
6
6
  assemblyline_v4_service/run_service.py,sha256=NiFX52NfsbBQY6E3nrjoB3e2XxIlwFcQpYYY-rADIk4,5996
@@ -10,12 +10,12 @@ assemblyline_v4_service/common/base.py,sha256=mKkkzbxVL_wVMy_VieU9mlHYLqZXndga_4
10
10
  assemblyline_v4_service/common/helper.py,sha256=xs9quuf-M1JOdKieBqOmWaOece0CtzXFhhe85xQYmuY,3289
11
11
  assemblyline_v4_service/common/ocr.py,sha256=XHHD0bOKu7DdBEMQ3sPZxQjp4K4G3js_Ib2GKWD6Xuw,7897
12
12
  assemblyline_v4_service/common/ontology_helper.py,sha256=QpwerYoS5hXjWzpx3Pmwv6j2330PQVYqxYGamjcpW3I,7890
13
- assemblyline_v4_service/common/request.py,sha256=NxtWxp8-ttC72i3Vnchc3fZTRKqPQAoMC4KAVwEj8-4,11714
13
+ assemblyline_v4_service/common/request.py,sha256=XXBafAQCV43_OBLXOSHxYoDHmqwERBkNul8fb_X6Ves,11774
14
14
  assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFSiGjp57fXW2E,32713
15
- assemblyline_v4_service/common/task.py,sha256=7yNvXk5B27QookJNp4-Y1iGhV8LfhLDaYWzF-uFGWgo,13576
15
+ assemblyline_v4_service/common/task.py,sha256=-AhtT6qSMLndBB3IOqOF-MV5K8Xp_67yvcgMuzr1IT0,13720
16
16
  assemblyline_v4_service/common/utils.py,sha256=k2__d-V5LjB6o2IKbjVe7tJWKcKuUHto5TyT5oKhIa0,3890
17
17
  assemblyline_v4_service/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- assemblyline_v4_service/dev/run_service_once.py,sha256=caqUHYc27JLuJPOwkEuhf8-wlaYPvzDrRqfEuhMMxqw,10455
18
+ assemblyline_v4_service/dev/run_service_once.py,sha256=4K3ljw0MnfPGw0-6lzc_vtUYg1EbntJbbsWvNU-ZM_A,10456
19
19
  assemblyline_v4_service/updater/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  assemblyline_v4_service/updater/__main__.py,sha256=9Os-u8Tf7MD73JSrUSPmOaErTgfvesNLiEeszU4ujXA,133
21
21
  assemblyline_v4_service/updater/app.py,sha256=Mtmx4bkXfP4nFqqa5q15jW8QIXr4JK84lCovxAVyvPs,3317
@@ -33,12 +33,12 @@ test/test_common/test_base.py,sha256=d61an3lRaes_cx0AOPMNFMVWxTOjilrcGpuVP0dqTvM
33
33
  test/test_common/test_helper.py,sha256=sO6YAiBhKTqaxlpLhFYDuy2ZdbuF2cg07Ylzo83ZzQs,2575
34
34
  test/test_common/test_ocr.py,sha256=s5kL0vKjLmbyXuCg-9v6V6wQwwFRu0w2hYpjG0_BXy4,1874
35
35
  test/test_common/test_ontology_helper.py,sha256=TuvTeP9BTRqklOlsLu_yMdN9wdPWlVAENx2JqUe9a-A,7856
36
- test/test_common/test_request.py,sha256=K-gaHe20AUztfU3pLdWYv5bc6088GBBKP-eb833cis0,11729
36
+ test/test_common/test_request.py,sha256=wxSwnOj-_YOv2SuZjOJsw09q8A7p8GJmJuK4vozqCNg,11749
37
37
  test/test_common/test_result.py,sha256=Wm0Cs5kZRzlZr0jL-l8OTsYAvkoN2eaB3NkeXzvyssI,42208
38
- test/test_common/test_task.py,sha256=RWsGEN0L-xKoRAsGv2x4JZcSAySS9aBF4dwL9t7tepo,18668
38
+ test/test_common/test_task.py,sha256=jnfF68EgJIu30Pz_4jiJHkncfI-3XpGaut5r79KIXOA,18718
39
39
  test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
40
- assemblyline_v4_service-4.5.0.1.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
41
- assemblyline_v4_service-4.5.0.1.dist-info/METADATA,sha256=bUhaqoY-R18d2STAxKPxhB0QT6G-QZRjrjcZw9tV-Sw,9735
42
- assemblyline_v4_service-4.5.0.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
43
- assemblyline_v4_service-4.5.0.1.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
44
- assemblyline_v4_service-4.5.0.1.dist-info/RECORD,,
40
+ assemblyline_v4_service-4.5.1.dev0.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
41
+ assemblyline_v4_service-4.5.1.dev0.dist-info/METADATA,sha256=8vWvEo6k0dCXU2u4NUATHAZH-NB0R408l-EX2oNwv_k,9738
42
+ assemblyline_v4_service-4.5.1.dev0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
43
+ assemblyline_v4_service-4.5.1.dev0.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
44
+ assemblyline_v4_service-4.5.1.dev0.dist-info/RECORD,,
@@ -5,7 +5,7 @@ from test.test_common import TESSERACT_LIST
5
5
 
6
6
  import pytest
7
7
  from assemblyline_v4_service.common.request import ServiceRequest
8
- from assemblyline_v4_service.common.result import get_heuristic_primitives
8
+ from assemblyline_v4_service.common.result import Result, get_heuristic_primitives
9
9
  from assemblyline_v4_service.common.task import MaxExtractedExceeded, Task
10
10
 
11
11
  from assemblyline.odm.messages.task import Task as ServiceTask
@@ -289,7 +289,7 @@ def test_get_param(service_request):
289
289
 
290
290
 
291
291
  def test_result_getter(service_request):
292
- assert service_request.result is None
292
+ assert isinstance(service_request.result, Result)
293
293
 
294
294
 
295
295
  def test_result_setter(service_request):
@@ -61,7 +61,6 @@ def test_task_init(servicetask):
61
61
  assert t.metadata == {}
62
62
  assert t.md5 == "d41d8cd98f00b204e9800998ecf8427e"
63
63
  assert t.mime is None
64
- assert t.result is None
65
64
  assert isinstance(t.safelist_config, ServiceSafelist)
66
65
  assert t.service_config == {}
67
66
  assert t.service_context is None
@@ -375,6 +374,7 @@ def test_task_get_service_result(servicetask):
375
374
  "service_debug_info": None,
376
375
  },
377
376
  "result": {"score": 0, "sections": []},
377
+ "partial": False,
378
378
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
379
379
  "type": "text/plain",
380
380
  "size": 0,
@@ -417,6 +417,7 @@ def test_task_get_service_result(servicetask):
417
417
  "result": {
418
418
  "score": 0,
419
419
  },
420
+ "partial": False,
420
421
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
421
422
  "type": "text/plain",
422
423
  "size": 0,
@@ -480,6 +481,7 @@ def test_task_save_result(servicetask):
480
481
  "service_debug_info": None,
481
482
  },
482
483
  "result": {"score": 0, "sections": []},
484
+ "partial": False,
483
485
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
484
486
  "type": "text/plain",
485
487
  "size": 0,