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 default keyid to format_metadata_to_key #225

Merged
merged 3 commits into from
Apr 10, 2020

Conversation

mnm678
Copy link
Contributor

@mnm678 mnm678 commented Apr 2, 2020

Add an optional parameter to format_metadata_to_key that allows the caller to provide a default keyid. This change can be used for future changes that remove keyid_hash_algorithms from TUF as described in theupdateframework/python-tuf#848.

…aller to provide a default keyid. This will help remove the depenency on keyid_hash_algorithms in tuf while remaining backwards compatible
@coveralls
Copy link

coveralls commented Apr 2, 2020

Coverage Status

Coverage increased (+0.0006%) to 98.715% when pulling ea303af on mnm678:default-keyid into caf029e on secure-systems-lab:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0006%) to 98.715% when pulling 7725ebd on mnm678:default-keyid into caf029e 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.

Thanks for the change @mnm678. I've made a minor suggestion to make the check for default_keyid more idiomatic.

securesystemslib/keys.py Outdated Show resolved Hide resolved
@@ -474,7 +474,7 @@ def format_keyval_to_metadata(keytype, scheme, key_value, private=False):



def format_metadata_to_key(key_metadata):
def format_metadata_to_key(key_metadata, default_keyid=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you document default_keyid in the Arguments section of the docstring?

mnm678 and others added 2 commits April 3, 2020 09:23
Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

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

Thanks for the patch and your work on keyids, @mnm678! Looking forward to seeing this handled better.

@lukpueh lukpueh merged commit 12e8041 into secure-systems-lab:master Apr 10, 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.

4 participants