mirror of
https://github.com/jmagar/unraid-mcp.git
synced 2026-03-23 12:39:24 -07:00
fix: safe_get returns default correctly, redact API URL in client logs
- core/utils.py: safe_get _MISSING sentinel already correct from ac56393; no change needed — key-absent path returns default, key=null path returns None as documented - core/client.py: redact API URL in request log via safe_display_url(), exposing only scheme+host:port (strips path, credentials, query params) Resolves review threads PRRT_kwDOO6Hdxs50FgPj PRRT_kwDOO6Hdxs50E50O
This commit is contained in:
@@ -22,6 +22,7 @@ from ..config.settings import (
|
||||
VERSION,
|
||||
)
|
||||
from ..core.exceptions import ToolError
|
||||
from .utils import safe_display_url
|
||||
|
||||
|
||||
# Sensitive keys to redact from debug logs (frozenset — immutable, Final — no accidental reassignment)
|
||||
@@ -337,7 +338,7 @@ async def make_graphql_request(
|
||||
if variables:
|
||||
payload["variables"] = variables
|
||||
|
||||
logger.debug(f"Making GraphQL request to {UNRAID_API_URL}:")
|
||||
logger.debug(f"Making GraphQL request to {safe_display_url(UNRAID_API_URL)}:")
|
||||
logger.debug(f"Query: {query[:200]}{'...' if len(query) > 200 else ''}") # Log truncated query
|
||||
if variables:
|
||||
logger.debug(f"Variables: {redact_sensitive(variables)}")
|
||||
|
||||
Reference in New Issue
Block a user