Skip to content

Commit cbfea07

Browse files
committed
moving pre-registration
1 parent 3111358 commit cbfea07

30 files changed

+76
-81
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/webserver_login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
from aiohttp.test_utils import TestClient
77
from servicelib.aiohttp import status
8-
from simcore_service_webserver.login._constants import MSG_LOGGED_IN
98
from simcore_service_webserver.login._invitations_service import create_invitation_token
109
from simcore_service_webserver.login._login_repository_legacy import (
1110
get_plugin_storage,
1211
)
12+
from simcore_service_webserver.login.constants import MSG_LOGGED_IN
1313
from simcore_service_webserver.security import security_service
1414
from yarl import URL
1515

services/web/server/src/simcore_service_webserver/login/_auth_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from ..products.models import Product
1313
from ..security import security_service
1414
from . import _login_service
15-
from ._constants import MSG_UNKNOWN_EMAIL, MSG_WRONG_PASSWORD
1615
from ._login_repository_legacy import AsyncpgStorage, get_plugin_storage
16+
from .constants import MSG_UNKNOWN_EMAIL, MSG_WRONG_PASSWORD
1717

1818

1919
async def get_user_by_email(app: web.Application, *, email: str) -> dict[str, Any]:

services/web/server/src/simcore_service_webserver/login/_controller/rest/_rest_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
to_exceptions_handlers_map,
99
)
1010
from ....users.exceptions import AlreadyPreRegisteredError
11-
from ..._constants import MSG_2FA_UNAVAILABLE
11+
from ...constants import MSG_2FA_UNAVAILABLE
1212
from ...errors import SendingVerificationEmailError, SendingVerificationSmsError
1313

