From 59ef3b1ecc209a3731a44526962cbe5d6f03a4bc Mon Sep 17 00:00:00 2001 From: pyth0n1c <87383215+pyth0n1c@users.noreply.github.com> Date: Wed, 25 Feb 2026 08:16:25 -0800 Subject: [PATCH 1/3] Error if the date field is in the future. It must be today or earlier. Note that today/now is relative to UTC. --- .../security_content_object_abstract.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py b/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py index 6eea44b6..5e777dad 100644 --- a/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py +++ b/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py @@ -492,6 +492,26 @@ class SecurityContentObject_Abstract(BaseModel, abc.ABC): "limitations in Type Checking." ) + + @field_validator("date", mode="after") + @classmethod + def ensure_date_is_not_in_future(cls, value: datetime.date) -> datetime.date: + """Ensure that the date is not in the future. + Args: + value (datetime.date): The date of the content, read from the YML. + Raises: + ValueError: The date of the content is in the future. + Returns: + datetime.date: The validated date of the content, read from the YML. + """ + todays_date = datetime.datetime.now(datetime.UTC).date() + if value > todays_date: + raise ValueError( + f"Content date [{value}], is in the future. The date of content must be today ({todays_date}) or earlier. " + "Note that this date is relative to UTC, not your current locale." + ) + return value + def checkDeprecationInfo( self, app: CustomApp, deprecation_info: DeprecationInfoInFile | None ): From d9a364bf8915697ac826b79df9542a6abb0fee0b Mon Sep 17 00:00:00 2001 From: pyth0n1c <87383215+pyth0n1c@users.noreply.github.com> Date: Wed, 25 Feb 2026 08:19:22 -0800 Subject: [PATCH 2/3] bump version for release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 904308f4..a919b670 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "contentctl" -version = "5.5.14" +version = "5.5.15" description = "Splunk Content Control Tool" authors = ["STRT "] From e92d8c0ed67f49d10ebe1f6b39023cf11ec1a75e Mon Sep 17 00:00:00 2001 From: Eric McGinnis Date: Wed, 25 Feb 2026 08:31:07 -0800 Subject: [PATCH 3/3] run ruff formatter --- .../security_content_object_abstract.py | 1 - 1 file changed, 1 deletion(-) diff --git a/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py b/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py index 5e777dad..02f1cd1d 100644 --- a/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py +++ b/contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py @@ -492,7 +492,6 @@ class SecurityContentObject_Abstract(BaseModel, abc.ABC): "limitations in Type Checking." ) - @field_validator("date", mode="after") @classmethod def ensure_date_is_not_in_future(cls, value: datetime.date) -> datetime.date: