2018-03-15 20:39:27 +03:00
|
|
|
Feature: LDAP
|
|
|
|
Background:
|
|
|
|
Given using api version "2"
|
2018-04-13 16:39:12 +03:00
|
|
|
And having a valid LDAP configuration
|
2018-03-15 20:39:27 +03:00
|
|
|
|
|
|
|
Scenario: Test valid configuration by logging in
|
2018-04-13 16:39:12 +03:00
|
|
|
Given Logging in using web as "alice"
|
2018-04-11 20:27:39 +03:00
|
|
|
And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
|
2018-03-15 20:39:27 +03:00
|
|
|
Then the HTTP status code should be "200"
|
2018-04-09 13:27:36 +03:00
|
|
|
|
2018-04-13 17:43:02 +03:00
|
|
|
Scenario: Test valid configuration with port in the hostname by logging in
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapHost | openldap:389 |
|
|
|
|
And cookies are reset
|
|
|
|
And Logging in using web as "alice"
|
|
|
|
And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
|
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
|
|
|
Scenario: Test valid configuration with LDAP protocol by logging in
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapHost | ldap://openldap |
|
|
|
|
And cookies are reset
|
|
|
|
And Logging in using web as "alice"
|
|
|
|
And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
|
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
2019-01-28 16:19:31 +03:00
|
|
|
Scenario: Test valid configuration with LDAP protocol and port by logging in
|
2018-04-13 17:43:02 +03:00
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapHost | ldap://openldap:389 |
|
|
|
|
And cookies are reset
|
|
|
|
And Logging in using web as "alice"
|
|
|
|
And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
|
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
2018-04-09 13:27:36 +03:00
|
|
|
Scenario: Look for a known LDAP user
|
2018-04-13 16:39:12 +03:00
|
|
|
Given As an "admin"
|
2018-04-09 13:27:36 +03:00
|
|
|
And sending "GET" to "/cloud/users?search=alice"
|
|
|
|
Then the OCS status code should be "200"
|
|
|
|
And looking up details for the first result matches expectations
|
2018-05-22 19:07:25 +03:00
|
|
|
| email | alice@nextcloud.ci |
|
|
|
|
| displayname | Alice |
|
2018-04-11 01:32:49 +03:00
|
|
|
|
|
|
|
Scenario: Test group filter with one specific group
|
2018-04-13 16:39:12 +03:00
|
|
|
Given modify LDAP configuration
|
2019-05-22 13:48:12 +03:00
|
|
|
| ldapGroupFilter | cn=RedGroup |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
|
|
|
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
|
2018-04-11 01:32:49 +03:00
|
|
|
And As an "admin"
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
Then the OCS status code should be "200"
|
2018-04-12 11:57:42 +03:00
|
|
|
And the "groups" result should match
|
2018-04-11 01:32:49 +03:00
|
|
|
| RedGroup | 1 |
|
|
|
|
| GreenGroup | 0 |
|
|
|
|
| BlueGroup | 0 |
|
|
|
|
| PurpleGroup | 0 |
|
|
|
|
|
|
|
|
Scenario: Test group filter with two specific groups
|
2018-04-13 16:39:12 +03:00
|
|
|
Given modify LDAP configuration
|
2019-05-22 13:48:12 +03:00
|
|
|
| ldapGroupFilter | (\|(cn=RedGroup)(cn=GreenGroup)) |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
|
|
|
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
|
2018-04-11 01:32:49 +03:00
|
|
|
And As an "admin"
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
Then the OCS status code should be "200"
|
2018-04-12 11:57:42 +03:00
|
|
|
And the "groups" result should match
|
2018-04-11 01:32:49 +03:00
|
|
|
| RedGroup | 1 |
|
|
|
|
| GreenGroup | 1 |
|
|
|
|
| BlueGroup | 0 |
|
|
|
|
| PurpleGroup | 0 |
|
|
|
|
|
|
|
|
Scenario: Test group filter ruling out a group from a different base
|
2018-04-13 16:39:12 +03:00
|
|
|
Given modify LDAP configuration
|
2019-05-22 13:48:12 +03:00
|
|
|
| ldapGroupFilter | (objectClass=groupOfNames) |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
|
|
|
| ldapBaseGroups | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
|
2018-04-11 01:32:49 +03:00
|
|
|
And As an "admin"
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
Then the OCS status code should be "200"
|
2018-04-12 11:57:42 +03:00
|
|
|
And the "groups" result should match
|
2018-04-11 01:32:49 +03:00
|
|
|
| RedGroup | 1 |
|
|
|
|
| GreenGroup | 1 |
|
|
|
|
| BlueGroup | 1 |
|
|
|
|
| PurpleGroup | 1 |
|
|
|
|
| SquareGroup | 0 |
|
2018-04-11 19:14:28 +03:00
|
|
|
|
2018-04-24 13:04:29 +03:00
|
|
|
Scenario: Test backup server
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapBackupHost | openldap |
|
|
|
|
| ldapBackupPort | 389 |
|
|
|
|
| ldapHost | foo.bar |
|
|
|
|
| ldapPort | 2456 |
|
|
|
|
And Logging in using web as "alice"
|
|
|
|
Then the HTTP status code should be "200"
|
2018-04-11 19:14:28 +03:00
|
|
|
|
2018-04-24 13:04:29 +03:00
|
|
|
Scenario: Test backup server offline
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapBackupHost | off.line |
|
|
|
|
| ldapBackupPort | 3892 |
|
|
|
|
| ldapHost | foo.bar |
|
|
|
|
| ldapPort | 2456 |
|
|
|
|
Then Expect ServerException on failed web login as "alice"
|
2018-04-11 19:14:28 +03:00
|
|
|
|
2018-04-24 13:04:29 +03:00
|
|
|
Scenario: Test LDAP server offline, no backup server
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapHost | foo.bar |
|
|
|
|
| ldapPort | 2456 |
|
|
|
|
Then Expect ServerException on failed web login as "alice"
|
2019-03-02 02:36:08 +03:00
|
|
|
|
|
|
|
Scenario: Test LDAP group membership with intermediate groups not matching filter
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
|
|
|
|
| ldapGroupFilter | (&(cn=Gardeners)(objectclass=groupOfNames)) |
|
|
|
|
| ldapNestedGroups | 1 |
|
|
|
|
| useMemberOfToDetectMembership | 1 |
|
|
|
|
| ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
|
2019-03-06 02:09:23 +03:00
|
|
|
| ldapExpertUsernameAttr | uid |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
2019-03-02 02:36:08 +03:00
|
|
|
And As an "admin"
|
|
|
|
# for population
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
And sending "GET" to "/cloud/groups/Gardeners/users"
|
|
|
|
Then the OCS status code should be "200"
|
|
|
|
And the "users" result should match
|
|
|
|
| alice | 0 |
|
|
|
|
| clara | 1 |
|
|
|
|
| elisa | 1 |
|
|
|
|
| gustaf | 1 |
|
|
|
|
| jesper | 1 |
|
|
|
|
|
|
|
|
Scenario: Test LDAP group membership with intermediate groups not matching filter and without memberof
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapBaseGroups | ou=OtherGroups,dc=nextcloud,dc=ci |
|
|
|
|
| ldapGroupFilter | (&(cn=Gardeners)(objectclass=groupOfNames)) |
|
|
|
|
| ldapNestedGroups | 1 |
|
|
|
|
| useMemberOfToDetectMembership | 0 |
|
|
|
|
| ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
|
2019-03-06 02:09:23 +03:00
|
|
|
| ldapExpertUsernameAttr | uid |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
2019-03-02 02:36:08 +03:00
|
|
|
And As an "admin"
|
|
|
|
# for population
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
And sending "GET" to "/cloud/groups/Gardeners/users"
|
|
|
|
Then the OCS status code should be "200"
|
|
|
|
And the "users" result should match
|
|
|
|
| alice | 0 |
|
|
|
|
| clara | 1 |
|
|
|
|
| elisa | 1 |
|
|
|
|
| gustaf | 1 |
|
|
|
|
| jesper | 1 |
|
|
|
|
|
|
|
|
Scenario: Test LDAP group membership with intermediate groups not matching filter, numeric group ids
|
|
|
|
Given modify LDAP configuration
|
|
|
|
| ldapBaseGroups | ou=NumericGroups,dc=nextcloud,dc=ci |
|
|
|
|
| ldapGroupFilter | (&(cn=2000)(objectclass=groupOfNames)) |
|
|
|
|
| ldapNestedGroups | 1 |
|
|
|
|
| useMemberOfToDetectMembership | 1 |
|
|
|
|
| ldapUserFilter | (&(objectclass=inetorgperson)(!(uid=alice))) |
|
2019-03-06 02:09:23 +03:00
|
|
|
| ldapExpertUsernameAttr | uid |
|
|
|
|
| ldapGroupMemberAssocAttr | member |
|
2019-03-02 02:36:08 +03:00
|
|
|
And As an "admin"
|
|
|
|
# for population
|
|
|
|
And sending "GET" to "/cloud/groups"
|
|
|
|
And sending "GET" to "/cloud/groups/2000/users"
|
|
|
|
Then the OCS status code should be "200"
|
|
|
|
And the "users" result should match
|
|
|
|
| alice | 0 |
|
|
|
|
| clara | 1 |
|
|
|
|
| elisa | 1 |
|
|
|
|
| gustaf | 1 |
|
|
|
|
| jesper | 1 |
|
|
|
|
|