Skip to content

Streamline TUFs crypto interface #919

Merged
lukpueh merged 2 commits intotheupdateframework:developfrom
lukpueh:refactor-repository-api
Sep 24, 2019
Merged

Streamline TUFs crypto interface #919
lukpueh merged 2 commits intotheupdateframework:developfrom
lukpueh:refactor-repository-api

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

Lukas Puehringer added 2 commits September 18, 2019 18:08
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