Commit 53ff51f6 authored by Sveinung Gundersen's avatar Sveinung Gundersen Committed by Cage, Gregory
Browse files

Merge 'Added 'label', 'requires_path_in_url' and 'requires_path_in_header'...

Merge 'Added 'label', 'requires_path_in_url' and 'requires_path_in_header' columns to 'interactivetool_entry_point' table and as attribute to entry points' into branch
parent ee46a52c
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -314,10 +314,22 @@ class XmlToolSource(ToolSource):
            if label:
                label = label.strip()
            requires_domain = string_as_bool(ep_el.attrib.get("requires_domain", False))
            requires_path_in_url = string_as_bool(ep_el.attrib.get("requires_path_in_url", False))
            requires_path_in_header_named = ep_el.get("requires_path_in_header_named", None)
            protocol = ep_el.attrib.get("protocol", "http")
            if protocol:
                protocol = protocol.strip()
            rtt.append(dict(port=port, url=url, name=name, requires_domain=requires_domain, protocol=protocol))
            rtt.append(
                dict(
                    port=port,
                    url=url,
                    name=name,
                    requires_domain=requires_domain,
                    protocol=protocol,
                    requires_path_in_url=requires_path_in_url,
                    requires_path_in_header_named=requires_path_in_header_named,
                )
            )
        return rtt

    def parse_hidden(self):
+2 −2
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ Whether the InteractiveTool proxy will add the entry point path to the URL provi
relevant when path-based proxying is configured (``requires_domain=False``). A value of False implies that the web service
for the interactive tool fully operates with relative links. A value of True implies that the unique entry point path,
which is autogenerated each run, must be somehow provided to the web service. This can be done by injecting the path
into an environment variable by setting the attribute ``inject="entry_point_path_for_label"`` in the tool XML.
into an environment variable by setting the attribute ``inject="entry_point_path"`` in the tool XML.
Alternatively, the attribute ``requires_path_in_header_named`` can be set to provide the path in the specified HTTP header.
The entry point path should in any case be used to configure the web service in the interactive tool to serve the content
from the provided URL path. Default value of ``requires_path_in_url`` is False.
@@ -6273,7 +6273,7 @@ define.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="api_key" />
      <xs:enumeration value="entry_point_path_for_label" />
      <xs:enumeration value="entry_point_path" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConfigFiles">
+3 −3
Original line number Diff line number Diff line
@@ -667,11 +667,11 @@ class ToolEvaluator:
            elif inject and inject.startswith("oidc_"):
                environment_variable_template = self.get_oidc_token(inject)
                is_template = False
            elif inject and inject == "entry_point_path_for_label" and environment_variable_template:
            elif inject and inject == "entry_point_path" and environment_variable_template:
                from galaxy.managers.interactivetool import InteractiveToolManager

                entry_point_label = environment_variable_template
                matching_eps = [ep for ep in self.job.interactivetool_entry_points if ep.label == entry_point_label]
                entry_point_name = environment_variable_template
                matching_eps = [ep for ep in self.job.interactivetool_entry_points if ep.name == entry_point_name]
                if matching_eps:
                    entry_point = matching_eps[0]
                    entry_point_path = InteractiveToolManager(self.app).get_entry_point_path(self.app, entry_point)