Skip to content

New API: Don't hardcode metadata files extension #1333

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

Open
3 tasks
MVrachev opened this issue Apr 6, 2021 · 1 comment
Open
3 tasks

New API: Don't hardcode metadata files extension #1333

MVrachev opened this issue Apr 6, 2021 · 1 comment

Comments

@MVrachev
Copy link
Collaborator

MVrachev commented Apr 6, 2021

Description of issue or feature request:
In a review of a pr adding additional classes in the metadata API, @sechkova noticed that we have hardcoded
the usage of JSON files representing our metadata files after the implementation of abstract (de)serializer here.

For context: Teodoras comment

Current behavior:
Hardcoded *.json file names in a lot of places: https://github.com/theupdateframework/tuf/blob/52207862008cc54db8a43e1543a653be0d0333f7/tuf/api/metadata.py#L468

Expected behavior:
Don't hardcode the file names representing our metadata files with their file extensions.

TODO:

  • Remove hardcoded json strings from the code in all classes.
  • Fix our documentation to not give examples with JSON files or have a sentence like For JSON metadata files, here is how it will look like...
  • Add support for other metadata file types inside the metadata classes.
    This could be achieved with a configuration option in a Repository class or helper functions for each of the metadata classes.
@joshuagl joshuagl changed the title New API: Don't hardcode metadata files extetnion New API: Don't hardcode metadata files extension Apr 6, 2021
@MVrachev
Copy link
Collaborator Author

MVrachev commented Apr 7, 2021

Added commit 1572385 which removed part of the places where we used
hardcoded JSON string and added support for other file extensions in the Timestamp` class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants