From bc7f960daa4819b060ee41ee152da15ab4876127 Mon Sep 17 00:00:00 2001 From: Cecilia Stevens <63068179+ceciliastevens@users.noreply.github.com> Date: Tue, 13 May 2025 11:14:58 -0400 Subject: [PATCH 1/4] update sessions contentinspection schema --- CHANGELOG.md | 6 +++++- src/_incydr_sdk/__version__.py | 2 +- src/_incydr_sdk/sessions/models/models.py | 7 +++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c177b94..3e57795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,11 @@ how a consumer would use the library or CLI tool (e.g. adding unit tests, updating documentation, etc) are not captured here. -## Unreleased +## 2.3.1 - 2025-05-13 + +### Fixed + +- An issue where Sessions validation would fail due to an updated content inspection schema. ### Updated diff --git a/src/_incydr_sdk/__version__.py b/src/_incydr_sdk/__version__.py index 92a0111..1d295a2 100644 --- a/src/_incydr_sdk/__version__.py +++ b/src/_incydr_sdk/__version__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2022-present Code42 Software # # SPDX-License-Identifier: MIT -__version__ = "2.3.0" +__version__ = "2.3.1" diff --git a/src/_incydr_sdk/sessions/models/models.py b/src/_incydr_sdk/sessions/models/models.py index 429e369..d4271c5 100644 --- a/src/_incydr_sdk/sessions/models/models.py +++ b/src/_incydr_sdk/sessions/models/models.py @@ -18,11 +18,10 @@ class ContentInspectionEvent(Model): class ContentInspectionResult(Model): - event_results: List[ContentInspectionEvent] = Field( - alias="eventResults", - description="List of all content inspection events that have occurred.", + detected_on_alerts: List[str] = Field( + alias="detectedOnAlerts", + description="A list of content categories or types found on events which triggered alerts." ) - status: Optional[str] class Note(Model): From 7c33ed5162180ec712590f49984fc11336422cda Mon Sep 17 00:00:00 2001 From: Cecilia Stevens <63068179+ceciliastevens@users.noreply.github.com> Date: Tue, 13 May 2025 11:16:17 -0400 Subject: [PATCH 2/4] style --- src/_incydr_sdk/sessions/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_incydr_sdk/sessions/models/models.py b/src/_incydr_sdk/sessions/models/models.py index d4271c5..c3e1801 100644 --- a/src/_incydr_sdk/sessions/models/models.py +++ b/src/_incydr_sdk/sessions/models/models.py @@ -20,7 +20,7 @@ class ContentInspectionEvent(Model): class ContentInspectionResult(Model): detected_on_alerts: List[str] = Field( alias="detectedOnAlerts", - description="A list of content categories or types found on events which triggered alerts." + description="A list of content categories or types found on events which triggered alerts.", ) From 2c854374152dd7dffee16943239a7633626bb673 Mon Sep 17 00:00:00 2001 From: Cecilia Stevens <63068179+ceciliastevens@users.noreply.github.com> Date: Tue, 13 May 2025 11:19:08 -0400 Subject: [PATCH 3/4] fix tests --- tests/test_sessions.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_sessions.py b/tests/test_sessions.py index 7562f7f..afc0d52 100644 --- a/tests/test_sessions.py +++ b/tests/test_sessions.py @@ -32,10 +32,9 @@ "actorId": TEST_SESSION_ID, "beginTime": POSIX_TS, "contentInspectionResults": { - "eventResults": [ - {"eventId": "event-id", "piiType": ["string"], "status": "PENDING"} - ], - "status": "PENDING", + "detectedOnAlerts": [ + "PII" + ] }, "contextSummary": "string", "criticalEvents": 0, From 7d416f38eda4ba3e3f70a38c89c03ea6b484edc5 Mon Sep 17 00:00:00 2001 From: Cecilia Stevens <63068179+ceciliastevens@users.noreply.github.com> Date: Tue, 13 May 2025 11:29:32 -0400 Subject: [PATCH 4/4] style --- tests/test_sessions.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_sessions.py b/tests/test_sessions.py index afc0d52..ff24e75 100644 --- a/tests/test_sessions.py +++ b/tests/test_sessions.py @@ -31,11 +31,7 @@ TEST_SESSION = { "actorId": TEST_SESSION_ID, "beginTime": POSIX_TS, - "contentInspectionResults": { - "detectedOnAlerts": [ - "PII" - ] - }, + "contentInspectionResults": {"detectedOnAlerts": ["PII"]}, "contextSummary": "string", "criticalEvents": 0, "endTime": POSIX_TS,