@@ -52,7 +52,7 @@ def search_topics(
52
52
offset : int = Query (0 , ge = 0 ),
53
53
limit : int = Query (10 , ge = 1 , le = 100 ), # 10 is default in web/src/pages/TopicManagement.jsx
54
54
sort_key : schemas .TopicSortKey = Query (schemas .TopicSortKey .CVSS_V3_SCORE_DESC ),
55
- threat_impacts : list [int ] | None = Query (None ),
55
+ cvss_v3_scores : list [float ] | None = Query (None ),
56
56
topic_ids : list [str ] | None = Query (None ),
57
57
title_words : list [str ] | None = Query (None ),
58
58
abstract_words : list [str ] | None = Query (None ),
@@ -70,7 +70,7 @@ def search_topics(
70
70
"""
71
71
Search topics by following parameters with sort and pagination.
72
72
73
- - threat_impacts
73
+ - cvss_v3_scores
74
74
- title_words
75
75
- abstract_words
76
76
- tag_names
@@ -149,13 +149,13 @@ def search_topics(
149
149
continue
150
150
fixed_abstract_words .add (abstract_word )
151
151
152
- fixed_threat_impacts : set [int ] = set ()
153
- if threat_impacts is not None :
154
- for threat_impact in threat_impacts :
152
+ fixed_cvss_v3_scores : set [float ] = set ()
153
+ if cvss_v3_scores is not None :
154
+ for cvss_v3_score in cvss_v3_scores :
155
155
try :
156
- int_val = int ( threat_impact )
157
- if int_val in { 1 , 2 , 3 , 4 } :
158
- fixed_threat_impacts .add (int_val )
156
+ float_val = float ( cvss_v3_score )
157
+ if float_val <= 10.0 and float_val >= 0 :
158
+ fixed_cvss_v3_scores .add (float_val )
159
159
except ValueError :
160
160
pass
161
161
@@ -164,7 +164,7 @@ def search_topics(
164
164
offset = offset ,
165
165
limit = limit ,
166
166
sort_key = sort_key ,
167
- threat_impacts = None if threat_impacts is None else list (fixed_threat_impacts ),
167
+ cvss_v3_scores = None if cvss_v3_scores is None else list (fixed_cvss_v3_scores ),
168
168
title_words = None if title_words is None else list (fixed_title_words ),
169
169
abstract_words = None if abstract_words is None else list (fixed_abstract_words ),
170
170
tag_ids = None if tag_names is None else list (fixed_tag_ids ),
@@ -203,8 +203,6 @@ def create_topic(
203
203
):
204
204
"""
205
205
Create a topic.
206
- - `threat_impact` : The value is in 1, 2, 3, 4.
207
- (immediate: 1, off-cycle: 2, acceptable: 3, none: 4)
208
206
- `tags` : Optional. The default is an empty list.
209
207
- `misp_tags` : Optional. The default is an empty list.
210
208
- `actions` : Optional. The default is an empty list.
@@ -270,7 +268,6 @@ def create_topic(
270
268
topic_id = str (topic_id ),
271
269
title = data .title ,
272
270
abstract = data .abstract ,
273
- threat_impact = data .threat_impact ,
274
271
created_by = current_user .user_id ,
275
272
created_at = now ,
276
273
updated_at = now ,
@@ -348,11 +345,6 @@ def update_topic(
348
345
status_code = status .HTTP_400_BAD_REQUEST ,
349
346
detail = "Cannot specify None for abstract" ,
350
347
)
351
- if "threat_impact" in update_data .keys () and data .threat_impact is None :
352
- raise HTTPException (
353
- status_code = status .HTTP_400_BAD_REQUEST ,
354
- detail = "Cannot specify None for threat_impact" ,
355
- )
356
348
if "tags" in update_data .keys () and data .tags is None :
357
349
raise HTTPException (
358
350
status_code = status .HTTP_400_BAD_REQUEST ,
@@ -389,8 +381,6 @@ def update_topic(
389
381
topic .title = data .title
390
382
if data .abstract is not None :
391
383
topic .abstract = data .abstract
392
- if data .threat_impact is not None :
393
- topic .threat_impact = data .threat_impact
394
384
if data .exploitation is not None :
395
385
previous_exploitation = topic .exploitation
396
386
topic .exploitation = data .exploitation
0 commit comments