carddav.feature 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: carddav
  4. Scenario: Accessing a not existing addressbook of another user
  5. Given user "user0" exists
  6. When "admin" requests addressbook "user0/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  7. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  8. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  9. Scenario: Accessing a not shared addressbook of another user
  10. Given user "user0" exists
  11. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  12. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  13. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  14. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  15. Scenario: Accessing a not existing addressbook of another user via legacy endpoint
  16. Given user "user0" exists
  17. When "admin" requests addressbook "user0/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/carddav/addressbooks/"
  18. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  19. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  20. Scenario: Accessing a not shared addressbook of another user via legacy endpoint
  21. Given user "user0" exists
  22. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  23. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/carddav/addressbooks/"
  24. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  25. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  26. Scenario: Accessing a not existing addressbook of myself
  27. Given user "user0" exists
  28. When "user0" requests addressbook "admin/MyAddressbook" with statuscode "404" on the endpoint "/remote.php/dav/addressbooks/users/"
  29. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  30. And The CardDAV error message is "Addressbook with name 'MyAddressbook' could not be found"
  31. Scenario: Creating a new addressbook
  32. When "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  33. Then "admin" requests addressbook "admin/MyAddressbook" with statuscode "207" on the endpoint "/remote.php/dav/addressbooks/users/"
  34. Scenario: Accessing ones own contact
  35. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  36. Given "admin" uploads the contact "bjoern.vcf" to the addressbook "MyAddressbook"
  37. When Downloading the contact "bjoern.vcf" from addressbook "MyAddressbook" as user "admin"
  38. Then The following HTTP headers should be set
  39. |Content-Disposition|attachment; filename*=UTF-8''bjoern.vcf; filename="bjoern.vcf"|
  40. |Content-Type|text/vcard; charset=utf-8|
  41. |Content-Security-Policy|default-src 'none';|
  42. |X-Content-Type-Options |nosniff|
  43. |X-Frame-Options|SAMEORIGIN|
  44. |X-Permitted-Cross-Domain-Policies|none|
  45. |X-Robots-Tag|noindex, nofollow|
  46. |X-XSS-Protection|1; mode=block|
  47. Scenario: Exporting the picture of ones own contact
  48. Given "admin" creates an addressbook named "MyAddressbook" with statuscode "201"
  49. Given "admin" uploads the contact "bjoern.vcf" to the addressbook "MyAddressbook"
  50. When Exporting the picture of contact "bjoern.vcf" from addressbook "MyAddressbook" as user "admin"
  51. Then The following HTTP headers should be set
  52. |Content-Disposition|attachment; filename=bjoern.vcf.jpg|
  53. |Content-Type|image/jpeg|
  54. |Content-Security-Policy|default-src 'none';|
  55. |X-Content-Type-Options |nosniff|
  56. |X-Frame-Options|SAMEORIGIN|
  57. |X-Permitted-Cross-Domain-Policies|none|
  58. |X-Robots-Tag|noindex, nofollow|
  59. |X-XSS-Protection|1; mode=block|
  60. Scenario: Create addressbook request for non-existing addressbook of another user
  61. Given user "user0" exists
  62. When "user0" sends a create addressbook request to "admin/MyAddressbook2" on the endpoint "/remote.php/dav/addressbooks/"
  63. Then The CardDAV HTTP status code should be "404"
  64. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  65. And The CardDAV error message is "File not found: admin in 'addressbooks'"
  66. Scenario: Create addressbook request for existing addressbook of another user
  67. Given user "user0" exists
  68. When "admin" creates an addressbook named "MyAddressbook2" with statuscode "201"
  69. When "user0" sends a create addressbook request to "admin/MyAddressbook2" on the endpoint "/remote.php/dav/addressbooks/"
  70. Then The CardDAV HTTP status code should be "404"
  71. And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
  72. And The CardDAV error message is "File not found: admin in 'addressbooks'"