fix(schema): Enhance MAC validation for sessions and events

This commit is contained in:
Adam Outler
2026-02-02 23:19:14 +01:00
parent f43517b9a5
commit 9ca5375652
2 changed files with 2 additions and 2 deletions

View File

@@ -1385,7 +1385,7 @@ def api_add_to_execution_queue(payload=None):
path_params=[{
"name": "mac",
"description": "Device MAC address",
"schema": {"type": "string"}
"schema": {"type": "string", "pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"}
}],
request_model=CreateEventRequest,
response_model=BaseResponse,

View File

@@ -719,7 +719,7 @@ class SessionInfo(BaseModel):
class CreateSessionRequest(BaseModel):
"""Request to create a session."""
mac: str = Field(..., description="Device MAC")
mac: str = Field(..., description="Device MAC", pattern=MAC_PATTERN)
ip: str = Field(..., description="Device IP")
start_time: str = Field(..., description="Start time")
end_time: Optional[str] = Field(None, description="End time")