Unverified Commit ca77e184 authored by Martin Cech's avatar Martin Cech Committed by GitHub
Browse files

Merge pull request #15265 from Lain-inrae/fix_gxit_short_token_-issue_15224

[22.05] Fixes #15224 - tools token are created with a size of 10 chars when interactivetools_shorten_url is true
parents 36f80978 cdbfe678
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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:
+5 −2
Original line number Diff line number Diff line
@@ -2340,11 +2340,14 @@ class InteractiveToolEntryPoint(Base, Dictifiable, RepresentById):
    dict_collection_visible_keys = ["id", "name", "active", "created_time", "modified_time"]
    dict_element_visible_keys = ["id", "name", "active", "created_time", "modified_time"]

    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
        if short_token:
            self.token = (self.token or uuid4().hex)[:10]
        else:
            self.token = self.token or uuid4().hex
        self.info = self.info or {}

+8 −0
Original line number Diff line number Diff line
@@ -147,6 +147,14 @@ class InteractiveToolsPulsarIntegrationTestCase(BaseInteractiveToolsIntegrationT
        disable_dependency_resolution(config)


class InteractiveToolsShortURLIntegrationTestCase(BaseInteractiveToolsIntegrationTestCase, RunsInterativeToolTests):
    @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 InteractiveToolsRemoteProxyIntegrationTestCase(BaseInteractiveToolsIntegrationTestCase, RunsInterativeToolTests):
    """
    $ cd gx-it-proxy