assemblyline-v4-service 4.5.1.dev16__py3-none-any.whl → 4.5.1.dev18__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.1.dev16
1
+ 4.5.1.dev18
@@ -8,7 +8,7 @@ from assemblyline_core.badlist_client import BadlistClient
8
8
  from assemblyline_core.safelist_client import SafelistClient
9
9
  from assemblyline_core.signature_client import SignatureClient
10
10
 
11
- from typing import Any, Dict, List, Union
11
+ from typing import Any, Dict, List, Optional, Set, Union
12
12
 
13
13
  SIGNATURE_UPDATE_BATCH = int(os.environ.get('SIGNATURE_UPDATE_BATCH', '1000'))
14
14
 
@@ -43,8 +43,8 @@ def hashlist_add_update_many(client: Union[SyncableBadlistClient, SyncableSafeli
43
43
  if not data:
44
44
  return {"success": 0, "errors": False}
45
45
 
46
- current_ids = set()
47
- source = None
46
+ current_ids: Set[str] = set()
47
+ source: Optional[str] = None
48
48
 
49
49
  # Iterate over the list of signatures given
50
50
  for i, d in enumerate(data):
@@ -62,7 +62,7 @@ def hashlist_add_update_many(client: Union[SyncableBadlistClient, SyncableSafeli
62
62
  data[i] = d
63
63
 
64
64
  if client.sync:
65
- # Get the list of items that currently existing in the system for the source
65
+ # Get the list of items that currently exists in the system for the source
66
66
  existing_ids = set(
67
67
  [
68
68
  i["id"]
@@ -73,7 +73,8 @@ def hashlist_add_update_many(client: Union[SyncableBadlistClient, SyncableSafeli
73
73
  )
74
74
 
75
75
  # Find the IDs that don't exist at this source anymore and remove the source from the source list
76
- for missing_id in existing_ids - current_ids:
76
+ missing_ids = existing_ids - current_ids
77
+ for missing_id in missing_ids:
77
78
  missing_item = collection.get(missing_id)
78
79
  original_sources = missing_item.sources
79
80
  missing_item.sources = [
@@ -103,7 +104,7 @@ def hashlist_add_update_many(client: Union[SyncableBadlistClient, SyncableSafeli
103
104
  def update_response(r: Dict[str, Any]):
104
105
  # Response has to be in the same format, but show the accumulation of batches
105
106
  response["success"]: int = response["success"] + r["success"]
106
- response["errors"]: bool = response["errors"] and r["errors"]
107
+ response["errors"]: bool = response["errors"] or r["errors"]
107
108
 
108
109
  # Split up data into batches to avoid server timeouts handling requests
109
110
  batch_num = 0
@@ -212,4 +213,7 @@ class UpdaterClient(object):
212
213
  @sync.setter
213
214
  def sync(self, value: bool):
214
215
  # Set sync state across clients
215
- self.badlist.sync = self.safelist.sync = self.signature.sync = self._sync = value
216
+ self.badlist.sync = value
217
+ self.safelist.sync = value
218
+ self.signature.sync = value
219
+ self._sync = value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: assemblyline-v4-service
3
- Version: 4.5.1.dev16
3
+ Version: 4.5.1.dev18
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
@@ -24,7 +24,7 @@ Requires-Dist: assemblyline-core
24
24
  Requires-Dist: cart
25
25
  Requires-Dist: fuzzywuzzy
26
26
  Requires-Dist: pefile
27
- Requires-Dist: pillow ==10.2.0
27
+ Requires-Dist: pillow !=10.1.0,!=10.2.0
28
28
  Requires-Dist: python-Levenshtein
29
29
  Requires-Dist: regex
30
30
  Provides-Extra: updater
@@ -1,4 +1,4 @@
1
- assemblyline_v4_service/VERSION,sha256=0-g8dJxLTJFtULYg5QIJJv9rVKI19Dyyr8J5MRrFatw,12
1
+ assemblyline_v4_service/VERSION,sha256=h6E5ws5IauZrCNriaOV0jEyvWhYiOuGV5uk53ACXZDg,12
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/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -19,7 +19,7 @@ assemblyline_v4_service/dev/run_service_once.py,sha256=4K3ljw0MnfPGw0-6lzc_vtUYg
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
- assemblyline_v4_service/updater/client.py,sha256=G5zvFo1--ZB-jCP7lCmIK5p8mXE5ptLBa41Uq6IN4W0,9405
22
+ assemblyline_v4_service/updater/client.py,sha256=oOOIzh-Q-b5uOTo3C4rVSfQxqUO5Y_ogDmUhvWfm5uo,9518
23
23
  assemblyline_v4_service/updater/gunicorn_config.py,sha256=p3j2KPBeD5jvMw9O5i7vAtlRgPSVVxIG9AO0DfN82J8,1247
24
24
  assemblyline_v4_service/updater/helper.py,sha256=HbH5p6UTdHyIgoctF1c1pQkoqTtzaxfHOi9KXGwn0eM,9435
25
25
  assemblyline_v4_service/updater/updater.py,sha256=5cJH82VTP3VrwoNE97ubKP2dr90AI_T-AKRistvN5rI,29013
@@ -38,8 +38,8 @@ test/test_common/test_request.py,sha256=wxSwnOj-_YOv2SuZjOJsw09q8A7p8GJmJuK4vozq
38
38
  test/test_common/test_result.py,sha256=Wm0Cs5kZRzlZr0jL-l8OTsYAvkoN2eaB3NkeXzvyssI,42208
39
39
  test/test_common/test_task.py,sha256=jnfF68EgJIu30Pz_4jiJHkncfI-3XpGaut5r79KIXOA,18718
40
40
  test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
41
- assemblyline_v4_service-4.5.1.dev16.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
- assemblyline_v4_service-4.5.1.dev16.dist-info/METADATA,sha256=SrY3XnMK8NDV4j9bypqi0rESs_o5pqixb4E6uvYMEwo,9489
43
- assemblyline_v4_service-4.5.1.dev16.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
44
- assemblyline_v4_service-4.5.1.dev16.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
- assemblyline_v4_service-4.5.1.dev16.dist-info/RECORD,,
41
+ assemblyline_v4_service-4.5.1.dev18.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
+ assemblyline_v4_service-4.5.1.dev18.dist-info/METADATA,sha256=Xn_veKJC6ngbhR0N3-Z1Qod0AuzTzZMjrCbENp2CQ38,9498
43
+ assemblyline_v4_service-4.5.1.dev18.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
44
+ assemblyline_v4_service-4.5.1.dev18.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
+ assemblyline_v4_service-4.5.1.dev18.dist-info/RECORD,,