Skip to content

Commit 5de886d

Browse files
committed
fixes merge
1 parent 7676ad1 commit 5de886d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pydantic import ValidationError
55
from settings_library.email import SMTPSettings
66

7+
from ..application_keys import APP_SETTINGS_APPKEY
78
from ..application_setup import (
89
ModuleCategory,
910
app_setup_func,
@@ -24,7 +25,6 @@
2425
from ..products.plugin import setup_products
2526
from ..redis import setup_redis
2627
from ..rest.plugin import setup_rest
27-
from ._application_keys import APP_SETTINGS_APPKEY
2828
from ._confirmation_web import setup_confirmation
2929
from ._controller.rest import (
3030
auth,
@@ -34,7 +34,7 @@
3434
twofa,
3535
)
3636
from .settings import (
37-
APP_LOGIN_OPTIONS_KEY,
37+
LOGIN_OPTIONS_APPKEY,
3838
LOGIN_SETTINGS_PER_PRODUCT_APPKEY,
3939
LoginOptions,
4040
LoginSettings,
@@ -52,7 +52,7 @@ def _setup_login_options(app: web.Application):
5252
if INDEX_RESOURCE_NAME in app.router:
5353
cfg["LOGIN_REDIRECT"] = f"{app.router[INDEX_RESOURCE_NAME].url_for()}"
5454

55-
app[APP_LOGIN_OPTIONS_KEY] = LoginOptions(**cfg)
55+
app[LOGIN_OPTIONS_APPKEY] = LoginOptions(**cfg)
5656

5757

5858
async def _resolve_login_settings_per_product(app: web.Application):

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@
1111
from settings_library.twilio import TwilioSettings
1212
from simcore_postgres_database.models.products import ProductLoginSettingsDict
1313

14-
from .constants import LOGIN_SETTINGS_PER_PRODUCT_APPKEY
15-
1614
_DAYS: Final[float] = 1.0 # in days
1715
_MINUTES: Final[float] = 1.0 / 24.0 / 60.0 # in days
1816
_YEARS: Final[float] = 365 * _DAYS
1917
_UNLIMITED: Final[float] = 99 * _YEARS
2018

2119

22-
APP_LOGIN_OPTIONS_APPKEY: Final = web.AppKey("APP_LOGIN_OPTIONS_APPKEY", "LoginOptions")
23-
24-
2520
class LoginSettings(BaseCustomSettings):
2621
LOGIN_ACCOUNT_DELETION_RETENTION_DAYS: Annotated[
2722
PositiveInt,
@@ -145,8 +140,10 @@ def get_confirmation_lifetime(
145140
return timedelta(days=value)
146141

147142

143+
LOGIN_OPTIONS_APPKEY: Final = web.AppKey("LOGIN_OPTIONS_APPKEY", LoginOptions)
144+
148145
LOGIN_SETTINGS_PER_PRODUCT_APPKEY: Final = web.AppKey(
149-
"LOGIN_SETTINGS_PER_PRODUCT_APPKEY", dict[ProductName, LoginSettingsForProduct]
146+
"LOGIN_SETTINGS_PER_PRODUCT", dict[ProductName, LoginSettingsForProduct]
150147
)
151148

152149

@@ -160,7 +157,7 @@ def get_plugin_settings(
160157

161158

162159
def get_plugin_options(app: web.Application) -> LoginOptions:
163-
options = app.get(APP_LOGIN_OPTIONS_APPKEY)
160+
options = app.get(LOGIN_OPTIONS_APPKEY)
164161
assert options, "login plugin was not initialized" # nosec
165162
assert isinstance(options, LoginOptions) # nosec
166163
return options

0 commit comments

Comments
 (0)