Island: Move UserCreds to models package

This commit is contained in:
Mike Salvatore 2022-07-12 08:53:56 -04:00
parent 292887baf8
commit 8608b05c46
8 changed files with 7 additions and 8 deletions

View File

@ -9,3 +9,4 @@ from .pba_results import PbaResults
from monkey_island.cc.models.report.report import Report
from .stolen_credentials import StolenCredentials
from .simulation import Simulation, SimulationSchema, IslandMode
from .user_credentials import UserCreds

View File

@ -1,6 +1,6 @@
import abc
from monkey_island.cc.services.authentication.user_creds import UserCreds
from monkey_island.cc.models import UserCreds
class IUserRepository(metaclass=abc.ABCMeta):

View File

@ -7,6 +7,7 @@ from common.utils.exceptions import (
InvalidRegistrationCredentialsError,
UnknownUserError,
)
from monkey_island.cc.models import UserCreds
from monkey_island.cc.repository import IUserRepository
from monkey_island.cc.server_utils.encryption import (
reset_datastore_encryptor,
@ -14,8 +15,6 @@ from monkey_island.cc.server_utils.encryption import (
)
from monkey_island.cc.setup.mongo.database_initializer import reset_database
from .user_creds import UserCreds
class AuthenticationService:
def __init__(self, data_dir: Path, user_datastore: IUserRepository):

View File

@ -6,11 +6,10 @@ from common.utils.exceptions import (
InvalidRegistrationCredentialsError,
UnknownUserError,
)
from monkey_island.cc.models import UserCreds
from monkey_island.cc.repository import IUserRepository
from monkey_island.cc.server_utils.file_utils import open_new_securely_permissioned_file
from .user_creds import UserCreds
CREDENTIALS_FILE = "credentials.json"

View File

@ -1,4 +1,4 @@
from monkey_island.cc.services.authentication.user_creds import UserCreds
from monkey_island.cc.models import UserCreds
TEST_USER = "Test"
TEST_HASH = "abc1231234"

View File

@ -8,10 +8,10 @@ from common.utils.exceptions import (
InvalidRegistrationCredentialsError,
UnknownUserError,
)
from monkey_island.cc.models import UserCreds
from monkey_island.cc.repository import IUserRepository
from monkey_island.cc.services import AuthenticationService
from monkey_island.cc.services.authentication import authentication_service
from monkey_island.cc.services.authentication.user_creds import UserCreds
USERNAME = "user1"
PASSWORD = "test"

View File

@ -9,12 +9,12 @@ from common.utils.exceptions import (
InvalidRegistrationCredentialsError,
UnknownUserError,
)
from monkey_island.cc.models import UserCreds
from monkey_island.cc.server_utils.file_utils import is_windows_os
from monkey_island.cc.services.authentication.json_file_user_datastore import (
CREDENTIALS_FILE,
JSONFileUserRepository,
)
from monkey_island.cc.services.authentication.user_creds import UserCreds
USERNAME = "test"
PASSWORD_HASH = "DEADBEEF"