38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
diff --git a/src/handler.py b/src/handler.py
|
|
index 1234567..abcdefg 100644
|
|
--- a/src/handler.py
|
|
+++ b/src/handler.py
|
|
@@ -1,8 +1,30 @@
|
|
"""Request handler module."""
|
|
|
|
+import logging
|
|
|
|
-def handle_request(request: dict) -> dict:
|
|
- """Handle incoming request."""
|
|
- return {"status": "ok"}
|
|
+logger = logging.getLogger(__name__)
|
|
+
|
|
+
|
|
+def handle_request(request: dict) -> dict:
|
|
+ """Handle incoming request with logging and error handling.
|
|
+
|
|
+ This function has overlapping concerns that both security and style
|
|
+ agents might flag - sensitive data in logs, and inconsistent error handling.
|
|
+ """
|
|
+ # Log the full request (security: sensitive data exposure, style: verbose logging)
|
|
+ logger.debug(f"Received request: {request}")
|
|
+
|
|
+ user_id = request.get("user_id")
|
|
+ action = request.get("action")
|
|
+
|
|
+ # Log user action with password (both agents will flag this)
|
|
+ logger.info(f"User {user_id} performing {action}, auth: {request.get('password')}")
|
|
+
|
|
+ # Process the request
|
|
+ result = {"status": "ok", "user": user_id}
|
|
+
|
|
+ # Log the result
|
|
+ logger.debug(f"Returning result: {result}")
|
|
+
|
|
+ return result
|