From e20b58e65be5d9edcde1206da6ed131e3ffa04d2 Mon Sep 17 00:00:00 2001 From: Ailin Yu Date: Fri, 27 Sep 2024 11:26:08 -0700 Subject: [PATCH] chore: RuleModuleYamlSpec placeholder --- python/lib/sift_py/ingestion/config/yaml/load.py | 3 ++- python/lib/sift_py/ingestion/config/yaml/spec.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/python/lib/sift_py/ingestion/config/yaml/load.py b/python/lib/sift_py/ingestion/config/yaml/load.py index 1f1879cf..18367cb9 100644 --- a/python/lib/sift_py/ingestion/config/yaml/load.py +++ b/python/lib/sift_py/ingestion/config/yaml/load.py @@ -12,6 +12,7 @@ ChannelEnumTypeYamlSpec, FlowYamlSpec, RuleYamlSpec, + RuleModuleYamlSpec, TelemetryConfigYamlSpec, ) from sift_py.ingestion.rule.config import RuleActionAnnotationKind @@ -167,7 +168,7 @@ def _validate_yaml(raw_config: Dict[Any, Any]) -> TelemetryConfigYamlSpec: raise YamlConfigError._invalid_property( rules, "rules", - f"List[{_type_fqn(RuleYamlSpec)}]", + f"List[{_type_fqn(RuleYamlSpec)}] or List[{_type_fqn(RuleModuleYamlSpec)}]", None, ) diff --git a/python/lib/sift_py/ingestion/config/yaml/spec.py b/python/lib/sift_py/ingestion/config/yaml/spec.py index 4a024c91..11c229bd 100644 --- a/python/lib/sift_py/ingestion/config/yaml/spec.py +++ b/python/lib/sift_py/ingestion/config/yaml/spec.py @@ -90,6 +90,15 @@ class FlowYamlSpec(TypedDict): channels: List[ChannelConfigYamlSpec] +class RuleModuleYamlSpec(TypedDict): + """ + TODO: A nice docstring + """ + name: str + namespace: str + channel_references: NotRequired[List[Dict[str, ChannelConfigYamlSpec]]] + + class RuleYamlSpec(TypedDict): """ The formal definition of what a single rule looks like in YAML.