forked from p15670423/monkey
Agent: rename CredentialTypes enum to CredentialType
This commit is contained in:
parent
02cdebb88b
commit
9037dfdf99
|
@ -1,10 +1,10 @@
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from ..credential_types import CredentialTypes
|
from ..credential_type import CredentialType
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ICredentialComponent(ABC):
|
class ICredentialComponent(ABC):
|
||||||
type: CredentialTypes
|
type: CredentialType
|
||||||
content: dict
|
content: dict
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from ..credential_types import CredentialTypes
|
from ..credential_type import CredentialType
|
||||||
from .i_credential_component import ICredentialComponent
|
from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
|
|
||||||
class Password(ICredentialComponent):
|
class Password(ICredentialComponent):
|
||||||
def __init__(self, password: str):
|
def __init__(self, password: str):
|
||||||
super().__init__(type=CredentialTypes.PASSWORD, content={"password": password})
|
super().__init__(type=CredentialType.PASSWORD, content={"password": password})
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from ..credential_types import CredentialTypes
|
from ..credential_type import CredentialType
|
||||||
from .i_credential_component import ICredentialComponent
|
from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
|
|
||||||
class SSHKeypair(ICredentialComponent):
|
class SSHKeypair(ICredentialComponent):
|
||||||
def __init__(self, content: dict):
|
def __init__(self, content: dict):
|
||||||
super().__init__(type=CredentialTypes.SSH_KEYPAIR, content=content)
|
super().__init__(type=CredentialType.SSH_KEYPAIR, content=content)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from ..credential_types import CredentialTypes
|
from ..credential_type import CredentialType
|
||||||
from .i_credential_component import ICredentialComponent
|
from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
|
|
||||||
class Username(ICredentialComponent):
|
class Username(ICredentialComponent):
|
||||||
def __init__(self, username: str):
|
def __init__(self, username: str):
|
||||||
super().__init__(type=CredentialTypes.USERNAME, content={"username": username})
|
super().__init__(type=CredentialType.USERNAME, content={"username": username})
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class CredentialTypes(Enum):
|
class CredentialType(Enum):
|
||||||
SSH_KEYPAIR = 1
|
SSH_KEYPAIR = 1
|
||||||
USERNAME = 2
|
USERNAME = 2
|
||||||
PASSWORD = 3
|
PASSWORD = 3
|
Loading…
Reference in New Issue