Common: Make Credentials.Config a subclass of InfectionMonkeyModelConfig
This commit is contained in:
parent
729d2beee8
commit
004a543310
|
@ -4,7 +4,7 @@ from typing import Optional, Union
|
||||||
|
|
||||||
from pydantic import SecretBytes, SecretStr
|
from pydantic import SecretBytes, SecretStr
|
||||||
|
|
||||||
from ..base_models import InfectionMonkeyBaseModel
|
from ..base_models import InfectionMonkeyBaseModel, InfectionMonkeyModelConfig
|
||||||
from . import LMHash, NTHash, Password, SSHKeypair, Username
|
from . import LMHash, NTHash, Password, SSHKeypair, Username
|
||||||
|
|
||||||
Secret = Union[Password, LMHash, NTHash, SSHKeypair]
|
Secret = Union[Password, LMHash, NTHash, SSHKeypair]
|
||||||
|
@ -27,7 +27,7 @@ class Credentials(InfectionMonkeyBaseModel):
|
||||||
secret: Optional[Secret]
|
secret: Optional[Secret]
|
||||||
"""Secret part of credentials, like a password or a hash"""
|
"""Secret part of credentials, like a password or a hash"""
|
||||||
|
|
||||||
class Config:
|
class Config(InfectionMonkeyModelConfig):
|
||||||
json_encoders = {
|
json_encoders = {
|
||||||
# This makes secrets dumpable to json, but not loggable
|
# This makes secrets dumpable to json, but not loggable
|
||||||
SecretStr: get_plaintext,
|
SecretStr: get_plaintext,
|
||||||
|
|
Loading…
Reference in New Issue