-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[tests-only] Tus tests for uploading to shared files with checksums #38484
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.
LGTM
When user "Brian" creates a new TUS resource on the WebDAV API with these headers: | ||
| Tus-Resumable | 1.0.0 | | ||
| Upload-Length | 16 | | ||
| Upload-Metadata | filename L1NoYXJlcy9GT0xERVIvdGV4dGZpbGUudHh0 | |
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 is hard to understand the encrypted name and would have been better if there is a comment somewhere that says what is the actual name of this file.
But, that's just a suggestion. Everything looks good to me anyway. 👍
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 encrypted file name can be seen here https://github.com/owncloud/core/pull/38484/files#diff-0613ee3f838a6348f280cfa6593798e61953aea15b0fb94b85d92335095700d9R91.
So far for all the tests we haven't mentioned the encrypted file name(which is sent as metadata to created the file) in any comments so I don't if we should or shouldn't do it. @individual-it what do you think about this idea of mentioning encrypted filename in a comment?
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 it would be good to mention. maybe let's have an other PR doing that for all places
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.
please also add tests where
- the sharer upload a file in a shared folder and the receiver checks the checksum with propfind and in the header
- upload with other checksum types
- upload with chucks to a share (from both sides)
- upload wrong checkssums (from both sides)
if you like some or all of those things could go in a separate PR
| Tus-Resumable | 1.0.0 | | ||
| Tus-Version | 1.0.0 | | ||
| Tus-Extension | creation,creation-with-upload,checksum | | ||
| Tus-Checksum-Algorithm | md5,sha1,adler32 | |
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.
these tests are good, but IMO don't belong into this PR as it claims to be about shares
| Upload-Metadata | filename L1NoYXJlcy9GT0xERVIvdGV4dGZpbGUudHh0 | | ||
And user "Brian" uploads file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e7b" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API | ||
Then as "Alice" file "/FOLDER/textfile.txt" should exist | ||
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "uploaded content" |
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.
checking the checksum in header and by webdav would be useful
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.
apart from everything mentioned already looks good
7fe3b9b
to
397386d
Compare
@individual-it I have added all these tests and removed changes done in tests for |
And user "Alice" has created a new TUS resource on the WebDAV API with these headers: | ||
| Upload-Length | 5 | | ||
| Upload-Metadata | filename L0ZPTERFUi90ZXh0RmlsZS50eHQ= | | ||
And user "Alice" uploads file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513954" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API |
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.
And user "Alice" uploads file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513954" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API | |
When user "Alice" uploads file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513954" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API |
I think this is supposed to be a When
step
397386d
to
bd4b4fb
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.
LGTM 👍
bd4b4fb
to
0abc926
Compare
7d0ebfa
to
51fafc8
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
This PR adds tests for:
Related Issue
How Has This Been Tested?
Types of changes
Checklist: