gyselroth / balloon

High performance, feature rich document management system written for the cloud
GNU General Public License v3.0
18 stars 7 forks source link

Implement property storage for WebDAV #430

Open raffis opened 4 years ago

raffis commented 4 years ago

Is your feature request related to a problem? Please describe

The litmus test suite fails for the locks test because it will try to PROPPATCH properties and there is currently no dav plugin to handle those requests and ends in a Forbidden.

Describe the solution you'd like

Additional context

litmus fork github:

-> running `locks':
 0. init.................. pass
 1. begin................. pass
 2. options............... pass
 3. precond............... pass
 4. init_locks............ pass
 5. lock_on_no_file....... FAIL (COPY null locked resource should )
 6. double_sharedlock..... FAIL (shared LOCK on locked resource:
423 Locked)
 7. supportedlock......... pass
 8. unlock_on_no_file..... pass
 9. put................... pass
10. lock_excl............. pass
11. lock_excl_fail........ pass
12. lockdiscovery......... pass
13. discover.............. pass
14. refresh............... pass
15. notowner_modify....... pass
16. notowner_lock......... pass
17. owner_modify.......... FAIL (PROPPATCH of locked resource)
18. notowner_modify....... pass
19. notowner_lock......... pass
20. copy.................. pass
21. cond_put.............. pass
22. fail_cond_put......... WARNING: PUT failed with 423 not 412
    ...................... pass (with 1 warning)
23. cond_put_with_not..... pass
24. cond_put_corrupt_token pass
25. complex_cond_put...... pass
26. fail_complex_cond_put. FAIL (PUT with complex bogus conditional should fail with 412: 204 No Content)
27. unlock................ pass
28. fail_cond_put_unlocked pass
29. lock_shared........... pass
30. lock_excl_fail........ pass
31. notowner_modify....... pass
32. notowner_lock......... pass
33. owner_modify.......... FAIL (PROPPATCH of locked resource)
34. double_sharedlock..... pass
35. lock_excl_fail........ pass
36. notowner_modify....... pass
37. notowner_lock......... pass
38. cond_put.............. pass
39. fail_cond_put......... WARNING: PUT failed with 423 not 412
    ...................... pass (with 1 warning)
40. cond_put_with_not..... pass
41. cond_put_corrupt_token pass
42. complex_cond_put...... pass
43. fail_complex_cond_put. FAIL (PUT with complex bogus conditional should fail with 412: 204 No Content)
44. unlock................ pass
45. lock_infinite......... pass
46. lockdiscovery......... pass
47. supportedlock......... pass
48. notowner_modify....... pass
49. notowner_lock......... pass
50. discover.............. pass
51. refresh............... pass
52. unlock_fail........... pass
53. lock_invalid_depth.... pass
54. unlock................ pass
55. prep_collection....... pass
56. conflicting_locks..... FAIL (Conflicting LOCK should fail)
57. lock_collection....... FAIL (LOCK on `/webdav/litmus/lockcoll/conflict.txt': 423 Locked)
58. supportedlock......... SKIPPED
59. owner_modify.......... SKIPPED
60. notowner_modify....... SKIPPED
61. newowner_modify_notoken...................... SKIPPED
62. newowner_modify_correcttoken...................... SKIPPED
63. refresh............... SKIPPED
64. indirect_refresh...... SKIPPED
65. unlock................ SKIPPED
66. unmap_lockroot........ FAIL (MKCOL - 1 /webdav/litmus/lockcoll/collX/: 423 Locked)
67. lockcleanup........... pass
68. finish................ pass
-> 8 tests were skipped.
<- summary for `locks': of 61 tests run: 52 passed, 9 failed. 85.2%
-> 2 warnings were issued.

litmus 0.13:

-> 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....... pass
10. notowner_lock......... pass
11. owner_modify.......... FAIL (PROPPATCH on locked resouce on `/webdav/litmus/lockme': http://localhost:8084/webdav/litmus/lockme: 403 Forbidden
)
12. notowner_modify....... pass
13. notowner_lock......... pass
14. copy.................. pass
15. cond_put.............. pass
16. fail_cond_put......... WARNING: PUT failed with 423 not 412
    ...................... pass (with 1 warning)
17. cond_put_with_not..... pass
18. cond_put_corrupt_token pass
19. complex_cond_put...... pass
20. fail_complex_cond_put. FAIL (PUT with complex bogus conditional should fail with 412: 204 No Content)
21. unlock................ pass
22. fail_cond_put_unlocked pass
23. lock_shared........... pass
24. notowner_modify....... pass
25. notowner_lock......... pass
26. owner_modify.......... FAIL (PROPPATCH on locked resouce on `/webdav/litmus/lockme': http://localhost:8084/webdav/litmus/lockme: 403 Forbidden
)
27. double_sharedlock..... pass
28. notowner_modify....... pass
29. notowner_lock......... pass
30. unlock................ pass
31. prep_collection....... pass
32. lock_collection....... pass
33. owner_modify.......... FAIL (PROPPATCH on locked resouce on `/webdav/litmus/lockcoll/lockme.txt': http://localhost:8084/webdav/litmus/lockcoll/lockme.txt: 403 Forbidden
)
34. notowner_modify....... pass
35. refresh............... pass
36. indirect_refresh...... pass
37. unlock................ pass
38. unmapped_lock......... pass
39. unlock................ pass
40. finish................ pass
<- summary for `locks': of 41 tests run: 37 passed, 4 failed. 90.2%
-> 1 warning was issued.

For example test 33:

>>>  REQUEST  ===========================================
PROPPATCH /webdav/litmus/lockcoll/lockme.txt HTTP/1.1
Host: localhost:8084
Authorization: Basic YWRtaW46YWRtaW4=
  username: admin
  password: admin
Connection: TE
Content-Length: 188
Content-Type: application/xml
If: <http://localhost:3128/webdav/litmus/lockcoll/> (<opaquelocktoken:b982367d-31ff-418c-a4d2-0afdf28021e3>)
Te: trailers
User-Agent: litmus/0.13 neon/0.29.6
X-Litmus: locks: 33 (owner_modify)

<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:"><D:set><D:prop><random xmlns="http://webdav.org/neon/litmus/">foobar</random></D:prop></D:set>
</D:propertyupdate>

79.293 ms to relay request

<<<  RESPONSE  ==========================================
HTTP/1.1 207 Multi-Status
Content-Length: 316
Content-Type: application/xml; charset=utf-8
Date: Thu, 19 Dec 2019 08:46:44 GMT
Server: nginx/1.17.6
Vary: Brief,Prefer
X-Powered-By: PHP/7.3.12
X-Sabre-Version: 4.0.2

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"><d:response><d:href>/webdav/litmus/lockcoll/lockme.txt</d:href><d:propstat><d:prop><x1:random xmlns:x1="http://webdav.org/neon/litmus/"/></d:prop><d:status>HTTP/1.1 403 Forbidden</d:status></d:propstat></d:response></d:multistatus>

0.001 ms to receive response
0.003 ms to relay response