-
Notifications
You must be signed in to change notification settings - Fork 278
Metadata API: Make Role.keyids ordered #1754
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
Conversation
This modifies test_update_root_new_root_fail_threshold_verification() which seems broken to me: I left that for #1753 |
Pull Request Test Coverage Report for Build 1657734798Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with only one minor detail that should be fixed.
keyids are ordered in the data we deserialize: Not preserving that order breaks canonicalization. Set does not preserve order. Change Role.keyids type from Set to List. This is strictly speaking an API change but a minor one: keyids are supposed to be changed via add_key()/remove_key(). Add tests for this for both Role and DelegatedRole. Shorten a related exception message. Fix theupdateframework#1752 Signed-off-by: Jussi Kukkonen <[email protected]>
85ca3c2
to
80d3fcf
Compare
focre-pushed: Only change is a string marked as f-string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant, thanks!
f" instead got {keyids}" | ||
) | ||
if len(set(keyids)) != len(keyids): | ||
raise ValueError(f"Nonunique keyids: {keyids}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, feel free to ignore
raise ValueError(f"Nonunique keyids: {keyids}") | |
raise ValueError(f"Non-unique keyids: {keyids}") |
Looks good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! @jku, will you s/nonunique/non-unique
? Let's merge otherwise!
I will live with nonunique since there's no other changes... |
keyids are ordered in the data we deserialize: Not preserving that order
breaks canonicalization. Set does not preserve order.
Change Role.keyids type from Set to List. This is strictly speaking
an API change but a minor one: keyids are supposed to be changed
via add_key()/remove_key().
Add tests for this for both Role and DelegatedRole. Shorten a related
exception message.
Fix #1752
Signed-off-by: Jussi Kukkonen [email protected]
Please verify and check that the pull request fulfills the following
requirements: