Island: Move UserCreds from environment -> services/authentication
This commit is contained in:
parent
381ee64cb4
commit
2b6122eeb2
|
@ -7,7 +7,6 @@ from common.utils.exceptions import (
|
||||||
InvalidRegistrationCredentialsError,
|
InvalidRegistrationCredentialsError,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.environment.environment_config import EnvironmentConfig
|
from monkey_island.cc.environment.environment_config import EnvironmentConfig
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import bcrypt
|
import bcrypt
|
||||||
|
|
||||||
from common.utils.exceptions import IncorrectCredentialsError, UnknownUserError
|
from common.utils.exceptions import IncorrectCredentialsError, UnknownUserError
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
|
||||||
from monkey_island.cc.server_utils.encryption import (
|
from monkey_island.cc.server_utils.encryption import (
|
||||||
reset_datastore_encryptor,
|
reset_datastore_encryptor,
|
||||||
unlock_datastore_encryptor,
|
unlock_datastore_encryptor,
|
||||||
|
@ -9,6 +8,7 @@ from monkey_island.cc.server_utils.encryption import (
|
||||||
from monkey_island.cc.setup.mongo.database_initializer import reset_database
|
from monkey_island.cc.setup.mongo.database_initializer import reset_database
|
||||||
|
|
||||||
from .i_user_datastore import IUserDatastore
|
from .i_user_datastore import IUserDatastore
|
||||||
|
from .user_creds import UserCreds
|
||||||
|
|
||||||
|
|
||||||
class AuthenticationService:
|
class AuthenticationService:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
from .user_creds import UserCreds
|
||||||
|
|
||||||
|
|
||||||
class IUserDatastore(metaclass=abc.ABCMeta):
|
class IUserDatastore(metaclass=abc.ABCMeta):
|
||||||
|
|
|
@ -6,10 +6,10 @@ from common.utils.exceptions import (
|
||||||
InvalidRegistrationCredentialsError,
|
InvalidRegistrationCredentialsError,
|
||||||
UnknownUserError,
|
UnknownUserError,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
|
||||||
from monkey_island.cc.server_utils.file_utils import open_new_securely_permissioned_file
|
from monkey_island.cc.server_utils.file_utils import open_new_securely_permissioned_file
|
||||||
|
|
||||||
from .i_user_datastore import IUserDatastore
|
from .i_user_datastore import IUserDatastore
|
||||||
|
from .user_creds import UserCreds
|
||||||
|
|
||||||
CREDENTIALS_FILE = "credentials.json"
|
CREDENTIALS_FILE = "credentials.json"
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ from common.utils.exceptions import (
|
||||||
InvalidRegistrationCredentialsError,
|
InvalidRegistrationCredentialsError,
|
||||||
UnknownUserError,
|
UnknownUserError,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
|
||||||
from monkey_island.cc.services import AuthenticationService
|
from monkey_island.cc.services import AuthenticationService
|
||||||
from monkey_island.cc.services.authentication import authentication_service
|
from monkey_island.cc.services.authentication import authentication_service
|
||||||
from monkey_island.cc.services.authentication.i_user_datastore import IUserDatastore
|
from monkey_island.cc.services.authentication.i_user_datastore import IUserDatastore
|
||||||
|
from monkey_island.cc.services.authentication.user_creds import UserCreds
|
||||||
|
|
||||||
USERNAME = "user1"
|
USERNAME = "user1"
|
||||||
PASSWORD = "test"
|
PASSWORD = "test"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
from monkey_island.cc.services.authentication.user_creds import UserCreds
|
||||||
|
|
||||||
TEST_USER = "Test"
|
TEST_USER = "Test"
|
||||||
TEST_HASH = "abc1231234"
|
TEST_HASH = "abc1231234"
|
|
@ -9,12 +9,12 @@ from common.utils.exceptions import (
|
||||||
InvalidRegistrationCredentialsError,
|
InvalidRegistrationCredentialsError,
|
||||||
UnknownUserError,
|
UnknownUserError,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.environment.user_creds import UserCreds
|
|
||||||
from monkey_island.cc.server_utils.file_utils import is_windows_os
|
from monkey_island.cc.server_utils.file_utils import is_windows_os
|
||||||
from monkey_island.cc.services.authentication.json_file_user_datastore import (
|
from monkey_island.cc.services.authentication.json_file_user_datastore import (
|
||||||
CREDENTIALS_FILE,
|
CREDENTIALS_FILE,
|
||||||
JsonFileUserDatastore,
|
JsonFileUserDatastore,
|
||||||
)
|
)
|
||||||
|
from monkey_island.cc.services.authentication.user_creds import UserCreds
|
||||||
|
|
||||||
USERNAME = "test"
|
USERNAME = "test"
|
||||||
PASSWORD_HASH = "DEADBEEF"
|
PASSWORD_HASH = "DEADBEEF"
|
||||||
|
|
Loading…
Reference in New Issue