assemblyline-v4-service 4.5.0.67__py3-none-any.whl → 4.5.0.69__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.67
1
+ 4.5.0.69
@@ -19,7 +19,7 @@ from assemblyline.common.uid import get_random_id
19
19
  from assemblyline.odm.messages.task import Task as ServiceTask
20
20
  from assemblyline.odm.models.result import Result
21
21
  from assemblyline.odm.models.service import Service
22
- from assemblyline_v4_service.common.helper import get_heuristics
22
+ from assemblyline_v4_service.common.helper import get_heuristics, get_service_manifest
23
23
 
24
24
 
25
25
  class RunService:
@@ -189,36 +189,29 @@ class RunService:
189
189
  self.identify.stop()
190
190
 
191
191
  def load_service_manifest(self, return_heuristics=False) -> Union[None, Dict]:
192
- service_manifest_yml = os.path.join(os.getcwd(), 'service_manifest.yml')
192
+ service_manifest_data = get_service_manifest()
193
+ heuristics = service_manifest_data.get('heuristics', None)
193
194
 
194
- if os.path.exists(service_manifest_yml):
195
- with open(service_manifest_yml) as yml_fh:
196
- service_manifest_data = yaml.safe_load(yml_fh.read())
195
+ # Pop the 'extra' data from the service manifest
196
+ for x in ['file_required', 'tool_version', 'heuristics']:
197
+ service_manifest_data.pop(x, None)
197
198
 
198
- heuristics = service_manifest_data.get('heuristics', None)
199
-
200
- # Pop the 'extra' data from the service manifest
201
- for x in ['file_required', 'tool_version', 'heuristics']:
202
- service_manifest_data.pop(x, None)
203
-
204
- # Validate the service manifest
205
- try:
206
- self.service = Service(service_manifest_data)
207
- except Exception as e:
208
- LOG.error(f"Invalid service manifest: {str(e)}")
199
+ # Validate the service manifest
200
+ try:
201
+ self.service = Service(service_manifest_data)
202
+ except Exception as e:
203
+ LOG.error(f"Invalid service manifest: {str(e)}")
209
204
 
210
- service_config = {}
211
- if service_manifest_data:
212
- service_config = service_manifest_data.get('config', {})
205
+ service_config = {}
206
+ if service_manifest_data:
207
+ service_config = service_manifest_data.get('config', {})
213
208
 
214
- self.submission_params = {x['name']: x['value']
215
- for x in service_manifest_data.get('submission_params', [])}
209
+ self.submission_params = {x['name']: x['value']
210
+ for x in service_manifest_data.get('submission_params', [])}
216
211
 
217
- self.service = self.service_class(config=service_config)
218
- if return_heuristics:
219
- return heuristics
220
- else:
221
- raise Exception("Service manifest YAML file not found in root folder of service.")
212
+ self.service = self.service_class(config=service_config)
213
+ if return_heuristics:
214
+ return heuristics
222
215
 
223
216
 
224
217
  if __name__ == '__main__':
@@ -368,6 +368,11 @@ class ServiceUpdater(ThreadedCoreBase):
368
368
  while self.update_queue.qsize():
369
369
  update_attempt = -1
370
370
  source_name = self.update_queue.get()
371
+
372
+ if source_name not in sources:
373
+ # This source has been removed from the service configuration
374
+ continue
375
+
371
376
  while update_attempt < SOURCE_UPDATE_ATTEMPT_MAX_RETRY:
372
377
  # Introduce an exponential delay between each attempt
373
378
  time.sleep(SOURCE_UPDATE_ATTEMPT_DELAY_BASE**update_attempt)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: assemblyline-v4-service
3
- Version: 4.5.0.67
3
+ Version: 4.5.0.69
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
@@ -33,6 +33,17 @@ Requires-Dist: flask; extra == "updater"
33
33
  Requires-Dist: gitpython; extra == "updater"
34
34
  Requires-Dist: git-remote-codecommit; extra == "updater"
35
35
  Requires-Dist: psutil; extra == "updater"
