carddav.feature 4.4 KB

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