Common: Fix type hint for variable-length homogeneous tuples

See https://docs.python.org/3/library/typing.html#typing.Tuple
This commit is contained in:
Mike Salvatore 2022-07-26 10:42:20 -04:00
parent eaeb78a821
commit 7be4ea2893
2 changed files with 11 additions and 11 deletions

View File

@ -34,9 +34,9 @@ class InvalidConfigurationError(Exception):
class AgentConfiguration: class AgentConfiguration:
keep_tunnel_open_time: float keep_tunnel_open_time: float
custom_pbas: CustomPBAConfiguration custom_pbas: CustomPBAConfiguration
post_breach_actions: Tuple[PluginConfiguration] post_breach_actions: Tuple[PluginConfiguration, ...]
credential_collectors: Tuple[PluginConfiguration] credential_collectors: Tuple[PluginConfiguration, ...]
payloads: Tuple[PluginConfiguration] payloads: Tuple[PluginConfiguration, ...]
propagation: PropagationConfiguration propagation: PropagationConfiguration
def __post_init__(self): def __post_init__(self):

View File

@ -18,10 +18,10 @@ class PluginConfiguration:
@dataclass(frozen=True) @dataclass(frozen=True)
class ScanTargetConfiguration: class ScanTargetConfiguration:
blocked_ips: Tuple[str] blocked_ips: Tuple[str, ...]
inaccessible_subnets: Tuple[str] inaccessible_subnets: Tuple[str, ...]
local_network_scan: bool local_network_scan: bool
subnets: Tuple[str] subnets: Tuple[str, ...]
@dataclass(frozen=True) @dataclass(frozen=True)
@ -32,27 +32,27 @@ class ICMPScanConfiguration:
@dataclass(frozen=True) @dataclass(frozen=True)
class TCPScanConfiguration: class TCPScanConfiguration:
timeout: float timeout: float
ports: Tuple[int] ports: Tuple[int, ...]
@dataclass(frozen=True) @dataclass(frozen=True)
class NetworkScanConfiguration: class NetworkScanConfiguration:
tcp: TCPScanConfiguration tcp: TCPScanConfiguration
icmp: ICMPScanConfiguration icmp: ICMPScanConfiguration
fingerprinters: Tuple[PluginConfiguration] fingerprinters: Tuple[PluginConfiguration, ...]
targets: ScanTargetConfiguration targets: ScanTargetConfiguration
@dataclass(frozen=True) @dataclass(frozen=True)
class ExploitationOptionsConfiguration: class ExploitationOptionsConfiguration:
http_ports: Tuple[int] http_ports: Tuple[int, ...]
@dataclass(frozen=True) @dataclass(frozen=True)
class ExploitationConfiguration: class ExploitationConfiguration:
options: ExploitationOptionsConfiguration options: ExploitationOptionsConfiguration
brute_force: Tuple[PluginConfiguration] brute_force: Tuple[PluginConfiguration, ...]
vulnerability: Tuple[PluginConfiguration] vulnerability: Tuple[PluginConfiguration, ...]
@dataclass(frozen=True) @dataclass(frozen=True)