-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support for multi-arg rm and rmdir #517
base: main
Are you sure you want to change the base?
Conversation
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.
It looks like a breaking change. Instead of modifying filename
field, we could add filenames
field of type repeated string
and on server side filename
value will be used only if filenames
field is empty.
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.
I looked into some options and I don't think there's a nice way of doing this for us. Technically, with current code (before the fix below) new-client-old-server scenario would just result in deletion of the last file, with the approach above its going to be first-file deleted only, so I implemented that for now.
That being said, we have no good way (without connecting that is) of knowing what version of SansShell server we're sending the request to, so we'll have to populate both of these fields at all times basically to ensure that both old and new versions work.
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.
Prop renaming also will cause non backward compatible changes of opa policy and could open backdoor to remove what actually should't be removed.
To avoid this lets avoid request shape changes, instead send several remove requests to remove single file/dir
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.
Prop renaming also will cause non backward compatible changes of opa policy and could open backdoor to remove what actually should't be removed.
To avoid this lets avoid request shape changes, instead send several remove requests to remove single file/dir
Changes
rm
andrmdir
to accept multiple args (absolute paths) and return a compound error for any dirs/files that failed to be deleted. Also add-r
flag tormdir
which deletes everything inside of directory, along with directory itself. Behaviour in general follows coreutilsrm
with-r
flag.