Skip to content

Commit

Permalink
Restore PATH_SCHEMA to be AnyString
Browse files Browse the repository at this point in the history
In one of the latest commits AnyNonemptyString was introduced
and with it, PATH_SCHEMA was changed to AnyNonemptyString from
AnyString. This led to unit tests failures in TUF.
See: theupdateframework/python-tuf#1059

One could argue what is the right approach: to consider
that PATH_SCHEMA is every non-empty string or every string.
I think this is not of much importance, but for TUF and
possibly for other securesystemslib adopters, this leads to tests
failures. The reason is that there are multiple functions
with arguments which should conformant against the PATH_SCHEMA
but have default values of ''.

See :
- "prefix" argument in load_repository function
- "location_in_repository" argument in create_new_project function
both of which are in tuf/developer_tool.py

Signed-off-by: Martin Vrachev <[email protected]>
  • Loading branch information
MVrachev committed Jun 29, 2020
1 parent 7531747 commit 6255ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion securesystemslib/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
SCHEME_SCHEMA = SCHEMA.AnyString()

# A path string, whether relative or absolute, e.g. 'metadata/root/'
PATH_SCHEMA = SCHEMA.AnyNonemptyString()
PATH_SCHEMA = SCHEMA.AnyString()
PATHS_SCHEMA = SCHEMA.ListOf(PATH_SCHEMA)

# An integer representing logger levels, such as logging.CRITICAL (=50).
Expand Down

0 comments on commit 6255ea9

Please sign in to comment.