mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -07: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=[{
|
path_params=[{
|
||||||
"name": "mac",
|
"name": "mac",
|
||||||
"description": "Device MAC address",
|
"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,
|
request_model=CreateEventRequest,
|
||||||
response_model=BaseResponse,
|
response_model=BaseResponse,
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ class SessionInfo(BaseModel):
|
|||||||
|
|
||||||
class CreateSessionRequest(BaseModel):
|
class CreateSessionRequest(BaseModel):
|
||||||
"""Request to create a session."""
|
"""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")
|
ip: str = Field(..., description="Device IP")
|
||||||
start_time: str = Field(..., description="Start time")
|
start_time: str = Field(..., description="Start time")
|
||||||
end_time: Optional[str] = Field(None, description="End time")
|
end_time: Optional[str] = Field(None, description="End time")
|
||||||
|
|||||||
Reference in New Issue
Block a user