1
0

openldap-numerical-id.feature 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. Feature: LDAP
  2. Background:
  3. Given using api version "2"
  4. And having a valid LDAP configuration
  5. And modify LDAP configuration
  6. | ldapExpertUsernameAttr | employeeNumber |
  7. | ldapLoginFilter | (&(objectclass=inetorgperson)(employeeNumber=%uid)) |
  8. # Those tests are dedicated to ensure Nc is working when it is provided with
  9. # users having numerical IDs
  10. Scenario: Look for a expected LDAP users
  11. Given As an "admin"
  12. And sending "GET" to "/cloud/users"
  13. Then the OCS status code should be "200"
  14. And the "users" result should match
  15. | 92379 | 1 |
  16. | 50194 | 1 |
  17. Scenario: check default home of an LDAP user
  18. Given As an "admin"
  19. And sending "GET" to "/cloud/users/92379"
  20. Then the OCS status code should be "200"
  21. And the record's fields should match
  22. | storageLocation | /dev/shm/nc_int/92379 |
  23. Scenario: Test by logging in
  24. Given cookies are reset
  25. And Logging in using web as "92379"
  26. And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  27. Then the HTTP status code should be "200"
  28. Scenario: Test LDAP group retrieval with numeric group ids and nesting
  29. # Nesting does not play a role here really
  30. Given modify LDAP configuration
  31. | ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
  32. | ldapGroupFilter | (objectclass=groupOfNames) |
  33. | ldapGroupMemberAssocAttr | member |
  34. | ldapNestedGroups | 1 |
  35. | useMemberOfToDetectMembership | 1 |
  36. And As an "admin"
  37. And sending "GET" to "/cloud/groups"
  38. Then the OCS status code should be "200"
  39. And the "groups" result should match
  40. | 2000 | 1 |
  41. | 3000 | 1 |
  42. | 3001 | 1 |
  43. | 3002 | 1 |
  44. Scenario: Test LDAP group membership with intermediate groups not matching filter, numeric group ids
  45. Given modify LDAP configuration
  46. | ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
  47. | ldapGroupFilter | (&(cn=2000)(objectclass=groupOfNames)) |
  48. | ldapNestedGroups | 1 |
  49. | useMemberOfToDetectMembership | 1 |
  50. | ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
  51. | ldapGroupMemberAssocAttr | member |
  52. And As an "admin"
  53. # for population
  54. And sending "GET" to "/cloud/groups"
  55. And sending "GET" to "/cloud/groups/2000/users"
  56. Then the OCS status code should be "200"
  57. And the "users" result should match
  58. | 92379 | 0 |
  59. | 54172 | 1 |
  60. | 50194 | 1 |
  61. | 59376 | 1 |
  62. | 59463 | 1 |
  63. Scenario: Test LDAP admin group mapping, empowered user
  64. Given modify LDAP configuration
  65. | ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
  66. | ldapGroupFilter | (objectclass=groupOfNames) |
  67. | ldapGroupMemberAssocAttr | member |
  68. | ldapAdminGroup | 3001 |
  69. | useMemberOfToDetectMembership | 1 |
  70. And cookies are reset
  71. # alice, part of the promoted group
  72. And Logging in using web as "92379"
  73. And sending "GET" to "/cloud/groups"
  74. And sending "GET" to "/cloud/groups/2000/users"
  75. And Sending a "GET" to "/index.php/settings/admin/overview" with requesttoken
  76. Then the HTTP status code should be "200"
  77. Scenario: Test LDAP admin group mapping, regular user (no access)
  78. Given modify LDAP configuration
  79. | ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
  80. | ldapGroupFilter | (objectclass=groupOfNames) |
  81. | ldapGroupMemberAssocAttr | member |
  82. | ldapAdminGroup | 3001 |
  83. | useMemberOfToDetectMembership | 1 |
  84. And cookies are reset
  85. # gustaf, not part of the promoted group
  86. And Logging in using web as "59376"
  87. And Sending a "GET" to "/index.php/settings/admin/overview" with requesttoken
  88. Then the HTTP status code should be "403"