|
122 | 122 |
|
123 | 123 | from functools import cached_property |
124 | 124 | from types import MappingProxyType |
125 | | -from typing import Optional, Union |
| 125 | +from typing import cast |
126 | 126 | from zoneinfo import ZoneInfo |
127 | 127 |
|
128 | 128 | from attrs import asdict, define, field, fields, validators |
@@ -181,11 +181,11 @@ class Config(Rule.Config): # pylint: disable=too-many-instance-attributes |
181 | 181 | which can be configured in the pipeline for the pre_detector. |
182 | 182 | If this field was specified, then the rule will *only* trigger in case one of |
183 | 183 | the IPs from the list is also available in the specified fields.""" |
184 | | - sigma_fields: Union[list, bool] = field( |
| 184 | + sigma_fields: list | bool = field( |
185 | 185 | validator=validators.instance_of((list, bool)), factory=list |
186 | 186 | ) |
187 | 187 | """tbd""" |
188 | | - link: Optional[str] = field( |
| 188 | + link: str | None = field( |
189 | 189 | validator=validators.optional(validators.instance_of(str)), default=None |
190 | 190 | ) |
191 | 191 | """A link to the rule if applicable.""" |
@@ -229,7 +229,7 @@ class Config(Rule.Config): # pylint: disable=too-many-instance-attributes |
229 | 229 | @property |
230 | 230 | def config(self) -> Config: |
231 | 231 | """Provides the properly typed rule configuration object""" |
232 | | - return self._config |
| 232 | + return cast("PreDetectorRule.Config", self._config) |
233 | 233 |
|
234 | 234 | def __eq__(self, other: object) -> bool: |
235 | 235 | if not isinstance(other, PreDetectorRule): |
|
0 commit comments