You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ldap-openldap.feature 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. Feature: LDAP
  2. Background:
  3. Given using api version "2"
  4. And having a valid LDAP configuration
  5. Scenario: Test valid configuration by logging in
  6. Given Logging in using web as "alice"
  7. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  8. Then the HTTP status code should be "200"
  9. Scenario: Test valid configuration with port in the hostname by logging in
  10. Given modify LDAP configuration
  11. | ldapHost | openldap:389 |
  12. And cookies are reset
  13. And Logging in using web as "alice"
  14. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  15. Then the HTTP status code should be "200"
  16. Scenario: Test valid configuration with LDAP protocol by logging in
  17. Given modify LDAP configuration
  18. | ldapHost | ldap://openldap |
  19. And cookies are reset
  20. And Logging in using web as "alice"
  21. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  22. Then the HTTP status code should be "200"
  23. Scenario: Test valid configuration with LDAP protocol and port by logging in
  24. Given modify LDAP configuration
  25. | ldapHost | ldap://openldap:389 |
  26. And cookies are reset
  27. And Logging in using web as "alice"
  28. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  29. Then the HTTP status code should be "200"
  30. Scenario: Look for a known LDAP user
  31. Given As an "admin"
  32. And sending "GET" to "/cloud/users?search=alice"
  33. Then the OCS status code should be "200"
  34. And looking up details for the first result matches expectations
  35. | email | alice@nextcloud.ci |
  36. | displayname | Alice |
  37. Scenario: Test group filter with one specific group
  38. Given modify LDAP configuration
  39. | ldapGroupFilter | cn=RedGroup |
  40. | ldapGroupMemberAssocAttr | member |
  41. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  42. And As an "admin"
  43. And sending "GET" to "/cloud/groups"
  44. Then the OCS status code should be "200"
  45. And the "groups" result should match
  46. | RedGroup | 1 |
  47. | GreenGroup | 0 |
  48. | BlueGroup | 0 |
  49. | PurpleGroup | 0 |
  50. Scenario: Test group filter with two specific groups
  51. Given modify LDAP configuration
  52. | ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) |
  53. | ldapGroupMemberAssocAttr | member |
  54. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  55. And As an "admin"
  56. And sending "GET" to "/cloud/groups"
  57. Then the OCS status code should be "200"
  58. And the "groups" result should match
  59. | RedGroup | 1 |
  60. | GreenGroup | 1 |
  61. | BlueGroup | 0 |
  62. | PurpleGroup | 0 |
  63. Scenario: Test group filter ruling out a group from a different base
  64. Given modify LDAP configuration
  65. | ldapGroupFilter | (objectClass=groupOfNames) |
  66. | ldapGroupMemberAssocAttr | member |
  67. | ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
  68. And As an "admin"
  69. And sending "GET" to "/cloud/groups"
  70. Then the OCS status code should be "200"
  71. And the "groups" result should match
  72. | RedGroup | 1 |
  73. | GreenGroup | 1 |
  74. | BlueGroup | 1 |
  75. | PurpleGroup | 1 |
  76. | SquareGroup | 0 |
  77. Scenario: Test backup server
  78. Given modify LDAP configuration
  79. | ldapBackupHost | openldap |
  80. | ldapBackupPort | 389 |
  81. | ldapHost | foo.bar |
  82. | ldapPort | 2456 |
  83. And Logging in using web as "alice"
  84. Then the HTTP status code should be "200"
  85. Scenario: Test backup server offline
  86. Given modify LDAP configuration
  87. | ldapBackupHost | off.line |
  88. | ldapBackupPort | 3892 |
  89. | ldapHost | foo.bar |
  90. | ldapPort | 2456 |
  91. Then Expect ServerException on failed web login as "alice"
  92. Scenario: Test LDAP server offline, no backup server
  93. Given modify LDAP configuration
  94. | ldapHost | foo.bar |
  95. | ldapPort | 2456 |
  96. Then Expect ServerException on failed web login as "alice"
  97. Scenario: Test LDAP group membership with intermediate groups not matching filter
  98. Given modify LDAP configuration
  99. | ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
  100. | ldapGroupFilter | (&(cn=Gardeners)(objectclass=groupOfNames)) |
  101. | ldapNestedGroups | 1 |
  102. | useMemberOfToDetectMembership | 1 |
  103. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  104. | ldapExpertUsernameAttr | uid |
  105. | ldapGroupMemberAssocAttr | member |
  106. And As an "admin"
  107. # for population
  108. And sending "GET" to "/cloud/groups"
  109. And sending "GET" to "/cloud/groups/Gardeners/users"
  110. Then the OCS status code should be "200"
  111. And the "users" result should match
  112. | alice | 0 |
  113. | clara | 1 |
  114. | elisa | 1 |
  115. | gustaf | 1 |
  116. | jesper | 1 |
  117. Scenario: Test LDAP group membership with intermediate groups not matching filter and without memberof
  118. Given modify LDAP configuration
  119. | ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
  120. | ldapGroupFilter | (&(cn=Gardeners)(objectclass=groupOfNames)) |
  121. | ldapNestedGroups | 1 |
  122. | useMemberOfToDetectMembership | 0 |
  123. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  124. | ldapExpertUsernameAttr | uid |
  125. | ldapGroupMemberAssocAttr | member |
  126. And As an "admin"
  127. # for population
  128. And sending "GET" to "/cloud/groups"
  129. And sending "GET" to "/cloud/groups/Gardeners/users"
  130. Then the OCS status code should be "200"
  131. And the "users" result should match
  132. | alice | 0 |
  133. | clara | 1 |
  134. | elisa | 1 |
  135. | gustaf | 1 |
  136. | jesper | 1 |
  137. Scenario: Test LDAP group membership with intermediate groups not matching filter, numeric group ids
  138. Given modify LDAP configuration
  139. | ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
  140. | ldapGroupFilter | (&(cn=2000)(objectclass=groupOfNames)) |
  141. | ldapNestedGroups | 1 |
  142. | useMemberOfToDetectMembership | 1 |
  143. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  144. | ldapExpertUsernameAttr | uid |
  145. | ldapGroupMemberAssocAttr | member |
  146. And As an "admin"
  147. # for population
  148. And sending "GET" to "/cloud/groups"
  149. And sending "GET" to "/cloud/groups/2000/users"
  150. Then the OCS status code should be "200"
  151. And the "users" result should match
  152. | alice | 0 |
  153. | clara | 1 |
  154. | elisa | 1 |
  155. | gustaf | 1 |
  156. | jesper | 1 |