openldap-uid-username.feature 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # SPDX-FileCopyrightText: 2023 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. And having a valid LDAP configuration
  7. And modify LDAP configuration
  8. | ldapExpertUsernameAttr | uid |
  9. Scenario: Look for a expected LDAP users
  10. Given As an "admin"
  11. And sending "GET" to "/cloud/users"
  12. Then the OCS status code should be "200"
  13. And the "users" result should match
  14. | alice | 1 |
  15. | elisa | 1 |
  16. | ghost | 0 |
  17. Scenario: check default home of an LDAP user
  18. Given As an "admin"
  19. And sending "GET" to "/cloud/users/alice"
  20. Then the OCS status code should be "200"
  21. And the record's fields should match
  22. | storageLocation | /dev/shm/nc_int/alice |
  23. Scenario: check custom relative home of an LDAP user
  24. Given modify LDAP configuration
  25. | homeFolderNamingRule | sn |
  26. And As an "admin"
  27. And sending "GET" to "/cloud/users/alice"
  28. Then the OCS status code should be "200"
  29. And the record's fields should match
  30. | storageLocation | /dev/shm/nc_int/Alfgeirdottir |
  31. Scenario: check custom absolute home of an LDAP user
  32. Given modify LDAP configuration
  33. | homeFolderNamingRule | roomNumber |
  34. And As an "admin"
  35. And sending "GET" to "/cloud/users/elisa"
  36. Then the OCS status code should be "200"
  37. And the record's fields should match
  38. | storageLocation | /dev/shm/elisa-data |
  39. Scenario: Fetch all users, invoking pagination
  40. Given modify LDAP configuration
  41. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  42. | ldapPagingSize | 2 |
  43. And As an "admin"
  44. And sending "GET" to "/cloud/users"
  45. Then the OCS status code should be "200"
  46. And the "users" result should match
  47. | ebba | 1 |
  48. | eindis | 1 |
  49. | fjolnir | 1 |
  50. | gunna | 1 |
  51. | juliana | 1 |
  52. | leo | 1 |
  53. | stigur | 1 |
  54. Scenario: Fetch all users, invoking pagination
  55. Given modify LDAP configuration
  56. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  57. | ldapPagingSize | 2 |
  58. And As an "admin"
  59. And sending "GET" to "/cloud/users?limit=10"
  60. Then the OCS status code should be "200"
  61. And the "users" result should match
  62. | ebba | 1 |
  63. | eindis | 1 |
  64. | fjolnir | 1 |
  65. | gunna | 1 |
  66. | juliana | 1 |
  67. | leo | 1 |
  68. | stigur | 1 |
  69. Scenario: Fetch from second batch of all users, invoking pagination
  70. Given modify LDAP configuration
  71. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci |
  72. | ldapPagingSize | 2 |
  73. And As an "admin"
  74. And sending "GET" to "/cloud/users?limit=10&offset=2"
  75. Then the OCS status code should be "200"
  76. And the "users" result should contain "5" of
  77. | ebba |
  78. | eindis |
  79. | fjolnir |
  80. | gunna |
  81. | juliana |
  82. | leo |
  83. | stigur |
  84. Scenario: Fetch from second batch of all users, invoking pagination with two bases
  85. Given modify LDAP configuration
  86. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci;ou=PagingTestSecondBase,dc=nextcloud,dc=ci |
  87. | ldapPagingSize | 2 |
  88. And As an "admin"
  89. And sending "GET" to "/cloud/users?limit=10&offset=2"
  90. Then the OCS status code should be "200"
  91. And the "users" result should contain "5" of
  92. | ebba |
  93. | eindis |
  94. | fjolnir |
  95. | gunna |
  96. | juliana |
  97. | leo |
  98. | stigur |
  99. And the "users" result should contain "3" of
  100. | allisha |
  101. | dogukan |
  102. | lloyd |
  103. | priscilla |
  104. | shannah |
  105. Scenario: Fetch from second batch of all users, invoking pagination with two bases, third page
  106. Given modify LDAP configuration
  107. | ldapBaseUsers | ou=PagingTest,dc=nextcloud,dc=ci;ou=PagingTestSecondBase,dc=nextcloud,dc=ci |
  108. | ldapPagingSize | 2 |
  109. And As an "admin"
  110. And sending "GET" to "/cloud/users?limit=10&offset=4"
  111. Then the OCS status code should be "200"
  112. And the "users" result should contain "3" of
  113. | ebba |
  114. | eindis |
  115. | fjolnir |
  116. | gunna |
  117. | juliana |
  118. | leo |
  119. | stigur |
  120. And the "users" result should contain "1" of
  121. | allisha |
  122. | dogukan |
  123. | lloyd |
  124. | priscilla |
  125. | shannah |
  126. Scenario: Deleting an unavailable LDAP user
  127. Given As an "admin"
  128. And sending "GET" to "/cloud/users"
  129. And modify LDAP configuration
  130. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  131. And invoking occ with "ldap:check-user alice"
  132. And the command output contains the text "Clean up the user's remnants by"
  133. And invoking occ with "user:delete alice"
  134. Then the command output contains the text "The specified user was deleted"
  135. Scenario: Search only with group members - allowed
  136. Given modify LDAP configuration
  137. | ldapGroupFilter | cn=Orcharding |
  138. | ldapGroupMemberAssocAttr | member |
  139. | ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
  140. | ldapAttributesForUserSearch | employeeNumber |
  141. | useMemberOfToDetectMembership | 1 |
  142. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  143. And As an "alice"
  144. When getting sharees for
  145. # "5" is part of the employee number of some LDAP records
  146. | search | 5 |
  147. | itemType | file |
  148. Then the OCS status code should be "200"
  149. And the HTTP status code should be "200"
  150. And "exact users" sharees returned is empty
  151. And "users" sharees returned are
  152. | Elisa | 0 | elisa |
  153. And "exact groups" sharees returned is empty