fix: shield_update PATCH 메서드 수정 + client.py patch() 추가 + Bot Detection/Access Lists 도구
All checks were successful
CI / build (push) Successful in 42s

This commit is contained in:
kappa
2026-04-13 10:29:06 +09:00
parent b072736d30
commit f5e9b7850c
2 changed files with 11 additions and 1 deletions

View File

@@ -34,6 +34,15 @@ class BunnyClient:
)
return self._handle(resp)
async def patch(self, path: str, json: dict | None = None) -> dict | list | str:
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as c:
resp = await c.patch(
f"{self._base}{path}",
headers=self._headers,
json=json,
)
return self._handle(resp)
async def put(self, path: str, json: dict | None = None) -> dict | list | str:
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as c:
resp = await c.put(

View File

@@ -90,7 +90,8 @@ def register_shield_tools(mcp):
except json.JSONDecodeError as e:
return f"Error: Invalid JSON: {e}"
try:
data = await client.put(f"/shield/shield-zone/{shield_zone_id}", json=parsed)
body = {"shieldZoneId": shield_zone_id, "shieldZone": parsed}
data = await client.patch("/shield/shield-zone", json=body)
return json.dumps(data, indent=2) if isinstance(data, dict) else f"Shield zone {shield_zone_id} updated"
except Exception as e:
logger.error("bunny_shield_update failed: %s", e)