-
Notifications
You must be signed in to change notification settings - Fork 113
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
RFC072 Artifact Yanking: disallow cookbook removal by owner #1789
Conversation
I expect some failures from |
So far, the logic you added LGTM and covers what we talked about. The new test coverage looks good too. |
I'm pondering adding a useful message to the unauthorized response—akin to the message returned for unauthorized attempts to create—to communicate more clearly why owners may no longer be able to destroy cookbooks or cookbook versions. |
Overall I think this looks good. I'd be fine with improving the unauth response if you want, but I think this is gtg. |
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.
One testing phrasing nit in-line, otherwise this looks good. As we discussed we'll want to be really clear in the release notes about discussing the security impacts, and the more subtle change of now allowing admins to yank cookbooks.
@@ -8,8 +8,13 @@ | |||
|
|||
subject { described_class.new(user, record) } | |||
|
|||
context 'and owners can remove cookbooks' do |
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 remove cookbooks when the server is configured to allow it"?
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.
Yea, that original phrasing is no bueno. 🤔
Does the UI show the messages? I recall running into issues with chef server where we added nice detail to error messages - only to have it swallowed by knife and manage ui. |
Maybe. There is very intentionally no mechanism in the web UI to remove cookbooks or cookbook versions. The UI someone will experience for unsharing is the I think it is still worth having the API response include a message with the unauthorized response providing details. |
Looking at the |
Good catch on knife. We can do that as a separate card. |
…versions Chef RFC072[1] was accepted as a plan for Supermarket to prevent cookbook artifacts from disappearing. These changes are a beginning: prevent a cookbook owner from removing any version of a cookbook or the entire cookbook itself. This change does not address the proposed hiding behavior in the RFC. For backward compatibility, a new configuration option has been added to enable the previous behavior to allow artifact removal by owners. The option is set via an environment variable managed by the omnibus install. The current default is to enable it with the intention to change the default to disabled in a future major release. [1] https://github.com/chef/chef-rfc/blob/f8250a4746d2df530b605ecfaa2dc5ae9b7dc7ff/rfc072-artifact-yanking.md Co-authored-by: Jon Morrow <[email protected]> Co-authored-by: Marc A. Paradise <[email protected]> Co-authored-by: tyler-ball <[email protected]> Signed-off-by: Robb Kidd <[email protected]>
7c8614b
to
c10fe49
Compare
With an omnibus build of this branch:
👍 |
Another test with the actual With the current default backward compatible configuration (
With owner artifact removal disabled (
☝️ Demonstrating the now-misleading message from |
🚀 🍰 |
RFC072 Artifact Yanking
Pertinent thread recording thoughts about unsharing, permanent removal, and the disallowing of such.
TODO for this PR: