-
Notifications
You must be signed in to change notification settings - Fork 279
Raise an error on loading/writing unsigned metadata #1100
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
No longer WIP since the merging of #1101 and ready for review. |
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 for the PR @sechkova. Obviously this needs rebasing on recent changes in develop
and I've requested a change in test_developer_tool
to ensure we're testing behaviour we expect to support.
I've also added a question to my more experienced colleagues on the use of partially signed metadata.
144d0dc
to
b22f8bb
Compare
Thanks all for sharing your opinion! I removed the assert cases expecting an error from the tests but still kept the rest which in my opinion improves their logic in general. Let me know what do you think |
I like that a client loading unsigned metadata causes an error, yet we still support generating metadata on the repository for offline signing. What do you think @trishankatdatadog @mnm678 ? |
This looks good to me! What should the behavior be is there are less than a threshold of signatures on the metadata? Should this also cause the error? |
Client definitely has to unwaveringly and uncompromisingly strict: no threshold of sigs, no go. As for repository/developer tools, I'm okay with explicit warnings. |
The threshold of signatures is validated by In the client logic Anyway, if you have some doubts and you think it is worth the effort I can add a couple of tests for |
Sorry, my question wasn't clear. I meant what happens if the repository tries to write metadata that has less than a threshold of signatures? The error will be raised if there are no signatures, but I don't think it will if there are less than a threshold of signatures. |
Let me try to explain my vision of it and hopefully all are on the same page. On the repository side:
A more detailed discussion is in #1050.
|
Thanks, I think this helps.
This is what I wanted to make sure we clarify. If |
Modify check_signable_object_format() to raise an error if signable has an empty 'signatures' list. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
Except the UnsignedMetadataError generated by check_signable_object_format() and log a warning. When creating metadata objects on the repository side of TUF, a use case may exist where metadata is generated unsigned on one machine and signed on another. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
Modify test cases which use unsigned metadata. Update test_sign_metadata to check for empty key list. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
Modify test_root_rotation_missing_keys to not use an empty signing keys list. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
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.
Excellent, thanks!
Fixes issue #: #1050
Description of the changes being introduced by the pull request:
check_signable_object_format()
to raise an error if signable has an empty 'signatures' list.Note Marked as WIP sincetest_root_rotation_missing_keys
correctly fails due to a known verification issue on the Updater (#1101)Please verify and check that the pull request fulfills the following
requirements: