1
0

ldap-ocs.feature 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: LDAP
  4. Background:
  5. Given using api version "2"
  6. Scenario: Creating an new, empty configuration
  7. Given As an "admin"
  8. When sending "POST" to "/apps/user_ldap/api/v1/config"
  9. Then the OCS status code should be "200"
  10. And the HTTP status code should be "200"
  11. And the response should contain a tag "configID"
  12. Scenario: Delete a non-existing configuration
  13. Given As an "admin"
  14. When sending "DELETE" to "/apps/user_ldap/api/v1/config/s666"
  15. Then the OCS status code should be "404"
  16. And the HTTP status code should be "404"
  17. Scenario: Create and delete a configuration
  18. Given As an "admin"
  19. And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
  20. When deleting the LDAP configuration
  21. Then the OCS status code should be "200"
  22. And the HTTP status code should be "200"
  23. Scenario: Create and modify a configuration
  24. Given As an "admin"
  25. And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
  26. When setting the LDAP configuration to
  27. | configData[ldapHost] | ldaps://my.ldap.server |
  28. Then the OCS status code should be "200"
  29. And the HTTP status code should be "200"
  30. Scenario: Modifying a non-existing configuration
  31. Given As an "admin"
  32. When sending "PUT" to "/apps/user_ldap/api/v1/config/s666" with
  33. | configData[ldapHost] | ldaps://my.ldap.server |
  34. Then the OCS status code should be "404"
  35. And the HTTP status code should be "404"
  36. Scenario: Modifying an existing configuration with malformed configData
  37. Given As an "admin"
  38. And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
  39. When setting the LDAP configuration to
  40. | configData | ldapHost=ldaps://my.ldap.server |
  41. Then the OCS status code should be "400"
  42. And the HTTP status code should be "400"
  43. Scenario: create, modify and get a configuration
  44. Given As an "admin"
  45. And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
  46. And setting the LDAP configuration to
  47. | configData[ldapHost] | ldaps://my.ldap.server |
  48. | configData[ldapLoginFilter] | (&(\|(objectclass=inetOrgPerson))(uid=%uid)) |
  49. | configData[ldapAgentPassword] | psst,secret |
  50. When getting the LDAP configuration with showPassword "0"
  51. Then the OCS status code should be "200"
  52. And the HTTP status code should be "200"
  53. And the response should contain a tag "ldapHost" with value "ldaps://my.ldap.server"
  54. And the response should contain a tag "ldapLoginFilter" with value "(&(|(objectclass=inetOrgPerson))(uid=%uid))"
  55. And the response should contain a tag "ldapAgentPassword" with value "***"
  56. Scenario: receiving password in plain text
  57. Given As an "admin"
  58. And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
  59. And setting the LDAP configuration to
  60. | configData[ldapAgentPassword] | psst,secret |
  61. When getting the LDAP configuration with showPassword "1"
  62. Then the OCS status code should be "200"
  63. And the HTTP status code should be "200"
  64. And the response should contain a tag "ldapAgentPassword" with value "psst,secret"