Skip to content

Commit 8108c69

Browse files
authored
Merge branch 'master' into mai/annotated-settings
2 parents cf69757 + 638b592 commit 8108c69

File tree

15 files changed

+38
-22
lines changed

15 files changed

+38
-22
lines changed

.env-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ WEBSERVER_GARBAGE_COLLECTOR=null
371371
WEBSERVER_GROUPS=1
372372
WEBSERVER_GUNICORN_CMD_ARGS=--timeout=180
373373
WEBSERVER_HOST=webserver
374+
WEBSERVER_LICENSES=true
374375
WEBSERVER_LOGIN={}
375376
WEBSERVER_LOGLEVEL=INFO
376377
WEBSERVER_META_MODELING=1

api/specs/web-server/_licensed_items.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
from models_library.generics import Envelope
1515
from models_library.rest_error import EnvelopedError
1616
from simcore_service_webserver._meta import API_VTAG
17-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
18-
from simcore_service_webserver.licenses._models import (
17+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
18+
_TO_HTTP_ERROR_MAP,
19+
)
20+
from simcore_service_webserver.licenses._common.models import (
1921
LicensedItemsBodyParams,
2022
LicensedItemsListQueryParams,
2123
LicensedItemsPathParams,

api/specs/web-server/_licensed_items_checkouts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
from models_library.rest_error import EnvelopedError
1818
from models_library.rest_pagination import Page
1919
from simcore_service_webserver._meta import API_VTAG
20-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
20+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
21+
_TO_HTTP_ERROR_MAP,
22+
)
2123
from simcore_service_webserver.licenses._licensed_items_checkouts_models import (
2224
LicensedItemCheckoutPathParams,
2325
LicensedItemsCheckoutsListQueryParams,

api/specs/web-server/_licensed_items_purchases.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
from models_library.rest_error import EnvelopedError
1818
from models_library.rest_pagination import Page
1919
from simcore_service_webserver._meta import API_VTAG
20-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
21-
from simcore_service_webserver.licenses._models import (
20+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
21+
_TO_HTTP_ERROR_MAP,
22+
)
23+
from simcore_service_webserver.licenses._common.models import (
2224
LicensedItemsPurchasesListQueryParams,
2325
LicensedItemsPurchasesPathParams,
2426
)

services/docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ services:
704704
INVITATIONS_SECRET_KEY: ${INVITATIONS_SECRET_KEY}
705705
INVITATIONS_USERNAME: ${INVITATIONS_USERNAME}
706706

707+
WEBSERVER_LICENSES: ${WEBSERVER_LICENSES}
708+
707709
WEBSERVER_LOGIN: ${WEBSERVER_LOGIN}
708710
LOGIN_ACCOUNT_DELETION_RETENTION_DAYS: ${LOGIN_ACCOUNT_DELETION_RETENTION_DAYS}
709711
LOGIN_REGISTRATION_CONFIRMATION_REQUIRED: ${LOGIN_REGISTRATION_CONFIRMATION_REQUIRED}
@@ -897,6 +899,7 @@ services:
897899
WEBSERVER_GARBAGE_COLLECTOR: ${WB_DB_EL_GARBAGE_COLLECTOR}
898900
WEBSERVER_GROUPS: ${WB_DB_EL_GROUPS}
899901
WEBSERVER_INVITATIONS: ${WB_DB_EL_INVITATIONS}
902+
WEBSERVER_LICENSES: 0
900903
WEBSERVER_LOGIN: ${WB_DB_EL_LOGIN}
901904
WEBSERVER_PAYMENTS: ${WB_DB_EL_PAYMENTS}
902905
WEBSERVER_META_MODELING: ${WB_DB_EL_META_MODELING}
@@ -1000,6 +1003,7 @@ services:
10001003
WEBSERVER_FRONTEND: ${WB_GC_FRONTEND}
10011004
WEBSERVER_GROUPS: ${WB_GC_GROUPS}
10021005
WEBSERVER_INVITATIONS: ${WB_GC_INVITATIONS}
1006+
WEBSERVER_LICENSES: 0
10031007
WEBSERVER_LOGIN: ${WB_GC_LOGIN}
10041008
WEBSERVER_META_MODELING: ${WB_GC_META_MODELING}
10051009
WEBSERVER_NOTIFICATIONS: ${WB_GC_NOTIFICATIONS}

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
349349
WEBSERVER_DB_LISTENER: bool = True
350350
WEBSERVER_FOLDERS: bool = True
351351
WEBSERVER_GROUPS: bool = True
352-
WEBSERVER_LICENSES: bool = True
352+
WEBSERVER_LICENSES: bool = False
353353
WEBSERVER_META_MODELING: bool = True
354354
WEBSERVER_NOTIFICATIONS: bool = True
355355
WEBSERVER_PRODUCTS: bool = True
@@ -452,6 +452,7 @@ def _get_disabled_public_plugins(self) -> list[str]:
452452
public_plugin_candidates: Final = {
453453
"WEBSERVER_EXPORTER",
454454
"WEBSERVER_FOLDERS",
455+
"WEBSERVER_LICENSES",
455456
"WEBSERVER_META_MODELING",
456457
"WEBSERVER_PAYMENTS",
457458
"WEBSERVER_SCICRUNCH",
@@ -519,16 +520,17 @@ def to_client_statics(self) -> dict[str, Any]:
519520
"SIMCORE_VCS_RELEASE_TAG": True,
520521
"SIMCORE_VCS_RELEASE_URL": True,
521522
"SWARM_STACK_NAME": True,
523+
"WEBSERVER_LICENSES": True,
524+
"WEBSERVER_LOGIN": {
525+
"LOGIN_ACCOUNT_DELETION_RETENTION_DAYS",
526+
"LOGIN_2FA_REQUIRED",
527+
},
522528
"WEBSERVER_PROJECTS": {
523529
"PROJECTS_MAX_NUM_RUNNING_DYNAMIC_NODES",
524530
},
525531
"WEBSERVER_TRASH": {
526532
"TRASH_RETENTION_DAYS",
527533
},
528-
"WEBSERVER_LOGIN": {
529-
"LOGIN_ACCOUNT_DELETION_RETENTION_DAYS",
530-
"LOGIN_2FA_REQUIRED",
531-
},
532534
"WEBSERVER_SESSION": {"SESSION_COOKIE_MAX_AGE"},
533535
},
534536
exclude_none=True,

services/web/server/src/simcore_service_webserver/licenses/_common/__init__.py

Whitespace-only changes.

services/web/server/src/simcore_service_webserver/licenses/_exceptions_handlers.py renamed to services/web/server/src/simcore_service_webserver/licenses/_common/exceptions_handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
from servicelib.aiohttp import status
44
from simcore_service_webserver.wallets.errors import WalletAccessForbiddenError
55

6-
from ..exception_handling import (
6+
from ...exception_handling import (
77
ExceptionToHttpErrorMap,
88
HttpErrorInfo,
99
exception_handling_decorator,
1010
to_exceptions_handlers_map,
1111
)
12-
from ..wallets.errors import WalletNotEnoughCreditsError
13-
from .errors import LicensedItemNotFoundError, LicensedItemPricingPlanMatchError
12+
from ...wallets.errors import WalletNotEnoughCreditsError
13+
from ..errors import LicensedItemNotFoundError, LicensedItemPricingPlanMatchError
1414

1515
_logger = logging.getLogger(__name__)
1616

services/web/server/src/simcore_service_webserver/licenses/_models.py renamed to services/web/server/src/simcore_service_webserver/licenses/_common/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from pydantic import BaseModel, ConfigDict, Field
1919
from servicelib.request_keys import RQT_USERID_KEY
2020

21-
from .._constants import RQ_PRODUCT_KEY
21+
from ..._constants import RQ_PRODUCT_KEY
2222

2323
_logger = logging.getLogger(__name__)
2424

services/web/server/src/simcore_service_webserver/licenses/_licensed_items_checkouts_rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
from ..utils_aiohttp import envelope_json_response
2222
from ..wallets._handlers import WalletsPathParams
2323
from . import _licensed_items_checkouts_service
24-
from ._exceptions_handlers import handle_plugin_requests_exceptions
24+
from ._common.exceptions_handlers import handle_plugin_requests_exceptions
25+
from ._common.models import LicensedItemsRequestContext
2526
from ._licensed_items_checkouts_models import (
2627
LicensedItemCheckoutGet,
2728
LicensedItemCheckoutGetPage,
2829
LicensedItemCheckoutPathParams,
2930
LicensedItemsCheckoutsListQueryParams,
3031
)
31-
from ._models import LicensedItemsRequestContext
3232

3333
_logger = logging.getLogger(__name__)
3434

0 commit comments

Comments
 (0)