forked from p15670423/monkey
Island: Move UserCreds to models package
This commit is contained in:
parent
292887baf8
commit
8608b05c46
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -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"
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue