Skip to content

Commit 652d271

Browse files
Merge branch 'master' into bugfix/rpc-type-issue
2 parents f1d0558 + 1fa455a commit 652d271

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
839839
},
840840

841841
__getCreateFunctionsPage: function() {
842+
if (osparc.utils.DisabledPlugins.isFunctionsDisabled()) {
843+
return null;
844+
}
845+
842846
if (!osparc.utils.Resources.isStudy(this.__resourceData)) {
843847
return null;
844848
}

services/static-webserver/client/source/class/osparc/utils/DisabledPlugins.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
2828
SCICRUNCH: "WEBSERVER_SCICRUNCH",
2929
VERSION_CONTROL: "WEBSERVER_VERSION_CONTROL",
3030
META_MODELING: "WEBSERVER_META_MODELING",
31+
FUNCTIONS: "WEBSERVER_FUNCTIONS",
3132
LICENSES: "WEBSERVER_LICENSES",
3233

3334
isExportDisabled: function() {
@@ -48,6 +49,10 @@ qx.Class.define("osparc.utils.DisabledPlugins", {
4849
return this.__isPluginDisabled(this.META_MODELING);
4950
},
5051

52+
isFunctionsDisabled: function() {
53+
return this.__isPluginDisabled(this.FUNCTIONS);
54+
},
55+
5156
isLicensesDisabled: function() {
5257
return this.__isPluginDisabled(this.LICENSES);
5358
},

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)