MM-11327: Restrict Teams by Email (#9142)

* Check a team's AllowedDomains setting before adding users to the team.

* Updated AddUser tests to validate AllowedDomains restriction.

* Updated variable name to match convention.

* Removed AllowedDomains from team sanitization.

* Update AppError's Where to match the calling function.

* Added tests for user matching allowedDomains, and multi domain values of allowedDomains.

* Added test to make sure we block users who have a subdomain of a whitelisted domain.

* Revert "Removed AllowedDomains from team sanitization."

This reverts commit 17c2afea584da40c7d769787ae86408e9700510c.

* Update sanitization tests to include dockerhost, now that we enforce AllowedDomains.

* Added tests to verify the interplay between the global and per team domain restrictions.

* Validate AllowedDomains property against RestrictCreationToDomains before updating a team.

* Remove team.AllowedDomains from sanitization.

* Add i18n string for the team allowed domains restriction app error.
Этот коммит содержится в:
Gabe Van Engel
2018-08-28 08:06:57 -07:00
коммит произвёл Harrison Healey
родитель 19e69681d7
Коммит 347ee1d205
5 изменённых файлов: 273 добавлений и 113 удалений

Просмотреть файл

@@ -1654,6 +1654,10 @@
"id": "api.team.join_team.post_and_forget",
"translation": "%v joined the team."
},
{
"id": "api.team.join_user_to_team.allowed_domains.app_error",
"translation": "Email must be from a specific domain (e.g. @example.com). Please ask your team or system administrator for details."
},
{
"id": "api.team.leave.left",
"translation": "%v left the team."
@@ -1730,6 +1734,10 @@
"id": "api.team.update_member_roles.not_a_member",
"translation": "Specified user is not a member of specified team."
},
{
"id": "api.team.update_restricted_domains.mismatch.app_error",
"translation": "Restricting team to {{ .Domain }} is not allowed by the system config. Please contact your system administrator."
},
{
"id": "api.team.update_team_scheme.license.error",
"translation": "Your license does not support updating a team's scheme"