Merge pull request #2171 from guardicore/2152-refactor-auth-resource

2152 refactor auth resource
This commit is contained in:
ilija-lazoroski 2022-08-05 10:43:03 +02:00 committed by GitHub
commit 816b677f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 7 deletions

View File

@ -23,9 +23,7 @@ from monkey_island.cc.resources.AbstractResource import AbstractResource
from monkey_island.cc.resources.agent_configuration import AgentConfiguration from monkey_island.cc.resources.agent_configuration import AgentConfiguration
from monkey_island.cc.resources.agent_controls import StopAgentCheck, StopAllAgents from monkey_island.cc.resources.agent_controls import StopAgentCheck, StopAllAgents
from monkey_island.cc.resources.attack.attack_report import AttackReport from monkey_island.cc.resources.attack.attack_report import AttackReport
from monkey_island.cc.resources.auth.authenticate import Authenticate, init_jwt from monkey_island.cc.resources.auth import Authenticate, Register, RegistrationStatus, init_jwt
from monkey_island.cc.resources.auth.register import Register
from monkey_island.cc.resources.auth.registration_status import RegistrationStatus
from monkey_island.cc.resources.blackbox.log_blackbox_endpoint import LogBlackboxEndpoint from monkey_island.cc.resources.blackbox.log_blackbox_endpoint import LogBlackboxEndpoint
from monkey_island.cc.resources.blackbox.monkey_blackbox_endpoint import MonkeyBlackboxEndpoint from monkey_island.cc.resources.blackbox.monkey_blackbox_endpoint import MonkeyBlackboxEndpoint
from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import ( from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import (

View File

@ -0,0 +1,3 @@
from .authenticate import Authenticate, init_jwt
from .register import Register
from .registration_status import RegistrationStatus

View File

@ -4,7 +4,7 @@ from unittest.mock import MagicMock
import pytest import pytest
from common.utils.exceptions import IncorrectCredentialsError from common.utils.exceptions import IncorrectCredentialsError
from monkey_island.cc.resources.auth.authenticate import Authenticate from monkey_island.cc.resources.auth import Authenticate
USERNAME = "test_user" USERNAME = "test_user"
PASSWORD = "test_password" PASSWORD = "test_password"

View File

@ -4,7 +4,7 @@ from unittest.mock import MagicMock
import pytest import pytest
from common.utils.exceptions import AlreadyRegisteredError, InvalidRegistrationCredentialsError from common.utils.exceptions import AlreadyRegisteredError, InvalidRegistrationCredentialsError
from monkey_island.cc.resources.auth.register import Register from monkey_island.cc.resources.auth import Register
REGISTRATION_URL = Register.urls[0] REGISTRATION_URL = Register.urls[0]

View File

@ -2,7 +2,7 @@ from unittest.mock import MagicMock
import pytest import pytest
from monkey_island.cc.resources.auth.registration_status import RegistrationStatus from monkey_island.cc.resources.auth import RegistrationStatus
REGISTRATION_STATUS_URL = RegistrationStatus.urls[0] REGISTRATION_STATUS_URL = RegistrationStatus.urls[0]

View File

@ -7,7 +7,7 @@ from tests.monkey_island import OpenErrorFileRepository
from tests.unit_tests.monkey_island.conftest import init_mock_app from tests.unit_tests.monkey_island.conftest import init_mock_app
import monkey_island.cc.app import monkey_island.cc.app
import monkey_island.cc.resources.auth.authenticate import monkey_island.cc.resources.auth
import monkey_island.cc.resources.island_mode import monkey_island.cc.resources.island_mode
from monkey_island.cc.repository import IFileRepository from monkey_island.cc.repository import IFileRepository