mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-02-06 21:11:24 -05:00
fix(schema): Enhance MAC validation for sessions and events
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user