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

Add interface.export_pubkeys convenience function #278

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Sep 30, 2020

Fixes: # -
Related to in-toto/in-toto#80

Description of the changes being introduced by the pull request:

Add convenience function to import multiple public keys of different key types from file into an sslib dict format at once, and tests.

Note: Uses the new pseudo-standard docstring style suggested in secure-systems-lab/code-style-guidelines#20. All new interface functions should use that style (existing docstrings will be converted in separate PRs).

Note2: This PR also adds a few package-wide constants for key types, that are still hardcoded in many places. We should switch to using these and probably other global constants in a separate PR.

Please verify and check that the pull request fulfils 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

Add package-wide constants for key types.

NOTE: These values are still hard-coded in many places. We should
switch to using these and probably other global constants in a
separate PR.
Add convenience function to import multiple public keys of
different key types from file into an sslib dict format at once,
and tests.

Note: Uses the new pseudo-standard docstring style suggested in
secure-systems-lab/code-style-guidelines#20. All new interface
functions should use that style (existing docstrings will be
converted in separate PRs).
@lukpueh lukpueh changed the title Add export pubkeys Add interface.export_pubkeys convenience function Sep 30, 2020
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 98.959% when pulling f4819e4 on lukpueh:add-export-pubkeys into 94d83b9 on secure-systems-lab:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 98.959% when pulling f4819e4 on lukpueh:add-export-pubkeys into 94d83b9 on secure-systems-lab:master.

Copy link
Collaborator

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question about where we are defining constants, but otherwise this looks like a nice addition. Thanks @lukpueh !



# Global constants
# TODO: Replace hard-coded key types with these constants (and add more)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these constants be better suited to the keys module? Is it worth documenting how we're choosing where to put constants?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO __init__ is a good default place for global constants. If we want to module-scope them, we should coordinate with #270.

@lukpueh
Copy link
Member Author

lukpueh commented Sep 30, 2020

Thanks for the quick review, @joshuagl!

@lukpueh lukpueh merged commit 2ee9607 into secure-systems-lab:master Sep 30, 2020
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.

3 participants