1414
_TO_HTTP_ERROR_MAP: ExceptionToHttpErrorMap = {

services/web/server/src/simcore_service_webserver/login/_controller/rest/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
from ....users import preferences_api as user_preferences_api
2424
from ....utils_aiohttp import NextPage
2525
from ... import _auth_service, _login_service, _security_service, _twofa_service
26-
from ..._constants import (
26+
from ..._models import InputSchema
27+
from ...constants import (
2728
CODE_2FA_EMAIL_CODE_REQUIRED,
2829
CODE_2FA_SMS_CODE_REQUIRED,
2930
CODE_PHONE_NUMBER_REQUIRED,
@@ -37,7 +38,6 @@
3738
MSG_WRONG_2FA_CODE__EXPIRED,
3839
MSG_WRONG_2FA_CODE__INVALID,
3940
)
40-
from ..._models import InputSchema
4141
from ...decorators import login_required
4242
from ...settings import LoginSettingsForProduct, get_plugin_settings
4343
from ._rest_exceptions import handle_rest_requests_exceptions

services/web/server/src/simcore_service_webserver/login/_controller/rest/change.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
from ....utils import HOUR
2020
from ....utils_rate_limiting import global_rate_limit_route
2121
from ... import _confirmation_service, _confirmation_web
22-
from ..._constants import (
23-
MSG_CANT_SEND_MAIL,
24-
MSG_CHANGE_EMAIL_REQUESTED,
25-
MSG_EMAIL_SENT,
26-
MSG_OFTEN_RESET_PASSWORD,
27-
MSG_PASSWORD_CHANGED,
28-
MSG_WRONG_PASSWORD,
29-
)
3022
from ..._emails_service import get_template_path, send_email_from_template
3123
from ..._login_repository_legacy import AsyncpgStorage, get_plugin_storage
3224
from ..._login_service import (
@@ -36,6 +28,14 @@
3628
validate_user_status,
3729
)
3830
from ..._models import InputSchema, create_password_match_validator
31+
from ...constants import (
32+
MSG_CANT_SEND_MAIL,
33+
MSG_CHANGE_EMAIL_REQUESTED,
34+
MSG_EMAIL_SENT,
35+
MSG_OFTEN_RESET_PASSWORD,
36+
MSG_PASSWORD_CHANGED,
37+
MSG_WRONG_PASSWORD,
38+
)
3939
from ...decorators import login_required
4040
from ...settings import LoginOptions, get_plugin_options
4141

services/web/server/src/simcore_service_webserver/login/_controller/rest/confirmation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@
3434
from ....utils_aiohttp import create_redirect_to_page_response
3535
from ....utils_rate_limiting import global_rate_limit_route
3636
from ... import _confirmation_service, _security_service, _twofa_service
37-
from ..._constants import (
38-
MSG_PASSWORD_CHANGE_NOT_ALLOWED,
39-
MSG_PASSWORD_CHANGED,
40-
MSG_UNAUTHORIZED_PHONE_CONFIRMATION,
41-
)
4237
from ..._invitations_service import ConfirmedInvitationData
4338
from ..._login_repository_legacy import (
4439
AsyncpgStorage,
@@ -54,6 +49,11 @@
5449
notify_user_confirmation,
5550
)
5651
from ..._models import InputSchema, check_confirm_password_match
52+
from ...constants import (
53+
MSG_PASSWORD_CHANGE_NOT_ALLOWED,
54+
MSG_PASSWORD_CHANGED,
55+
MSG_UNAUTHORIZED_PHONE_CONFIRMATION,
56+
)
5757
from ...settings import (
5858
LoginOptions,
5959
LoginSettingsForProduct,

services/web/server/src/simcore_service_webserver/login/_controller/rest/registration.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@
3333
from ....utils_aiohttp import NextPage, envelope_json_response
3434
from ....utils_rate_limiting import global_rate_limit_route
3535
from ... import _auth_service, _confirmation_web, _security_service, _twofa_service
36-
from ..._constants import (
37-
CODE_2FA_SMS_CODE_REQUIRED,
38-
MAX_2FA_CODE_RESEND,
39-
MAX_2FA_CODE_TRIALS,
40-
MSG_2FA_CODE_SENT,
41-
MSG_CANT_SEND_MAIL,
42-
MSG_UNAUTHORIZED_REGISTER_PHONE,
43-
MSG_WEAK_PASSWORD,
44-
)
4536
from ..._emails_service import get_template_path, send_email_from_template
4637
from ..._invitations_service import (
4738
ConfirmedInvitationData,
@@ -61,6 +52,15 @@
6152
notify_user_confirmation,
6253
)
6354
from ..._models import InputSchema, check_confirm_password_match
55+
from ...constants import (
56+
CODE_2FA_SMS_CODE_REQUIRED,
57+
MAX_2FA_CODE_RESEND,
58+
MAX_2FA_CODE_TRIALS,
59+
MSG_2FA_CODE_SENT,
60+
MSG_CANT_SEND_MAIL,
61+
MSG_UNAUTHORIZED_REGISTER_PHONE,
62+
MSG_WEAK_PASSWORD,
63+
)
6464
from ...settings import (
6565
LoginOptions,
6666
LoginSettingsForProduct,

services/web/server/src/simcore_service_webserver/login/_controller/rest/twofa.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
from ....products.models import Product
1414
from ....session.access_policies import session_access_required
1515
from ... import _twofa_service
16-
from ..._constants import (
16+
from ..._login_repository_legacy import AsyncpgStorage, get_plugin_storage
17+
from ..._login_service import envelope_response
18+
from ..._models import InputSchema
19+
from ...constants import (
1720
CODE_2FA_EMAIL_CODE_REQUIRED,
1821
CODE_2FA_SMS_CODE_REQUIRED,
1922
MSG_2FA_CODE_SENT,
2023
MSG_EMAIL_SENT,
2124
MSG_UNKNOWN_EMAIL,
2225
)
23-
from ..._login_repository_legacy import AsyncpgStorage, get_plugin_storage
24-
from ..._login_service import envelope_response
25-
from ..._models import InputSchema
2626
from ...settings import LoginSettingsForProduct, get_plugin_settings
2727
from ._rest_exceptions import handle_rest_requests_exceptions
2828

services/web/server/src/simcore_service_webserver/login/_invitations_service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141
)
4242
from ..products.models import Product
4343
from . import _confirmation_service
44-
from ._constants import (
45-
MSG_EMAIL_ALREADY_REGISTERED,
46-
MSG_INVITATIONS_CONTACT_SUFFIX,
47-
MSG_USER_DISABLED,
48-
)
4944
from ._login_repository_legacy import (
5045
AsyncpgStorage,
5146
BaseConfirmationTokenDict,
5247
ConfirmationTokenDict,
5348
)
49+
from .constants import (
50+
MSG_EMAIL_ALREADY_REGISTERED,
51+
MSG_INVITATIONS_CONTACT_SUFFIX,
52+
MSG_USER_DISABLED,
53+
)
5454
from .settings import LoginOptions
5555

5656
_logger = logging.getLogger(__name__)

services/web/server/src/simcore_service_webserver/login/_login_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from simcore_postgres_database.models.users import UserRole
1313

1414
from ..db.models import ConfirmationAction, UserStatus
15-
from ._constants import (
15+
from .constants import (
1616
MSG_ACTIVATION_REQUIRED,
1717
MSG_USER_BANNED,
1818
MSG_USER_DELETED,

0 commit comments

Comments
 (0)