From c2f3def33baa28fc557ba74e88464593ca405b97 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 23 Sep 2022 08:42:32 -0400 Subject: [PATCH] Island: Use IPv4Address in resources.IPAddresses --- monkey/monkey_island/cc/resources/ip_addresses.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/resources/ip_addresses.py b/monkey/monkey_island/cc/resources/ip_addresses.py index 3ba7d6123..8bd6a8b97 100644 --- a/monkey/monkey_island/cc/resources/ip_addresses.py +++ b/monkey/monkey_island/cc/resources/ip_addresses.py @@ -1,3 +1,4 @@ +from ipaddress import IPv4Address from typing import Sequence from monkey_island.cc.resources.AbstractResource import AbstractResource @@ -11,8 +12,8 @@ class IPAddresses(AbstractResource): urls = ["/api/island/ip-addresses"] - def __init__(self, ip_addresses: Sequence[str]): - self._ips = ip_addresses + def __init__(self, ip_addresses: Sequence[IPv4Address]): + self._ips = list(map(str, ip_addresses)) @jwt_required def get(self) -> Sequence[str]: