#2888: Add identifier keyword to services.

This commit is contained in:
Nick Todd
2024-12-11 10:12:50 +00:00
parent 66f775da4d
commit 4050bd9e85
11 changed files with 11 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ class WebBrowser(Application, identifier="WebBrowser"):
class ConfigSchema(Application.ConfigSchema): class ConfigSchema(Application.ConfigSchema):
"""ConfigSchema for WebBrowser.""" """ConfigSchema for WebBrowser."""
type: str = "WEB_BROWSER" type: str = "WEBBROWSER"
def __init__(self, **kwargs): def __init__(self, **kwargs):
kwargs["name"] = "WebBrowser" kwargs["name"] = "WebBrowser"

View File

@@ -14,7 +14,7 @@ from primaite.utils.validation.ipv4_address import IPV4Address
from primaite.utils.validation.port import PORT_LOOKUP from primaite.utils.validation.port import PORT_LOOKUP
class ARP(Service): class ARP(Service, identifier="ARP"):
""" """
The ARP (Address Resolution Protocol) Service. The ARP (Address Resolution Protocol) Service.

View File

@@ -17,7 +17,7 @@ from primaite.utils.validation.port import PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class DatabaseService(Service): class DatabaseService(Service, identifier="DatabaseService"):
""" """
A class for simulating a generic SQL Server service. A class for simulating a generic SQL Server service.

View File

@@ -13,7 +13,7 @@ from primaite.utils.validation.port import PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class DNSServer(Service): class DNSServer(Service, identifier="DNSServer"):
"""Represents a DNS Server as a Service.""" """Represents a DNS Server as a Service."""
config: "DNSServer.ConfigSchema" config: "DNSServer.ConfigSchema"

View File

@@ -16,7 +16,7 @@ from primaite.utils.validation.port import Port, PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class FTPClient(FTPServiceABC): class FTPClient(FTPServiceABC, identifier="FTPClient"):
""" """
A class for simulating an FTP client service. A class for simulating an FTP client service.

View File

@@ -11,7 +11,7 @@ from primaite.utils.validation.port import is_valid_port, PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class FTPServer(FTPServiceABC): class FTPServer(FTPServiceABC, identifier="FTPServer"):
""" """
A class for simulating an FTP server service. A class for simulating an FTP server service.

View File

@@ -14,7 +14,7 @@ from primaite.utils.validation.port import PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class ICMP(Service): class ICMP(Service, identifier="ICMP"):
""" """
The Internet Control Message Protocol (ICMP) service. The Internet Control Message Protocol (ICMP) service.

View File

@@ -12,7 +12,7 @@ from primaite.utils.validation.port import Port, PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class NTPClient(Service): class NTPClient(Service, identifier="NTPClient"):
"""Represents a NTP client as a service.""" """Represents a NTP client as a service."""
config: "NTPClient.ConfigSchema" config: "NTPClient.ConfigSchema"

View File

@@ -11,7 +11,7 @@ from primaite.utils.validation.port import PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class NTPServer(Service): class NTPServer(Service, identifier="NTPServer"):
"""Represents a NTP server as a service.""" """Represents a NTP server as a service."""
config: "NTPServer.ConfigSchema" config: "NTPServer.ConfigSchema"

View File

@@ -129,7 +129,7 @@ class RemoteTerminalConnection(TerminalClientConnection):
return self.parent_terminal.send(payload=payload, session_id=self.ssh_session_id) return self.parent_terminal.send(payload=payload, session_id=self.ssh_session_id)
class Terminal(Service): class Terminal(Service, identifier="Terminal"):
"""Class used to simulate a generic terminal service. Can be interacted with by other terminals via SSH.""" """Class used to simulate a generic terminal service. Can be interacted with by other terminals via SSH."""
config: "Terminal.ConfigSchema" config: "Terminal.ConfigSchema"

View File

@@ -19,7 +19,7 @@ from primaite.utils.validation.port import Port, PORT_LOOKUP
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
class WebServer(Service): class WebServer(Service, identifier="WebServer"):
"""Class used to represent a Web Server Service in simulation.""" """Class used to represent a Web Server Service in simulation."""
config: "WebServer.ConfigSchema" config: "WebServer.ConfigSchema"