diff --git a/lib/galaxy/managers/interactivetool.py b/lib/galaxy/managers/interactivetool.py index 8ba081e60aa..4bce9c88339 100644 --- a/lib/galaxy/managers/interactivetool.py +++ b/lib/galaxy/managers/interactivetool.py @@ -163,6 +163,7 @@ class InteractiveToolManager: entry_url=entry["url"], name=entry["name"], requires_domain=entry["requires_domain"], + short_token=self.app.config.interactivetools_shorten_url, ) self.sa_session.add(ep) if flush: diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 421585ee8a5..2d74b52e335 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -2378,12 +2378,15 @@ class InteractiveToolEntryPoint(Base, Dictifiable, RepresentById): "output_datasets_ids", ] - def __init__(self, requires_domain=True, configured=False, deleted=False, **kwd): + def __init__(self, requires_domain=True, configured=False, deleted=False, short_token=False, **kwd): super().__init__(**kwd) self.requires_domain = requires_domain self.configured = configured self.deleted = deleted - self.token = self.token or uuid4().hex + if short_token: + self.token = (self.token or uuid4().hex)[:10] + else: + self.token = self.token or uuid4().hex self.info = self.info or {} @property diff --git a/test/integration/test_interactivetools_api.py b/test/integration/test_interactivetools_api.py index fa2f62066dd..96d5c8d5882 100644 --- a/test/integration/test_interactivetools_api.py +++ b/test/integration/test_interactivetools_api.py @@ -152,6 +152,14 @@ class TestInteractiveToolsPulsarIntegration(AbstractTestCases.BaseInteractiveToo disable_dependency_resolution(config) +class TestInteractiveToolsShortURLIntegration(AbstractTestCases.BaseInteractiveToolsIntegrationTestCase): + @classmethod + def handle_galaxy_config_kwds(cls, config): + super().handle_galaxy_config_kwds(config) + config["interactivetools_shorten_url"] = True + config["job_config_file"] = DOCKERIZED_JOB_CONFIG_FILE + + class TestInteractiveToolsRemoteProxyIntegration(AbstractTestCases.BaseInteractiveToolsIntegrationTestCase): """ $ cd gx-it-proxy