YueGuobin 3958279b8a
feat: add client information logging to MCP connection rejection
Add reusable utility for extracting client information from ASGI scope:
- Create gns3server/utils/request_utils.py with extract_client_info()
- Extract client IP, port, path, method, and authenticated username
- Format comprehensive log messages with client context

Benefits:
- Better observability for connection rejection events
- Reusable utility for other modules
- Consistent client logging format across codebase
- Helps diagnose timing issues during server startup

Usage:
  from gns3server.utils.request_utils import extract_client_info
  client_info = extract_client_info(scope, auth_service)
  log.warning(f"Connection rejected - Client: {client_info['host']}:{client_info['port']} ({client_info['user_info']})")
2026-06-06 22:35:43 +08:00
..
2024-11-18 11:46:42 +10:00
2021-04-13 18:46:50 +09:30
2021-04-17 18:36:32 +09:30
2023-01-05 12:38:00 +08:00
2021-12-02 18:07:09 +10:30
2026-03-05 12:38:28 +08:00
2024-04-23 16:52:28 +07:00
2021-04-13 18:46:50 +09:30
2021-04-13 18:37:58 +09:30
2021-04-13 18:46:50 +09:30