forked from p15670423/monkey
Agent: Rename IslandAPIClient -> HTTPIslandAPIClient
This commit is contained in:
parent
6d5503bd6e
commit
43d6ebcc15
|
@ -5,4 +5,4 @@ from .island_api_client_errors import (
|
||||||
IslandAPITimeoutError,
|
IslandAPITimeoutError,
|
||||||
)
|
)
|
||||||
from .i_island_api_client import IIslandAPIClient
|
from .i_island_api_client import IIslandAPIClient
|
||||||
from .island_api_client import IslandAPIClient
|
from .http_island_api_client import HTTPIslandAPIClient
|
||||||
|
|
|
@ -4,12 +4,12 @@ import requests
|
||||||
|
|
||||||
from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT
|
from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT
|
||||||
|
|
||||||
from . import IslandAPIConnectionError, IslandAPIError, IslandAPITimeoutError
|
from . import IIslandAPIClient, IslandAPIConnectionError, IslandAPIError, IslandAPITimeoutError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class IslandAPIClient:
|
class HTTPIslandAPIClient(IIslandAPIClient):
|
||||||
"""
|
"""
|
||||||
A client for requests from the Agent to the Island API
|
A client for requests from the Agent to the Island API
|
||||||
"""
|
"""
|
|
@ -3,7 +3,7 @@ import requests
|
||||||
import requests_mock
|
import requests_mock
|
||||||
|
|
||||||
from infection_monkey.island_api_client import (
|
from infection_monkey.island_api_client import (
|
||||||
IslandAPIClient,
|
HTTPIslandAPIClient,
|
||||||
IslandAPIConnectionError,
|
IslandAPIConnectionError,
|
||||||
IslandAPIError,
|
IslandAPIError,
|
||||||
IslandAPITimeoutError,
|
IslandAPITimeoutError,
|
||||||
|
@ -27,4 +27,4 @@ def test_island_api_client(actual_error, expected_error):
|
||||||
m.get(ISLAND_URI, exc=actual_error)
|
m.get(ISLAND_URI, exc=actual_error)
|
||||||
|
|
||||||
with pytest.raises(expected_error):
|
with pytest.raises(expected_error):
|
||||||
IslandAPIClient(SERVER)
|
HTTPIslandAPIClient(SERVER)
|
|
@ -9,8 +9,11 @@ from common.agent_configuration.agent_sub_configurations import (
|
||||||
)
|
)
|
||||||
from common.credentials import Credentials, LMHash, NTHash
|
from common.credentials import Credentials, LMHash, NTHash
|
||||||
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
|
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
|
||||||
from infection_monkey.island_api_client import IIslandAPIClient
|
from infection_monkey.island_api_client import (
|
||||||
from infection_monkey.transport import IslandAPIClient, IslandAPIRequestFailedError
|
HTTPIslandAPIClient,
|
||||||
|
IIslandAPIClient,
|
||||||
|
IslandAPIRequestFailedError,
|
||||||
|
)
|
||||||
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
|
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
|
||||||
from monkey_island.cc.models import Report
|
from monkey_island.cc.models import Report
|
||||||
from monkey_island.cc.models.networkmap import Arc, NetworkMap
|
from monkey_island.cc.models.networkmap import Arc, NetworkMap
|
||||||
|
@ -333,5 +336,5 @@ IslandEventTopic.RESET_AGENT_CONFIGURATION
|
||||||
|
|
||||||
# TODO: Remove after #2292 is closed
|
# TODO: Remove after #2292 is closed
|
||||||
IIslandAPIClient
|
IIslandAPIClient
|
||||||
IslandAPIClient
|
HTTPIslandAPIClient
|
||||||
IslandAPIRequestFailedError
|
IslandAPIRequestFailedError
|
||||||
|
|
Loading…
Reference in New Issue