Skip to content
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

Webdav LOCK operations #1284

Closed
PVince81 opened this issue May 5, 2020 · 12 comments
Closed

Webdav LOCK operations #1284

PVince81 opened this issue May 5, 2020 · 12 comments

Comments

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

Running on ocis dd985d9

docker run -e LITMUS_URL="http://172.17.0.1:9140/remote.php/webdav" -e LITMUS_USERNAME="einstein" -e LITMUS_PASSWORD="relativity" -e TESTS="locks" owncloud/litmus:latest
-> running `locks':
 0. init.................. pass
 1. begin................. pass
 2. options............... pass
 3. precond............... pass
 4. init_locks............ pass
 5. put................... pass
 6. lock_excl............. pass
 7. discover.............. pass
 8. refresh............... pass
 9. notowner_modify....... FAIL (DELETE of locked resource should fail)
10. notowner_lock......... FAIL (LOCK on locked resource)
11. owner_modify.......... pass
12. notowner_modify....... FAIL (DELETE of locked resource should fail)
13. notowner_lock......... FAIL (LOCK on locked resource)
14. copy.................. FAIL (could not COPY locked resource:
404 Not Found)
15. cond_put.............. SKIPPED
16. fail_cond_put......... SKIPPED
17. cond_put_with_not..... pass
18. cond_put_corrupt_token FAIL (conditional PUT with invalid lock-token should fail: 204 No Content)
19. complex_cond_put...... pass
20. unlock................ FAIL (UNLOCK on `/remote.php/webdav/litmus/lockme': 501 Not Implemented)
21. fail_cond_put_unlocked FAIL (conditional PUT with invalid lock-token should fail: 204 No Content)
22. lock_shared........... FAIL (requested lockscope not satisfied!  got shared, wanted exclusive)
23. notowner_modify....... SKIPPED
24. notowner_lock......... SKIPPED
25. owner_modify.......... SKIPPED
26. double_sharedlock..... SKIPPED
27. notowner_modify....... SKIPPED
28. notowner_lock......... SKIPPED
29. unlock................ SKIPPED
30. prep_collection....... pass
31. lock_collection....... pass
32. owner_modify.......... pass
33. notowner_modify....... FAIL (DELETE of locked resource should fail)
34. refresh............... pass
35. indirect_refresh...... pass
36. unlock................ FAIL (UNLOCK on `/remote.php/webdav/litmus/lockcoll/': 501 Not Implemented)
37. unmapped_lock......... See debug.log for network/debug traces.
Segmentation fault (core dumped)
@PVince81 PVince81 changed the title Missing/broken Webdav LOCK operations Webdav LOCK operations Jun 5, 2020
@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@refs refs added the Category:Technical Technical ehancements label Jan 19, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@stale
Copy link

stale bot commented Jun 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Oct 31, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@phil-davis
Copy link
Contributor

phil-davis commented Oct 31, 2021

I added the Technical Debt label to stop the stale bot from closing this. IMO this is still a valid issue.

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Feb 3, 2022

Exclusive Locks Feature

using old/new/spaces webdav versions:

  • a second lock can be set on a folder when its exclusively locked

    second lock request
      LOCK /remote.php/webdav/textfile0.txt HTTP/1.1
      Host: localhost:9200
      User-Agent: GuzzleHttp/7
      Authorization: Basic QWxpY2U6MTIzNDU2
      X-Request-ID: apiWebdavLocks/exclusiveLocks.feature:7-12
      Content-Length: 120
       HTTP/1.1 200 OK
    

    Access-Control-Allow-Origin: *
    Content-Length: 321
    Content-Security-Policy: default-src 'none';
    Content-Type: text/xml; charset="utf-8"
    Date: Thu, 03 Feb 2022 07:09:48 GMT
    Lock-Token: opaquelocktoken:00000000-0000-0000-0000-000000000000
    Vary: Origin
    X-Content-Type-Options: nosniff
    X-Download-Options: noopen
    X-Frame-Options: SAMEORIGIN
    X-Permitted-Cross-Domain-Policies: none
    X-Robots-Tag: none
    X-Xss-Protection: 1; mode=block

      <prop xmlns="DAV:">
          <lockdiscovery>
      	    <activelock>
      		    <allprop/>
      		    <timeout>Second-604800</timeout>
      		    <depth>Infinity</depth>
      		    <locktoken>
      		    <href>opaquelocktoken:00000000-0000-0000-0000-000000000000</href>
      		    </locktoken>
      	    </activelock>
          </lockdiscovery>
      </prop>
    
  • if a parent resource is exclusively locked a child resource can be locked again

  • if a parent resource is exclusively locked with depth 0 a child resource cannot be locked again

  • if a child resource is exclusively locked a parent resource can be locked again

  • if a child resource is exclusively locked a parent resource cannot be locked with depth 0

    parent lock is successful but if we try to list locks in the file inside the sub folder, if find no locks
          PROPFIND /remote.php/webdav/PARENT/CHILD/child.txt HTTP/1.1
          Host: localhost:9200
          User-Agent: GuzzleHttp/7
          Authorization: Basic QWxpY2U6MTIzNDU2
          X-Request-ID: apiWebdavLocks/exclusiveLocks.feature:103-114
          Content-Length: 114
    
      <?xml version='1.0' encoding='UTF-8'?><d:propfind xmlns:d='DAV:'> <d:prop><d:lockdiscovery/></d:prop></d:propfind>HTTP/1.1 207 Multi-Status
      Access-Control-Allow-Origin: *
      Access-Control-Expose-Headers: Tus-Resumable, Tus-Version, Tus-Extension
      Content-Length: 557
      Content-Security-Policy: default-src 'none';
      Content-Type: application/xml; charset=utf-8
      Date: Thu, 03 Feb 2022 07:59:54 GMT
      Dav: 1, 3, extended-mkcol
      Tus-Extension: creation,creation-with-upload,checksum,expiration
      Tus-Resumable: 1.0.0
      Tus-Version: 1.0.0
      Vary: Origin
      X-Content-Type-Options: nosniff
      X-Download-Options: noopen
      X-Frame-Options: SAMEORIGIN
      X-Permitted-Cross-Domain-Policies: none
      X-Robots-Tag: none
      X-Xss-Protection: 1; mode=block
      
      <?xml version="1.0" encoding="utf-8"?><d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns"><d:response><d:href>/remote.php/webdav/PARENT/CHILD/child.txt</d:href><d:propstat><d:prop><d:lockdiscovery></d:lockdiscovery></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/PARENT/CHILD/child.txt</d:href><d:propstat><d:prop><d:lockdiscovery></d:lockdiscovery></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>
    
  • a share receiver can lock a resource exclusively locked by itself

  • a share receiver can lock a resource exclusively locked by the owner

  • a share owner can lock a resource exclusively locked by a share receiver

acceptance tests coverage @ apiWebdavLocks/exclusiveLocks.feature

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Feb 3, 2022

Folders

Using any of the WebDAV versions (old or new or spaces)

  • user can upload to a locked folder
  • user can upload to a subfolder of a locked folder
  • user can create a folder in a locked folder
  • user can create a folder in a subfolder of a locked folder
  • user can move file out of a locked folder
  • user can move the file out of a locked subfolder one level higher into a locked parent folder
  • user doesn't get lockdiscovery of a locked folder

acceptance tests coverage @ apiWebdavLocks/folder.feature

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Feb 3, 2022

Public Link

Using any of the WebDAV versions (old or new or spaces)

  • user can upload a file into a locked public folder

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Feb 3, 2022

Requests with token

Using any of the WebDAV versions (old or new or spaces)

  • move a file into a locked folder is possible when using the wrong token (move requests ends with 201)
  • share receiver can rename a file in a folder locked by the owner even when sending the locktoken

acceptance tests coverage @ apiWebdavLocks/requestsWithToken.feature

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Feb 8, 2022

Unlock operations

501 Not implemented with any of the DAV version

Response with old webdav version
UNLOCK /remote.php/webdav/PARENT HTTP/1.1
Host: localhost:9200
User-Agent: GuzzleHttp/7
Authorization: Basic QWxpY2U6MTIzNDU2
Lock-Token: opaquelocktoken:00000000-0000-0000-0000-000000000000
X-Request-ID: apiWebdavLocksUnlock/unlock.feature:22-15

HTTP/1.1 501 Not Implemented
Access-Control-Allow-Origin: *
Content-Length: 0
Content-Security-Policy: default-src 'none';
Date: Tue, 08 Feb 2022 11:58:14 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-Xss-Protection: 1; mode=block

Response with new webdav version
UNLOCK /remote.php/dav/files/Alice/PARENT HTTP/1.1
Host: localhost:9200
User-Agent: GuzzleHttp/7
Authorization: Basic QWxpY2U6MTIzNDU2
Lock-Token: opaquelocktoken:00000000-0000-0000-0000-000000000000
X-Request-ID: apiWebdavLocksUnlock/unlock.feature:23-15

HTTP/1.1 501 Not Implemented
Access-Control-Allow-Origin: *
Content-Length: 0
Content-Security-Policy: default-src 'none';
Date: Tue, 08 Feb 2022 11:58:16 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-Xss-Protection: 1; mode=block

Response with spaces webdav version
UNLOCK /dav/spaces/d3bb15fd-f689-435d-84e1-4d16d4d1cdda/PARENT HTTP/1.1
Host: localhost:9200
User-Agent: GuzzleHttp/7
Authorization: Basic QWxpY2U6MTIzNDU2
Lock-Token: opaquelocktoken:00000000-0000-0000-0000-000000000000
X-Request-ID: apiWebdavLocksUnlock/unlock.feature:30-15

HTTP/1.1 501 Not Implemented
Access-Control-Allow-Origin: *
Content-Length: 0
Content-Security-Policy: default-src 'none';
Date: Tue, 08 Feb 2022 11:58:21 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-Xss-Protection: 1; mode=block

@micbar
Copy link
Contributor

micbar commented Sep 6, 2022

Ocis and oc10 only support locking on single files.

We have no plans to do more in the future. I hope that clarifies it.

@SagarGi
Copy link
Member

SagarGi commented Sep 7, 2022

@micbar @phil-davis @ScharfViktor i referenced to oc10 which has similar tests for locking a folder and uploading file to it. And i think we have tests like

    Given using <dav-path> DAV path
    And user "Alice" has created folder "FOLDER"
    And user "Alice" has locked folder "FOLDER" setting the following properties
      | lockscope | <lock-scope> |
    When user "Alice" uploads file "filesForUpload/textfile.txt" to "/FOLDER/textfile.txt" using the WebDAV API
    Then the HTTP status code should be "423"
    And as "Alice" file "/FOLDER/textfile.txt" should not exist
    Examples:
      | dav-path | lock-scope |
      | old      | shared     |
      | old      | exclusive  |
      | new      | shared     |
      | new      | exclusive  |

    @personalSpace @skipOnOcV10
    Examples:
      | dav-path | lock-scope |
      | spaces   | shared     |
      | spaces   | exclusive  |

And seems locking a folder is possible in oc10. And with this issue thought it would be implemented. But thanks for the clarification. May be we can minimize the expected failure related to lock for ocis from this. And also i am currently adding lock related tests on ocis and may be it is also not needed to run on ocis.

@micbar i will be creating an issue to put a tag notToImplementOnOcis for all folder related tests on oc10 for ocis.

@micbar
Copy link
Contributor

micbar commented Sep 7, 2022

@SagarGi Thanks!

@fschade
Copy link
Contributor

fschade commented Jun 4, 2024

Please open again if the ticket is still relevant

@fschade fschade closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants