assemblyline-v4-service 4.5.1.dev265__py3-none-any.whl → 4.5.1.dev270__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/ontology_helper.py +7 -0
- {assemblyline_v4_service-4.5.1.dev265.dist-info → assemblyline_v4_service-4.5.1.dev270.dist-info}/METADATA +1 -1
- {assemblyline_v4_service-4.5.1.dev265.dist-info → assemblyline_v4_service-4.5.1.dev270.dist-info}/RECORD +8 -8
- test/test_common/test_ontology_helper.py +5 -2
- {assemblyline_v4_service-4.5.1.dev265.dist-info → assemblyline_v4_service-4.5.1.dev270.dist-info}/LICENCE.md +0 -0
- {assemblyline_v4_service-4.5.1.dev265.dist-info → assemblyline_v4_service-4.5.1.dev270.dist-info}/WHEEL +0 -0
- {assemblyline_v4_service-4.5.1.dev265.dist-info → assemblyline_v4_service-4.5.1.dev270.dist-info}/top_level.txt +0 -0
assemblyline_v4_service/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.5.1.
|
|
1
|
+
4.5.1.dev270
|
|
@@ -48,6 +48,7 @@ class OntologyHelper:
|
|
|
48
48
|
self.log = logger
|
|
49
49
|
self._file_info = dict()
|
|
50
50
|
self._result_parts: Dict[str, Model] = dict()
|
|
51
|
+
self._other: Dict[str, str] = dict()
|
|
51
52
|
self.results = defaultdict(list)
|
|
52
53
|
self.service = service_name
|
|
53
54
|
|
|
@@ -94,6 +95,9 @@ class OntologyHelper:
|
|
|
94
95
|
finally:
|
|
95
96
|
return oid
|
|
96
97
|
|
|
98
|
+
def add_other_part(self, key: str, data: str) -> None:
|
|
99
|
+
self._other[key] = data
|
|
100
|
+
|
|
97
101
|
def attach_parts(self, ontology: Dict) -> None:
|
|
98
102
|
ontology['file'].update({k: v.as_primitives(strip_null=True) for k, v in self._file_info.items()})
|
|
99
103
|
|
|
@@ -106,6 +110,9 @@ class OntologyHelper:
|
|
|
106
110
|
|
|
107
111
|
ontology['results'].update(self.results)
|
|
108
112
|
|
|
113
|
+
if self._other:
|
|
114
|
+
ontology['results']['other'] = self._other
|
|
115
|
+
|
|
109
116
|
def _preprocess_result_for_dump(self, sections: List[ResultSection], current_max: str,
|
|
110
117
|
heur_tag_map: Dict[str, Dict[str, Any]], tag_map: Dict[str, List[str]], score: int) -> Tuple[str, Dict[str, Dict[str, Any]], Dict[str, List[str]], int]:
|
|
111
118
|
for section in sections:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
assemblyline_v4_service/VERSION,sha256=
|
|
1
|
+
assemblyline_v4_service/VERSION,sha256=98K2JfxUp_flsJ-9LN_fCymolXK-YIES_roUjckPXmI,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/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -9,7 +9,7 @@ assemblyline_v4_service/common/api.py,sha256=Xzp8j4HCCfjPvNSGKiZl5ttH2_Itg47cjlH
|
|
|
9
9
|
assemblyline_v4_service/common/base.py,sha256=4rnK_183qsSfkRkuVp_0wy-haW49umx4jJIC0OalGDM,14218
|
|
10
10
|
assemblyline_v4_service/common/helper.py,sha256=xs9quuf-M1JOdKieBqOmWaOece0CtzXFhhe85xQYmuY,3289
|
|
11
11
|
assemblyline_v4_service/common/ocr.py,sha256=3fV0PyY3oui_ucAM9dkolP0VRYKACKJuGY4M64DudIE,8841
|
|
12
|
-
assemblyline_v4_service/common/ontology_helper.py,sha256=
|
|
12
|
+
assemblyline_v4_service/common/ontology_helper.py,sha256=9Ad81qbddg_pRMupT8o_KzxbKgpodaRqpc3mPoEKLtw,8494
|
|
13
13
|
assemblyline_v4_service/common/request.py,sha256=W7fqC2xQE3i5i2jlCDyUDp3ZqJQQqSshNW0mQfJMkFg,11792
|
|
14
14
|
assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFSiGjp57fXW2E,32713
|
|
15
15
|
assemblyline_v4_service/common/task.py,sha256=dJsvRpW0x88CCF_LW6w87jQ_UKTVaOs2Gb117IDNiU8,14233
|
|
@@ -33,13 +33,13 @@ test/test_common/test_api.py,sha256=7wlo7wgB12T23zMLbwjJ3GIomLHqE_Qvs3xkibSsR1U,
|
|
|
33
33
|
test/test_common/test_base.py,sha256=fuJSSlPxIDHq6HU1xbvaMFitw2z1spOZNHD2SJ4UUic,13346
|
|
34
34
|
test/test_common/test_helper.py,sha256=sO6YAiBhKTqaxlpLhFYDuy2ZdbuF2cg07Ylzo83ZzQs,2575
|
|
35
35
|
test/test_common/test_ocr.py,sha256=mt_PgElgwQKJmNrp2nRVx9NjfMedVk40I6IV317vATI,1753
|
|
36
|
-
test/test_common/test_ontology_helper.py,sha256=
|
|
36
|
+
test/test_common/test_ontology_helper.py,sha256=Q9-Eqeo8Ih7XlbFmlUAXCtgnfW8JCDqqlYFb56077h4,10331
|
|
37
37
|
test/test_common/test_request.py,sha256=Ceyds8BNO1O0f1kH1VEb84faJcaupvSjVKIrGdHexsc,11842
|
|
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.1.
|
|
42
|
-
assemblyline_v4_service-4.5.1.
|
|
43
|
-
assemblyline_v4_service-4.5.1.
|
|
44
|
-
assemblyline_v4_service-4.5.1.
|
|
45
|
-
assemblyline_v4_service-4.5.1.
|
|
41
|
+
assemblyline_v4_service-4.5.1.dev270.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
|
|
42
|
+
assemblyline_v4_service-4.5.1.dev270.dist-info/METADATA,sha256=4LDCUvol5DmPcRESQSakl5hjzuCwb1sjn8wx5wauWXY,9493
|
|
43
|
+
assemblyline_v4_service-4.5.1.dev270.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
44
|
+
assemblyline_v4_service-4.5.1.dev270.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
|
|
45
|
+
assemblyline_v4_service-4.5.1.dev270.dist-info/RECORD,,
|
|
@@ -125,7 +125,6 @@ def test_add_result_part():
|
|
|
125
125
|
assert oh._result_parts[oid_2]["objectid"]["ontology_id"] == "antivirus_7WVybQLECGWqS0DqePtVLp"
|
|
126
126
|
assert oh._result_parts[oid_2]["objectid"]["service_name"] == "blah"
|
|
127
127
|
|
|
128
|
-
|
|
129
128
|
def test_attach_parts():
|
|
130
129
|
oh = OntologyHelper(None, "blah")
|
|
131
130
|
|
|
@@ -146,6 +145,7 @@ def test_attach_parts():
|
|
|
146
145
|
oh._file_info = {"a": Antivirus({"objectid": {"tag": "a", "ontology_id": "b"}, "engine_name": "blah"})}
|
|
147
146
|
ont = {"file": {"blah": "blah"}, "results": {"blah": "blah"}}
|
|
148
147
|
oh.add_result_part(Antivirus, {"engine_name": "blah"})
|
|
148
|
+
oh.add_other_part("test", "blah")
|
|
149
149
|
oh.attach_parts(ont)
|
|
150
150
|
assert oh.results == {
|
|
151
151
|
'antivirus': [
|
|
@@ -179,7 +179,10 @@ def test_attach_parts():
|
|
|
179
179
|
},
|
|
180
180
|
'engine_name': 'blah'
|
|
181
181
|
}
|
|
182
|
-
]
|
|
182
|
+
],
|
|
183
|
+
'other': {
|
|
184
|
+
'test': 'blah'
|
|
185
|
+
}
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|