-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add versioned TRS URI to documentation #164
Comments
We would probably prefer requiring percent encoding since we do use/permit forward slashes in the Dockstore TRS implementation. But otherwise, makes a lot of sense to me. |
Thanks @denis-yuen, so would we. No changes in the specs required, at least not urgently. In a next minor version bump one could think of adding a As a first step though, I would propose to just change the TRS URI description in the Data Model docs. If others are okay with the proposal, I'd be happy to file a PR for that. That is, if someone could tell me where these docs are located. Didn't find them in the TRS spec repo... |
The docs are in a different branch https://github.com/ga4gh/tool-registry-service-schemas/blob/gh-pages/2.0.0-Data-Model.md of the repo, based on gh-pages |
Was thinking a little bit and figured that if we don't want any characters in tool/version identifiers to be restricted, as discussed (for backward compatibility with, e.g., Dockstore), we would need to prescribe that TRS URIs MUST be URL-encoded if they contain a certain set of special characters (specifically the forward slash and any special characters used in URL-encoding). We would also need to think about the implications of that, specifically with regard to TRS clients and services in general. Two options:
First option is easier (no changes to specs required), second option is potentially more consistent and less ambiguous for certain use cases. E.g., what if the tool is called To highlight the problem:
Now, if a client gets the ID 1., URL-encodes it (to result in ID 2.), then sends a request to a TRS endpoint with the encoded identifier, but the implementation uses it raw, without decoding, it either would return a For DRS this is addressed here:
So this would rather suggest solution 2., even if it's rather implied than specifically stated (it appears that service implementations MUST assume IDs are URL-encoded)... Would like to get some feedback on this before filing a PR. |
Solution 2 (assume that identifiers are encoded for calls) sounds reasonable and I think is what we implemented (I'll need to double-check, but I'm pretty sure). I'm not entirely sure I understand solution 1 actually. If only clients are doing encoding and decoding when needed, wouldn't we run into two characters mapping to one? (e.g. the server needs to understand that |
I guess I meant the difference is that either the entire TRS URI is encoded (version 1) OR tool ID and version ID are encoded individually, then the corresponding TRS URI is constructed of the two parts according to I will prepare a PR in the docs. |
FWIW, we percent encode the ID prior to submitting a request to the actual trs endpoint. The choice to allow all characters in the ID has posed interesting challenges for us specifically sending requests or routing using dockstore TRS identifiers. We have had to disable certain firewall rules in our servers to allow for percent encoded urls to be embedded directly in the path. IMO ids should never be allowed to include things like |
Good point and I agree with that. The reason why I did not exclude these from my proposal is simply that I wanted to remain consistent with how DRS URIs are defined. But I guess consistency shouldn't be worth more than security and ease of use. Would you be willing to update the PR, @patmagee? Or is there anyone speaking out for the necessity for having all ASCII characters available for TRS (version) IDs? |
Hmmm, we still use |
@denis-yuen OWASP has a pretty good description of the attack here. While we likely would not be subject to it, clients using By Default spring has this behavaiour disabled, with the following motivation:
|
Yeah, I wouldn't object to a recommendation to avoid but at this juncture, I don't think we're likely to change either. |
…s#164 Tested with dockstore and WorkflowHub (it returns a 500 HTTP error code)
Description
While we appreciate and strongly support the definition of TRS URIs, we think they will be much more useful if they'd contain the version identifier as well.
Some use cases:
fedora/httpd:version1.0
ormyregistryhost:5000/fedora/httpd:version1.0
) for each of my workflow steps will allow compute backends (e.g., Workflow Execution Service (WES) and/or Task Execution Service (TES) implementations) with TRS clients to choose their supported/favorite container technology from the available options.Proof of Concept
Within the ELIXIR Cloud & AAI ecosystem, we are already making experimental use of versioned TRS URIs of the form
trs://<server>/<id>/versions/<version-id>
to leverage the use cases described above:dockerPull
directives of a CWL demo workflow. The workflow engine we are using (cwl-tes, based on CWL's reference runner cwltool), does not complain about the versioned TRS URIs and neatly puts them in thetesTask.executors.$.image
fields of the TES requests it generates. Upon receiving such a request, our TES implementation TESK then calls the TRS instance encoded in the versioned TRS URI (BioContainers in our case) to resolve the actual container technology-specific image name (specifically, it uses the first Docker image it finds for that tool version), pulls that image from the actual container registry and executes the task.Proposed specification
While we have used TRS URIs of the form
trs://<server>/<id>/versions/<version-id>
for our PoC implementations, we would propose a more concise notation of the form:To ensure that versioned TRS URIs can be unambiguously parsed by clients, any
/
characters potentially occurring in tool and tool version identifiers would need to be percent-/URL-encoded before sharing a versioned TRS URI.Alternatively, but requiring a change that would potentially break existing TRS implementations, forward slashes could be explicitly forbidden in tool and version identifiers.
┆Issue is synchronized with this Jira Story
┆containerName: GA4GH tool-registry-service
┆Issue Number: TRS-48
The text was updated successfully, but these errors were encountered: