Skip to content

Commit

Permalink
merged branches
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Sep 15, 2023
1 parent f6d6541 commit fe69f2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contentctl/objects/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
from contentctl.objects.unit_test_attack_data import UnitTestAttackData
from contentctl.objects.unit_test_result import UnitTestResult
from contentctl.objects.enums import SecurityContentType
class UnitTest(SecurityContentObject):


class UnitTest(BaseModel):
#contentType: SecurityContentType = SecurityContentType.unit_tests
#name: str
name: str
pass_condition: Union[str, None] = None
earliest_time: Union[str, None] = None
latest_time: Union[str, None] = None
Expand Down
5 changes: 5 additions & 0 deletions contentctl/output/api_json_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def writeObjects(self, objects: list, output_path: str, type: SecurityContentTyp
if type == SecurityContentType.detections:
obj_array = []
for detection in objects:
detection.id = str(detection.id)
obj_array.append(detection.dict(exclude_none=True,
exclude =
{
Expand Down Expand Up @@ -70,6 +71,7 @@ def writeObjects(self, objects: list, output_path: str, type: SecurityContentTyp
elif type == SecurityContentType.stories:
obj_array = []
for story in objects:
story.id = str(story.id)
obj_array.append(story.dict(exclude_none=True,
exclude =
{
Expand All @@ -82,6 +84,7 @@ def writeObjects(self, objects: list, output_path: str, type: SecurityContentTyp
elif type == SecurityContentType.baselines:
obj_array = []
for baseline in objects:
baseline.id = str(baseline.id)
obj_array.append(baseline.dict(
exclude =
{
Expand All @@ -94,6 +97,7 @@ def writeObjects(self, objects: list, output_path: str, type: SecurityContentTyp
elif type == SecurityContentType.investigations:
obj_array = []
for investigation in objects:
investigation.id = str(investigation.id)
obj_array.append(investigation.dict(exclude_none=True))

JsonWriter.writeJsonObject(os.path.join(output_path, 'response_tasks.json'), {'response_tasks': obj_array })
Expand All @@ -111,6 +115,7 @@ def writeObjects(self, objects: list, output_path: str, type: SecurityContentTyp
elif type == SecurityContentType.deployments:
obj_array = []
for deployment in objects:
deployment.id = str(deployment.id)
obj_array.append(deployment.dict(exclude_none=True))

JsonWriter.writeJsonObject(os.path.join(output_path, 'deployments.json'), {'deployments': obj_array })

0 comments on commit fe69f2d

Please sign in to comment.