2021-03-10 13:54:43 +03:00
|
|
|
Feature: autocomplete
|
|
|
|
Background:
|
|
|
|
Given using api version "2"
|
|
|
|
And group "commongroup" exists
|
|
|
|
And user "admin" belongs to group "commongroup"
|
2021-03-10 19:18:44 +03:00
|
|
|
And user "auto" exists
|
2021-03-10 13:54:43 +03:00
|
|
|
And user "autocomplete" exists
|
|
|
|
And user "autocomplete2" exists
|
|
|
|
And user "autocomplete2" belongs to group "commongroup"
|
|
|
|
|
|
|
|
Scenario: getting autocomplete
|
|
|
|
Given As an "admin"
|
|
|
|
When get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete | users |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete without enumeration
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
Then get autocomplete for "autocomplete"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete | users |
|
2021-03-10 19:18:44 +03:00
|
|
|
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
Then get autocomplete for "autocomplete"
|
|
|
|
| id | source |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete with limited enumeration by group
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
| autocomplete2 | users |
|
|
|
|
Then get autocomplete for "autocomplete"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete | users |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
Then get autocomplete for "autocomplete2"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete2 | users |
|
2021-03-10 19:18:44 +03:00
|
|
|
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
|
|
|
|
Then get autocomplete for "autocomplete"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
Then get autocomplete for "autocomplete2"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete2 | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete with limited enumeration by phone
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
# autocomplete stores their phone number
|
|
|
|
Given As an "autocomplete"
|
|
|
|
And sending "PUT" to "/cloud/users/autocomplete" with
|
|
|
|
| key | phone |
|
|
|
|
| value | +49 711 / 25 24 28-90 |
|
|
|
|
And the HTTP status code should be "200"
|
|
|
|
And the OCS status code should be "200"
|
|
|
|
|
|
|
|
Given As an "admin"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
# admin populates they have the phone number
|
|
|
|
When search users by phone for region "DE" with
|
|
|
|
| random-string1 | 0711 / 252 428-90 |
|
2021-03-10 19:18:44 +03:00
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| auto | users |
|
|
|
|
| autocomplete | users |
|
|
|
|
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
|
2021-03-10 13:54:43 +03:00
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete | users |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete with limited enumeration by group or phone
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
|
|
|
|
And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
|
|
|
|
|
|
|
|
# autocomplete stores their phone number
|
|
|
|
Given As an "autocomplete"
|
|
|
|
And sending "PUT" to "/cloud/users/autocomplete" with
|
|
|
|
| key | phone |
|
|
|
|
| value | +49 711 / 25 24 28-90 |
|
|
|
|
And the HTTP status code should be "200"
|
|
|
|
And the OCS status code should be "200"
|
|
|
|
# admin populates they have the phone number
|
|
|
|
Given As an "admin"
|
|
|
|
When search users by phone for region "DE" with
|
|
|
|
| random-string1 | 0711 / 252 428-90 |
|
|
|
|
|
2021-03-10 19:18:44 +03:00
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| auto | users |
|
|
|
|
| autocomplete | users |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
|
2021-03-10 13:54:43 +03:00
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete | users |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete with limited enumeration but sharing is group restricted
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
|
|
|
|
And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
|
|
|
|
|
|
|
|
# autocomplete stores their phone number
|
|
|
|
Given As an "autocomplete"
|
|
|
|
And sending "PUT" to "/cloud/users/autocomplete" with
|
|
|
|
| key | phone |
|
|
|
|
| value | +49 711 / 25 24 28-90 |
|
|
|
|
And the HTTP status code should be "200"
|
|
|
|
And the OCS status code should be "200"
|
|
|
|
# admin populates they have the phone number
|
|
|
|
Given As an "admin"
|
|
|
|
When search users by phone for region "DE" with
|
|
|
|
| random-string1 | 0711 / 252 428-90 |
|
|
|
|
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
| autocomplete | users |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
When parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete2 | users |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete with limited enumeration by phone but user changes it
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
# autocomplete stores their phone number
|
|
|
|
Given As an "autocomplete"
|
|
|
|
And sending "PUT" to "/cloud/users/autocomplete" with
|
|
|
|
| key | phone |
|
|
|
|
| value | +49 711 / 25 24 28-90 |
|
|
|
|
And the HTTP status code should be "200"
|
|
|
|
And the OCS status code should be "200"
|
|
|
|
|
|
|
|
Given As an "admin"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
# admin populates they have the phone number
|
|
|
|
When search users by phone for region "DE" with
|
|
|
|
| random-string1 | 0711 / 252 428-90 |
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
| autocomplete | users |
|
|
|
|
|
|
|
|
# autocomplete changes their phone number
|
|
|
|
Given As an "autocomplete"
|
|
|
|
And sending "PUT" to "/cloud/users/autocomplete" with
|
|
|
|
| key | phone |
|
|
|
|
| value | +49 711 / 25 24 28-91 |
|
|
|
|
And the HTTP status code should be "200"
|
|
|
|
And the OCS status code should be "200"
|
|
|
|
|
|
|
|
Given As an "admin"
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
|
|
|
|
# admin populates they have the new phone number
|
|
|
|
When search users by phone for region "DE" with
|
|
|
|
| random-string1 | 0711 / 252 428-91 |
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
2021-03-10 19:18:44 +03:00
|
|
|
| auto | users |
|
2021-03-10 13:54:43 +03:00
|
|
|
| autocomplete | users |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: getting autocomplete without enumeration and sharing is group restricted
|
|
|
|
Given As an "admin"
|
|
|
|
When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
|
|
|
|
And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
|
|
|
|
|
|
|
|
Then get autocomplete for "auto"
|
|
|
|
| id | source |
|
|
|
|
Then get autocomplete for "autocomplete"
|
|
|
|
| id | source |
|
|
|
|
Then get autocomplete for "autocomplete2"
|
|
|
|
| id | source |
|
|
|
|
| autocomplete2 | users |
|