Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix gateway handle list objects versions #7028
Fix gateway handle list objects versions #7028
Changes from all commits
5bfc6f6
0e163b8
770fa67
6747272
551ab3f
d47dc98
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think we're missing a
default
case here! Even if we keep going in order to fail later, I would really like a log (level TRACE) for each of the four cases. Otherwise debugging a bad request will be that much harder.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.
The
o.OperationID = operations.OperationIDOperationNotFound
assigned before the switch case, I wanted to log this request as operation not found and let it fall into the handler.In the previous version, it was odd that we had handler in the switch that returns after
w.WriteHeader(http.StatusNotFound)
and in casepathBasedOperationID
returnsOperationIDOperationNotFound
we continue to fall and handle it after logging.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.
Still open? Reminder, there are 2 things here
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 still open.
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 we
HandleUnsupported
here? One day we'll add delete-part or something, and even before that this is less uniform so I need to think harder when reading 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.
The thing here was that POST on bucket/repo level is
postpolicybucket
operations (no query parameters) and the only other operation in this level is"deletemultipleobjects
(query parameter "delete").In all other cases
HandleUnsupported
handled the non-default case, and here we don't handle the default case.As I didn't wanted to manage a whitelist, at least until we will have a better router for the S3 gateway, I thought this will make more sense.
Let me know what you think.
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.
Pleased? (Or say no, that also works -- prefer not to leave this open)
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 would really not like to delete someone's object because they did some random POST. But if we cannot lock it down, we cannot lock it down...