tapis-project / tapis-java

Texas Advanced Computing Center APIs
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

Enforce Tapis path type semantics in Jobs Service #38

Open richcar58 opened 2 years ago

richcar58 commented 2 years ago

Make the treatment of leading, trailing and multiple slashes in Jobs API input and output parameters conform to Tapis Path Type as described below.


Tapis Path Types have:

  1. A leading slash
  2. No trailing slash
  3. No multiple slash sequences
  4. Tapis Paths are relative to some Tapis-defined directory and ultimately to the rootDir of a system.

Generally, we take the Forgiving approach (see below) when accepting path inputs from users, though certain situations may warrant the Unforgiving approach. The Forgiving approach fixes up user input that does not have a leading slash by prepending one and by dropping any trailing slashes. We also collapse sequences of multiple slashes into a single slash ("///" → "/"). Services are expected to exchange Tapis Path Types between each other in most circumstances.

There are contexts, however, where paths cannot conform to the Tapis Path Type. For instance, search and filter specifications that rely on string matching treat slashes as significant characters, so fix-ups may not be appropriate. This is especially true when wildcards are allowed. Also, paths embedded in URLs may ascribe a particular meaning to leading or trailing slashes. Individual services must make clear how they interpret these special cases.

Approaches