File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
contentctl/objects/abstract_security_content_objects Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1059,25 +1059,26 @@ def get_summary(
1059
1059
@model_validator (mode = "after" )
1060
1060
def validate_data_source_output_fields (self ):
1061
1061
# Skip validation for Hunting and Correlation types, or non-production detections
1062
- if (self .status != DetectionStatus .production or
1063
- self .type in {AnalyticsType .Hunting , AnalyticsType .Correlation }):
1062
+ if self .status != DetectionStatus .production or self .type in {
1063
+ AnalyticsType .Hunting ,
1064
+ AnalyticsType .Correlation ,
1065
+ }:
1064
1066
return self
1065
1067
1066
1068
# Validate that all required output fields are present in the search
1067
1069
for data_source in self .data_source_objects :
1068
1070
if not data_source .output_fields :
1069
1071
continue
1070
-
1072
+
1071
1073
missing_fields = [
1072
- field for field in data_source .output_fields
1073
- if field not in self .search
1074
+ field for field in data_source .output_fields if field not in self .search
1074
1075
]
1075
-
1076
+
1076
1077
if missing_fields :
1077
1078
raise ValueError (
1078
1079
f"Data source '{ data_source .name } ' has output fields "
1079
1080
f"{ missing_fields } that are not present in the search "
1080
1081
f"for detection '{ self .name } '"
1081
1082
)
1082
-
1083
+
1083
1084
return self
You can’t perform that action at this time.
0 commit comments