-
Notifications
You must be signed in to change notification settings - Fork 520
command to purge all keys from all delegations below a starting point #855
Conversation
80ba1f0 to
abc8943
Compare
| path.Join(CanonicalTargetsRole, "level1"): tr, | ||
| path.Join(CanonicalTargetsRole, "level1", "level2", "level3"): tr, | ||
| path.Join(CanonicalTargetsRole, "under_score"): tr, | ||
| path.Join(CanonicalTargetsRole, "hyphen-hyphen"): tr, |
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 this refactoring 👍
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.
Just wanted consistency within the file :-)
4d25d99 to
34606c0
Compare
| path.Join(CanonicalSnapshotRole, "*"): f, | ||
| path.Join(CanonicalTimestampRole, "*"): f, | ||
| path.Join(CanonicalTargetsRole, "*", "foo"): f, | ||
| path.Join(CanonicalTargetsRole, "*", "*"): f, |
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.
Can also add failure cases for trailing slashes after the *, and extra slashes between the rest of the delegation and the *?
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.
Done
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
34606c0 to
fdf7f13
Compare
|
thank you for adding the tests, LGTM! Documentation CI errors are unrelated |
| if err != nil { | ||
| return err | ||
| } | ||
| if data.IsWildDelegation(c.Scope()) { |
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.
This is never getting exercised, which is weird because cmd/notary/integration_test.go's TestPurge should exercise this bit of code.
In applyChangelist, where we switch based on whether the scope is a delegation (L43) I think we also have to change that line to be isDel := data.IsDelegation(c.Scope()) || data.IsWildDelegation(c.Scope())
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.
Hmmm, you're absolutely right, and that's making me wonder why the test in cmd/notary/delegations_test.go is even passing.
Going to add some more checks to that test to try and make it fail, then will update this and see if it passes again.
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.
Oh, I see now. I'm calling the purge command but not publish so it's not actually applying the change. I must have got sidetracked half way through the test and forgotten to come back to it.
fdf7f13 to
3b3c24b
Compare
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
3b3c24b to
0297730
Compare
|
Awesome, thanks for tackling this! LGTM! |
Need to write tests.Closes #696
Signed-off-by: David Lawrence [email protected] (github: endophage)