Skip to content
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

Streamline TUFs crypto interface #919

Merged
merged 2 commits into from
Sep 24, 2019

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Sep 18, 2019

Fixes issue #:
Closes #656
Supersedes #804
Paves the way for #840

Description of the changes being introduced by the pull request:

  • Remove securesystemslib-wrappers in repository_lib that don't add any new functionality. Also remove corresponding tests that already exist in securesystemslib.
    This means the functions are no longer available via repository_lib, which should be fine, because repository_lib does not seem to be a public interface.

  • Replace securesystemslib- and repository_lib-wrappers, in repository_tool and developer_tool with direct imports.
    This means, the functions are still available via the repository_tool (or developer_tool), which they should be (see e.g. TUTORIAL.md), but internally the modules get slimmer.

See commit messages for more details.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Import some API functions from repository_lib and securesystemslib
directly into repository_tool and developer_tool, instead of
providing them via wrapper.

Also short-circuit some functions that used to point to
securesystemslib through repository_lib.

This reverts parts of 6f7ba76,
which introduced some of the wrappers to appease the linter.
Here we just disable that specific linter check (unused-import).

The advantage of importing over wrapping is:
- no duplication of hardcoded defaults for keyword arguments
- no duplication of docstrings
- less code --> easier maintenance

This should also pave the way for more serious refactoring
of the repository- and developer-tools:
theupdateframework#840

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Remove only wrappers and corresponding tests that don't add any
new functionality, but blindly forward the caller to sslib, where
the same function exists and is tested.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@lukpueh lukpueh mentioned this pull request Sep 18, 2019
3 tasks
@lukpueh
Copy link
Member Author

lukpueh commented Sep 24, 2019

Thanks, @adityasaky!

@lukpueh lukpueh merged commit df1c749 into theupdateframework:develop Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove crypto functions already available in library dependency
2 participants