{"action":"created","issue":{"url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9142","repository_url":"https://api.github.com/repos/mattermost/mattermost-server","labels_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9142/labels{/name}","comments_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9142/comments","events_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9142/events","html_url":"https://github.com/mattermost/mattermost-server/pull/9142","id":343387114,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDQ1NjI2","number":9142,"title":"[WIP] MM-11327: Restrict Teams by Email","user":{"login":"gvengel","id":3052395,"node_id":"MDQ6VXNlcjMwNTIzOTU=","avatar_url":"https://avatars1.githubusercontent.com/u/3052395?v=4","gravatar_id":"","url":"https://api.github.com/users/gvengel","html_url":"https://github.com/gvengel","followers_url":"https://api.github.com/users/gvengel/followers","following_url":"https://api.github.com/users/gvengel/following{/other_user}","gists_url":"https://api.github.com/users/gvengel/gists{/gist_id}","starred_url":"https://api.github.com/users/gvengel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvengel/subscriptions","organizations_url":"https://api.github.com/users/gvengel/orgs","repos_url":"https://api.github.com/users/gvengel/repos","events_url":"https://api.github.com/users/gvengel/events{/privacy}","received_events_url":"https://api.github.com/users/gvengel/received_events","type":"User","site_admin":false},"labels":[{"id":297541710,"node_id":"MDU6TGFiZWwyOTc1NDE3MTA=","url":"https://api.github.com/repos/mattermost/mattermost-server/labels/1:%20PM%20Review","name":"1: PM Review","color":"006b75","default":false},{"id":308747687,"node_id":"MDU6TGFiZWwzMDg3NDc2ODc=","url":"https://api.github.com/repos/mattermost/mattermost-server/labels/Setup%20Test%20Server","name":"Setup Test Server","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-22T08:11:32Z","updated_at":"2018-07-22T22:00:29Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9142","html_url":"https://github.com/mattermost/mattermost-server/pull/9142","diff_url":"https://github.com/mattermost/mattermost-server/pull/9142.diff","patch_url":"https://github.com/mattermost/mattermost-server/pull/9142.patch"},"body":"#### Summary\r\nThis allows individual teams to be restricted to an email domain whitelist. The per team setting overrides the server-wide whitelist, but teams which do not set the option will still fallback to the server-wide setting.\r\n\r\nThe change leverages the preexisting team.allowedDomains model property. For now, it must be modified via REST API, as UI has not been implemented.\r\n\r\nI started modifying the SanitizeTeam code to permit updates to allowedDomains, but wasn't sure if that should be included in this PR or later when UI is added. I left it out for now, but can update the PR, if appropriate?\r\n\r\nTests have been added for the AddUserToTeam* methods to make sure bad email domains get blocked when the whitelist is enabled. I'm unsure if there are other code paths which may need testing. Open vs invite only teams, or enterprise LDAP accounts, for example.\r\n\r\n#### Ticket Link\r\n- Help Wanted: #9111\r\n- Uservoice: [restrict-team-by-email](https://mattermost.uservoice.com/forums/306457-general/suggestions/33014368-restrict-team-by-email)\r\n\r\n#### Checklist\r\n- [x] Added or updated unit tests (required for all new features)\r\n- [x] Touches critical sections of the codebase (auth, upgrade, etc.)\r\n"},"comment":{"url":"https://api.github.com/repos/mattermost/mattermost-server/issues/comments/406900190","html_url":"https://github.com/mattermost/mattermost-server/pull/9142#issuecomment-406900190","issue_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9142","id":406900190,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjkwMDE5MA==","user":{"login":"mattermod","id":16344077,"node_id":"MDQ6VXNlcjE2MzQ0MDc3","avatar_url":"https://avatars1.githubusercontent.com/u/16344077?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermod","html_url":"https://github.com/mattermod","followers_url":"https://api.github.com/users/mattermod/followers","following_url":"https://api.github.com/users/mattermod/following{/other_user}","gists_url":"https://api.github.com/users/mattermod/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermod/subscriptions","organizations_url":"https://api.github.com/users/mattermod/orgs","repos_url":"https://api.github.com/users/mattermod/repos","events_url":"https://api.github.com/users/mattermod/events{/privacy}","received_events_url":"https://api.github.com/users/mattermod/received_events","type":"User","site_admin":false},"created_at":"2018-07-22T22:00:29Z","updated_at":"2018-07-22T22:00:29Z","author_association":"NONE","body":"Spinmint test server created at: http://i-06767d016a0b22aab.test.spinmint.com\n\nTest Admin Account: Username: `sysadmin` | Password: `sysadmin`\n\nTest User Account: Username: `user-1` | Password: `user-1`\n\nInstance ID: i-06767d016a0b22aab"}}
{"actor":{"display_login":"mattermod"}}