Skip to content

Commit 1fa455a

Browse files
authored
🎨 web-server: Advertises state of WEBSERVER_FUNCTIONS so front-end can enable/disable this feature (#7715)
1 parent 7185458 commit 1fa455a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,19 +462,20 @@ def log_level(self) -> int:
462462
def is_enabled(self, field_name: str) -> bool:
463463
return bool(getattr(self, field_name, None))
464464

465-
def _get_disabled_public_plugins(self) -> list[str]:
465+
def _get_disabled_advertised_plugins(self) -> list[str]:
466+
"""List of plugins that are disabled to be advertised to the client"""
466467
# NOTE: this list is limited for security reasons. An unbounded list
467468
# might reveal critical info on the settings of a deploy to the client.
468-
# TODO: more reliable definition of a "plugin" and whether it can be advertised or not
469-
# (extra var? e.g. Field( ... , x_advertise_plugin=True))
470-
public_plugin_candidates: Final = {
469+
# SEE https://github.com/ITISFoundation/osparc-simcore/issues/7688
470+
advertised_plugins: Final = {
471471
"WEBSERVER_EXPORTER",
472472
"WEBSERVER_FOLDERS",
473+
"WEBSERVER_FUNCTIONS",
473474
"WEBSERVER_LICENSES",
474475
"WEBSERVER_PAYMENTS",
475476
"WEBSERVER_SCICRUNCH",
476477
}
477-
return [_ for _ in public_plugin_candidates if not self.is_enabled(_)] + [
478+
return [_ for _ in advertised_plugins if not self.is_enabled(_)] + [
478479
# NOTE: Permanently retired in https://github.com/ITISFoundation/osparc-simcore/pull/7182
479480
# Kept here to disable front-end
480481
"WEBSERVER_META_MODELING",
@@ -556,7 +557,7 @@ def to_client_statics(self) -> dict[str, Any]:
556557
},
557558
exclude_none=True,
558559
)
559-
data["plugins_disabled"] = self._get_disabled_public_plugins()
560+
data["plugins_disabled"] = self._get_disabled_advertised_plugins()
560561

561562
# Alias in addition MUST be camelcase here
562563
return {snake_to_camel(k): v for k, v in data.items()}

0 commit comments

Comments
 (0)