From 347ee1d205c95f5fd766e206cc65bfb9782a2623 Mon Sep 17 00:00:00 2001 From: Gabe Van Engel Date: Tue, 28 Aug 2018 08:06:57 -0700 Subject: 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. --- i18n/en.json | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index a0a5e1dda..f7d687ec9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -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" -- cgit v1.2.3-1-g7c22