import logging from urllib.parse import urljoin from urllib.request import Request from defence360agent.api.server import API, APIError from defence360agent.internals.iaid import ( IndependentAgentIDAPI, IAIDTokenError, ) logger = logging.getLogger(__name__) class CleanupRevertAPI(API): URL = urljoin(API._BASE_URL, "/api/cleanup/revert") @classmethod async def paths(cls): try: token = await IndependentAgentIDAPI.get_token() except IAIDTokenError: return [] request = Request(cls.URL, headers={"X-Auth": token}) try: result = await cls.async_request(request) except APIError as exc: logger.warning("Failed to fetch cleanup revert data: %s", exc) return [] return result["paths"]
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 2.74 KB | 0644 |
|
cleanup_revert.py | File | 817 B | 0644 |
|
events.py | File | 1.82 KB | 0644 |
|
reputation.py | File | 2.24 KB | 0644 |
|
send_message.py | File | 3.14 KB | 0644 |
|