36
+ Dynamic: author
37
+ Dynamic: author-email
38
+ Dynamic: classifier
39
+ Dynamic: description
40
+ Dynamic: description-content-type
41
+ Dynamic: home-page
42
+ Dynamic: keywords
43
+ Dynamic: license
44
+ Dynamic: provides-extra
45
+ Dynamic: requires-dist
46
+ Dynamic: summary
36
47
 
37
48
  # Assemblyline 4 - Service Base
38
49
 
@@ -1,4 +1,4 @@
1
- assemblyline_v4_service/VERSION,sha256=14q-J90tfFEN5l46M9V0N5y2-VndxwzbunvnnOTEils,9
1
+ assemblyline_v4_service/VERSION,sha256=LxkJSiEhrbwFU7aMDp4BnnuKoWGRdIWzrrvZ5U-V-RA,9
2
2
  assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  assemblyline_v4_service/healthz.py,sha256=3QGBg0EZuXC6UN411HFwpLNEop9UvS9feFhvBUTP-k4,1576
4
4
  assemblyline_v4_service/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -15,14 +15,14 @@ assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFS
15
15
  assemblyline_v4_service/common/task.py,sha256=dJsvRpW0x88CCF_LW6w87jQ_UKTVaOs2Gb117IDNiU8,14233
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=cGwsNGWNp5KcZ4iVqMf76uGHR21faYhpEkEclMwEdcI,10505
18
+ assemblyline_v4_service/dev/run_service_once.py,sha256=1sdxkRBI7x9Sht8EVCTMIW3MgSxIeV6Ufw77Wx9Vf20,10150
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
22
22
  assemblyline_v4_service/updater/client.py,sha256=eBOK8doMu9nsIO6kXWtaBMy4hJIKRtQG0iC_21a5CG4,10849
23
23
  assemblyline_v4_service/updater/gunicorn_config.py,sha256=p3j2KPBeD5jvMw9O5i7vAtlRgPSVVxIG9AO0DfN82J8,1247
24
24
  assemblyline_v4_service/updater/helper.py,sha256=DhxF2TVVpUY6S5dJnjRlTl6eBJrtTqw1uUAcvVWVkhM,9895
25
- assemblyline_v4_service/updater/updater.py,sha256=8o-vEMMJS388Ci9mVk_6nwFayM5NToliOTFnnPWHTYE,31449
25
+ assemblyline_v4_service/updater/updater.py,sha256=HqRVUs5nNIfKmHu7g1GUkgC7bvYWs2EC9ZFy1kj-Ltw,31609
26
26
  test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  test/conftest.py,sha256=W3SieQpZsZpGEmtLqY4aIlxREDSsHceyCrFcFsWUM0U,1851
28
28
  test/test_healthz.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
@@ -38,8 +38,8 @@ test/test_common/test_request.py,sha256=Ceyds8BNO1O0f1kH1VEb84faJcaupvSjVKIrGdHe
38
38
  test/test_common/test_result.py,sha256=6BiOKxEPrKBjOY44jv3TY-yiXm0qI1ok_CZBnjP9TM4,45447
39
39
  test/test_common/test_task.py,sha256=P44mNcSe-3tJgDk9ppN3KbM7oN4LBVIuhONG-Gveh74,19007
40
40
  test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
41
- assemblyline_v4_service-4.5.0.67.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
- assemblyline_v4_service-4.5.0.67.dist-info/METADATA,sha256=sBLZmxKEFJkv8sOOxjXKcm4Fututuby8FwVMr_k837s,9489
43
- assemblyline_v4_service-4.5.0.67.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
44
- assemblyline_v4_service-4.5.0.67.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
- assemblyline_v4_service-4.5.0.67.dist-info/RECORD,,
41
+ assemblyline_v4_service-4.5.0.69.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
+ assemblyline_v4_service-4.5.0.69.dist-info/METADATA,sha256=6Z1W8t9xHIaOT5-BEPdg0H-IVJYyfBFFykzTHa1lqI0,9720
43
+ assemblyline_v4_service-4.5.0.69.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
44
+ assemblyline_v4_service-4.5.0.69.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
+ assemblyline_v4_service-4.5.0.69.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.45.1)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5