@cryptotaxi247 / CoPilot / commits / eb850cb0

fix(wazuh-manager): tolerate missing group checksum fields across Wazuh versions (#885) (#888)

WazuhGroup required both mergedSum and configSum, but the /groups endpoint returns different checksum fields depending on the Wazuh version: 4.9.0 returns only configSum, while other builds still return mergedSum. The required fields caused a Pydantic validation error ("Field required ... mergedSum") on 4.9.0, breaking group listing. Make both mergedSum and configSum Optional, matching the parallel model in app/integrations/utils/schema.py. Nothing downstream consumes these fields and the model already has extra="ignore", so this is safe and version-tolerant. Fixes #885 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

taylor_socfortress committed May 27, 2026 at 14:20 UTC eb850cb0d7c2c5661da340bc0a37faab684f32da
1 file changed +5 -2
backend/app/connectors/wazuh_manager/schema/groups.py
+5 -2
@@ -12,8 +12,11 @@ class WazuhGroup(BaseModel):
12
13 name: str = Field(..., description="Group name")
14 count: int = Field(..., description="Number of agents belonging to the group")
15 - mergedSum: str = Field(..., description="Checksum of merged configuration files")
16 - configSum: str = Field(..., description="Checksum of configuration files")
15 + # Both checksum fields vary by Wazuh version: 4.9.0 returns only configSum, while
16 + # other builds still return mergedSum. Keep them optional so the connector tolerates
17 + # any Wazuh version (mirrors app/integrations/utils/schema.py). See issue #885.
18 + mergedSum: Optional[str] = Field(None, description="Checksum of merged configuration files")
19 + configSum: Optional[str] = Field(None, description="Checksum of configuration files")
20 model_config = ConfigDict(extra="ignore")
21
22