-
Notifications
You must be signed in to change notification settings - Fork 110
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
Look for target in delegations #146
Look for target in delegations #146
Conversation
Pull Request Test Coverage Report for Build 1242331363
💛 - 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.
LGTM -- I think I convinced myself that even though getTargetFileMeta
starts from the top-level targets, that c.Targets()
is needed for verification consistency and loading the local metadata.
Could you please add a quick test for this?
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.
Seems redundant. Doesn't getTargetFileMeta already do the work of resolving form the top-level targets role first before delving into delegations? If so, why do we need to manually resolve in the top-level targets first using the old code (basically lines 719-727)?
Cc @raphaelgavache to confirm |
There's some root/top-level verification that Line 266 in aee6270
|
Boy, thanks, Asra, that was totally not obvious by just looking at the function. The current API has a lot of side fx (violates principle of least surprise) we should remove later, but for now, let's make sure we keep security while removing redundancy. |
@lebauce any updates? |
a4d1c64
to
e5d188b
Compare
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.
nice catch, lgtm
Was my comment resolved? Slyvain, please don't force-push next time, makes it hard to track what changed or didn't |
@trishankatdatadog tests were added since your last review and the comment can be considered as resolved. |
Yes, I understand and agree that getting the custom along with the targets metadata is useful. What I disagree with is that my question has been resolved. Does everyone understand what I mean?
Hold on: are you telling me the current code for parsing delegations --- which starts from the top-level targets role anyway, according to my current understanding --- does not check for signatures from the top-level targets role? Also, why do we need root/top-level (I'm assuming you mean root->timestamp->snapshot->targets role) verification here? Is that how the API works? That users can just call |
Yes similarly to the
|
e103a3d
to
7877bf7
Compare
7877bf7
to
d61b00f
Compare
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.
LGTM. I wonder if the comment for
// Targets returns the complete list of available targets.
func (c *Client) Targets() (data.TargetFiles, error) {
should clarify that this is top-level targets and
// Target returns the target metadata for a specific target if it
// exists. If it does not, ErrNotFound will be returned.
func (c *Client) Target(name string) (data.TargetFileMeta, error) {
searches target metadata through all delegations.
That would probably iron out some confusion?
Consider this non-blocking though.
4d5f851
Why all the coverage failures for ubuntu? |
Coveralls is having an outage: https://status.coveralls.io/ and it's failing on an http call to coveralls
I think it can be ignored given that the tests succeeded |
I'm sure it works, but let's wait until Coveralls is up again. |
* Look for target in delegations * Remove uncessary code in Target * Clarify both Target and Targets comments
When using delegations, a specific target file should be search among all the delegations targets