-
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
WIP: add option to disable versioning in EOS upon PUT request #4864
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
41e988f
to
a1186bd
Compare
b3c36b5
to
6b99f2e
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.
First commit! Thanks.
I've made some comments. Please clean up the commit history to split the feature (and its tests) and all the other things you had to do to be able to do the tests (like updates and registering the gw?).
I'm not able to evaluate if the tests are ok like this. I'll wait for more knowledgeable people.
b7a8ad1
to
0a396f9
Compare
c218967
to
63387a0
Compare
63387a0
to
50d93c7
Compare
a801001
to
287333f
Compare
2360468
to
f04100c
Compare
@@ -278,6 +278,9 @@ func (s *svc) handlePut(ctx context.Context, w http.ResponseWriter, r *http.Requ | |||
httpReq.Header.Set(HeaderLockHolder, lockholder) | |||
} | |||
|
|||
// Set Content-Length |
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 wonder if we should add a few more comments here. The bug in EOS is fixed, but it's still recommended to always pass the length.
@@ -26,6 +26,7 @@ import ( | |||
"strconv" | |||
|
|||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" | |||
"github.com/cs3org/reva/internal/http/services/owncloud/ocdav" |
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.
Conceptually, do you thing ocdav is the correct place to have the content length header? It seems to be that it should be in some less specific place, used both inside the ocdav code and here.
f04100c
to
9da5c22
Compare
Implemented a new function to register a GatewayServiceClient. Previously, this could only be done by passing an actual connection. However, that is unnecessarily limiting. Introducing the RegisterGatewayServiceClient allows us to register mocked gateways for unit testing
This commit introduces a new header, `X-Disable-Versioning`, that is available on PUT requests. This header will disable versioning for this file save if the storage backend is EOS. Additionally, this commit introduces two unit tests related to this functionality: - TestDisableVersioningLeadsToCorrectQueryParams: test whether disabling versioning leads to correct query parameteers for the EOS HTTP / GRPC client - TestDisableVersioningHeaderPassedAlong: test whether a header passed to the initial endpoint is propagated to the actual upload endpoint Finally, this commit also fixes a bug that was already present, where the app was not passed along in the case of token-based authz
9da5c22
to
3c5e2ca
Compare
Fix for #4855
This PR introduces a new HTTP header for PUT requests,
X-Disable-Versioning
. When this header is added to a PUT request, the EOS storage driver will turn off versioning for this particular save. This is particularly useful for applications that perform automatic saves every x minutes: disabling versioning on these automatic saves ensures that the version history of these files is not polluted