{"action":"created","comment":{"url":"https://api.github.com/repos/systemli/user-management/pulls/comments/223783134","pull_request_review_id":162994860,"id":223783134,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzc4MzEzNA==","diff_hunk":"@@ -0,0 +1,48 @@\n+<?php\n+\n+namespace App\\Creator;\n+\n+use App\\Entity\\User;\n+use App\\Entity\\Alias;\n+use App\\Exception\\ValidationException;\n+use App\\Factory\\AliasFactory;\n+use App\\Helper\\RandomStringGenerator;\n+\n+/**\n+ * Class AliasCreator.\n+ */\n+class AliasCreator extends AbstractCreator\n+{\n+    /**\n+     * @param User $user\n+     * @param null|string $localPart\n+     * @return Alias\n+     * @throws \\App\\Exception\\ValidationException\n+     */\n+    public function create(User $user, ?string $localPart): Alias\n+    {\n+        $alias = AliasFactory::create($user, $localPart);\n+\n+        if (null === $localPart) {\n+            $alias = $this->validateAndUpdate($alias);\n+        }\n+\n+        $this->validate($alias, ['Default', 'unique']);\n+        $this->save($alias);\n+\n+        return $alias;\n+    }\n+\n+    private function validateAndUpdate(Alias $alias)\n+    {\n+        try {\n+            $this->validate($alias, ['unique']);\n+        } catch (ValidationException $e) {\n+            $localPart = RandomStringGenerator::generate(24, false);\n+            $domain = $alias->getDomain();\n+            $alias->setSource($localPart.\"@\".$domain->getName());\n+            $this->validateAndUpdate($alias);\n+        }\n+        return $alias;","path":"src/Creator/AliasCreator.php","position":46,"original_position":46,"commit_id":"5507056e338a4a794a977f1c2ea250a809d48961","original_commit_id":"5507056e338a4a794a977f1c2ea250a809d48961","user":{"login":"0x46616c6b","id":363667,"node_id":"MDQ6VXNlcjM2MzY2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/363667?v=4","gravatar_id":"","url":"https://api.github.com/users/0x46616c6b","html_url":"https://github.com/0x46616c6b","followers_url":"https://api.github.com/users/0x46616c6b/followers","following_url":"https://api.github.com/users/0x46616c6b/following{/other_user}","gists_url":"https://api.github.com/users/0x46616c6b/gists{/gist_id}","starred_url":"https://api.github.com/users/0x46616c6b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x46616c6b/subscriptions","organizations_url":"https://api.github.com/users/0x46616c6b/orgs","repos_url":"https://api.github.com/users/0x46616c6b/repos","events_url":"https://api.github.com/users/0x46616c6b/events{/privacy}","received_events_url":"https://api.github.com/users/0x46616c6b/received_events","type":"User","site_admin":false},"body":"Missing new line in front of return","created_at":"2018-10-09T16:57:36Z","updated_at":"2018-10-09T16:57:36Z","html_url":"https://github.com/systemli/user-management/pull/22#discussion_r223783134","pull_request_url":"https://api.github.com/repos/systemli/user-management/pulls/22","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/systemli/user-management/pulls/comments/223783134"},"html":{"href":"https://github.com/systemli/user-management/pull/22#discussion_r223783134"},"pull_request":{"href":"https://api.github.com/repos/systemli/user-management/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/systemli/user-management/pulls/22","id":220773744,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzczNzQ0","html_url":"https://github.com/systemli/user-management/pull/22","diff_url":"https://github.com/systemli/user-management/pull/22.diff","patch_url":"https://github.com/systemli/user-management/pull/22.patch","issue_url":"https://api.github.com/repos/systemli/user-management/issues/22","number":22,"state":"open","locked":false,"title":"Add support for alias management to frontend","user":{"login":"doobry-systemli","id":25278864,"node_id":"MDQ6VXNlcjI1Mjc4ODY0","avatar_url":"https://avatars2.githubusercontent.com/u/25278864?v=4","gravatar_id":"","url":"https://api.github.com/users/doobry-systemli","html_url":"https://github.com/doobry-systemli","followers_url":"https://api.github.com/users/doobry-systemli/followers","following_url":"https://api.github.com/users/doobry-systemli/following{/other_user}","gists_url":"https://api.github.com/users/doobry-systemli/gists{/gist_id}","starred_url":"https://api.github.com/users/doobry-systemli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doobry-systemli/subscriptions","organizations_url":"https://api.github.com/users/doobry-systemli/orgs","repos_url":"https://api.github.com/users/doobry-systemli/repos","events_url":"https://api.github.com/users/doobry-systemli/events{/privacy}","received_events_url":"https://api.github.com/users/doobry-systemli/received_events","type":"User","site_admin":false},"body":"Features:\r\n* Use soft-delete for aliases in order to prevent impersonation\r\n* List own aliases in user frontend\r\n* Add new form to allow deletion of own aliases\r\n* Allow to create new random aliases in user frontend\r\n\r\nInternal changes:\r\n* Add new attributes `deleted` and `user_id` to entity `Alias`\r\n* Make entity Alias implement SoftDeletableInterface\r\n* Create indexes for relations {user_id,source,destination}<->deleted on\r\n  entity `Alias`\r\n* New classes `AliasFactory` and `AliasCreator`\r\n* Use `AliasFactory` to create aliases in fixtures\r\n* Add validation constraints for entity `Alias`","created_at":"2018-10-05T17:36:22Z","updated_at":"2018-10-09T16:57:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60b98bcdb8d5022dc59a0fafc8615a656f2600ba","assignee":{"login":"0x46616c6b","id":363667,"node_id":"MDQ6VXNlcjM2MzY2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/363667?v=4","gravatar_id":"","url":"https://api.github.com/users/0x46616c6b","html_url":"https://github.com/0x46616c6b","followers_url":"https://api.github.com/users/0x46616c6b/followers","following_url":"https://api.github.com/users/0x46616c6b/following{/other_user}","gists_url":"https://api.github.com/users/0x46616c6b/gists{/gist_id}","starred_url":"https://api.github.com/users/0x46616c6b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x46616c6b/subscriptions","organizations_url":"https://api.github.com/users/0x46616c6b/orgs","repos_url":"https://api.github.com/users/0x46616c6b/repos","events_url":"https://api.github.com/users/0x46616c6b/events{/privacy}","received_events_url":"https://api.github.com/users/0x46616c6b/received_events","type":"User","site_admin":false},"assignees":[{"login":"0x46616c6b","id":363667,"node_id":"MDQ6VXNlcjM2MzY2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/363667?v=4","gravatar_id":"","url":"https://api.github.com/users/0x46616c6b","html_url":"https://github.com/0x46616c6b","followers_url":"https://api.github.com/users/0x46616c6b/followers","following_url":"https://api.github.com/users/0x46616c6b/following{/other_user}","gists_url":"https://api.github.com/users/0x46616c6b/gists{/gist_id}","starred_url":"https://api.github.com/users/0x46616c6b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x46616c6b/subscriptions","organizations_url":"https://api.github.com/users/0x46616c6b/orgs","repos_url":"https://api.github.com/users/0x46616c6b/repos","events_url":"https://api.github.com/users/0x46616c6b/events{/privacy}","received_events_url":"https://api.github.com/users/0x46616c6b/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/systemli/user-management/pulls/22/commits","review_comments_url":"https://api.github.com/repos/systemli/user-management/pulls/22/comments","review_comment_url":"https://api.github.com/repos/systemli/user-management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systemli/user-management/issues/22/comments","statuses_url":"https://api.github.com/repos/systemli/user-management/statuses/5507056e338a4a794a977f1c2ea250a809d48961","head":{"label":"systemli:aliases","ref":"aliases","sha":"5507056e338a4a794a977f1c2ea250a809d48961","user":{"login":"systemli","id":9871925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4NzE5MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/9871925?v=4","gravatar_id":"","url":"https://api.github.com/users/systemli","html_url":"https://github.com/systemli","followers_url":"https://api.github.com/users/systemli/followers","following_url":"https://api.github.com/users/systemli/following{/other_user}","gists_url":"https://api.github.com/users/systemli/gists{/gist_id}","starred_url":"https://api.github.com/users/systemli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemli/subscriptions","organizations_url":"https://api.github.com/users/systemli/orgs","repos_url":"https://api.github.com/users/systemli/repos","events_url":"https://api.github.com/users/systemli/events{/privacy}","received_events_url":"https://api.github.com/users/systemli/received_events","type":"Organization","site_admin":false},"repo":{"id":149298122,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkyOTgxMjI=","name":"user-management","full_name":"systemli/user-management","private":false,"owner":{"login":"systemli","id":9871925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4NzE5MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/9871925?v=4","gravatar_id":"","url":"https://api.github.com/users/systemli","html_url":"https://github.com/systemli","followers_url":"https://api.github.com/users/systemli/followers","following_url":"https://api.github.com/users/systemli/following{/other_user}","gists_url":"https://api.github.com/users/systemli/gists{/gist_id}","starred_url":"https://api.github.com/users/systemli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemli/subscriptions","organizations_url":"https://api.github.com/users/systemli/orgs","repos_url":"https://api.github.com/users/systemli/repos","events_url":"https://api.github.com/users/systemli/events{/privacy}","received_events_url":"https://api.github.com/users/systemli/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/systemli/user-management","description":"Symfony-based webapp to manage mail users and their interactions","fork":false,"url":"https://api.github.com/repos/systemli/user-management","forks_url":"https://api.github.com/repos/systemli/user-management/forks","keys_url":"https://api.github.com/repos/systemli/user-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systemli/user-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systemli/user-management/teams","hooks_url":"https://api.github.com/repos/systemli/user-management/hooks","issue_events_url":"https://api.github.com/repos/systemli/user-management/issues/events{/number}","events_url":"https://api.github.com/repos/systemli/user-management/events","assignees_url":"https://api.github.com/repos/systemli/user-management/assignees{/user}","branches_url":"https://api.github.com/repos/systemli/user-management/branches{/branch}","tags_url":"https://api.github.com/repos/systemli/user-management/tags","blobs_url":"https://api.github.com/repos/systemli/user-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systemli/user-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systemli/user-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/systemli/user-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systemli/user-management/statuses/{sha}","languages_url":"https://api.github.com/repos/systemli/user-management/languages","stargazers_url":"https://api.github.com/repos/systemli/user-management/stargazers","contributors_url":"https://api.github.com/repos/systemli/user-management/contributors","subscribers_url":"https://api.github.com/repos/systemli/user-management/subscribers","subscription_url":"https://api.github.com/repos/systemli/user-management/subscription","commits_url":"https://api.github.com/repos/systemli/user-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/systemli/user-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/systemli/user-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/systemli/user-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/systemli/user-management/contents/{+path}","compare_url":"https://api.github.com/repos/systemli/user-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systemli/user-management/merges","archive_url":"https://api.github.com/repos/systemli/user-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systemli/user-management/downloads","issues_url":"https://api.github.com/repos/systemli/user-management/issues{/number}","pulls_url":"https://api.github.com/repos/systemli/user-management/pulls{/number}","milestones_url":"https://api.github.com/repos/systemli/user-management/milestones{/number}","notifications_url":"https://api.github.com/repos/systemli/user-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systemli/user-management/labels{/name}","releases_url":"https://api.github.com/repos/systemli/user-management/releases{/id}","deployments_url":"https://api.github.com/repos/systemli/user-management/deployments","created_at":"2018-09-18T14:03:04Z","updated_at":"2018-10-09T14:41:36Z","pushed_at":"2018-10-09T16:39:52Z","git_url":"git://github.com/systemli/user-management.git","ssh_url":"git@github.com:systemli/user-management.git","clone_url":"https://github.com/systemli/user-management.git","svn_url":"https://github.com/systemli/user-management","homepage":null,"size":432,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"systemli:master","ref":"master","sha":"fdbe75cddea2bcc894ddd59fdb406356423051f2","user":{"login":"systemli","id":9871925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4NzE5MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/9871925?v=4","gravatar_id":"","url":"https://api.github.com/users/systemli","html_url":"https://github.com/systemli","followers_url":"https://api.github.com/users/systemli/followers","following_url":"https://api.github.com/users/systemli/following{/other_user}","gists_url":"https://api.github.com/users/systemli/gists{/gist_id}","starred_url":"https://api.github.com/users/systemli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemli/subscriptions","organizations_url":"https://api.github.com/users/systemli/orgs","repos_url":"https://api.github.com/users/systemli/repos","events_url":"https://api.github.com/users/systemli/events{/privacy}","received_events_url":"https://api.github.com/users/systemli/received_events","type":"Organization","site_admin":false},"repo":{"id":149298122,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkyOTgxMjI=","name":"user-management","full_name":"systemli/user-management","private":false,"owner":{"login":"systemli","id":9871925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4NzE5MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/9871925?v=4","gravatar_id":"","url":"https://api.github.com/users/systemli","html_url":"https://github.com/systemli","followers_url":"https://api.github.com/users/systemli/followers","following_url":"https://api.github.com/users/systemli/following{/other_user}","gists_url":"https://api.github.com/users/systemli/gists{/gist_id}","starred_url":"https://api.github.com/users/systemli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemli/subscriptions","organizations_url":"https://api.github.com/users/systemli/orgs","repos_url":"https://api.github.com/users/systemli/repos","events_url":"https://api.github.com/users/systemli/events{/privacy}","received_events_url":"https://api.github.com/users/systemli/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/systemli/user-management","description":"Symfony-based webapp to manage mail users and their interactions","fork":false,"url":"https://api.github.com/repos/systemli/user-management","forks_url":"https://api.github.com/repos/systemli/user-management/forks","keys_url":"https://api.github.com/repos/systemli/user-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systemli/user-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systemli/user-management/teams","hooks_url":"https://api.github.com/repos/systemli/user-management/hooks","issue_events_url":"https://api.github.com/repos/systemli/user-management/issues/events{/number}","events_url":"https://api.github.com/repos/systemli/user-management/events","assignees_url":"https://api.github.com/repos/systemli/user-management/assignees{/user}","branches_url":"https://api.github.com/repos/systemli/user-management/branches{/branch}","tags_url":"https://api.github.com/repos/systemli/user-management/tags","blobs_url":"https://api.github.com/repos/systemli/user-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systemli/user-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systemli/user-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/systemli/user-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systemli/user-management/statuses/{sha}","languages_url":"https://api.github.com/repos/systemli/user-management/languages","stargazers_url":"https://api.github.com/repos/systemli/user-management/stargazers","contributors_url":"https://api.github.com/repos/systemli/user-management/contributors","subscribers_url":"https://api.github.com/repos/systemli/user-management/subscribers","subscription_url":"https://api.github.com/repos/systemli/user-management/subscription","commits_url":"https://api.github.com/repos/systemli/user-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/systemli/user-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/systemli/user-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/systemli/user-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/systemli/user-management/contents/{+path}","compare_url":"https://api.github.com/repos/systemli/user-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systemli/user-management/merges","archive_url":"https://api.github.com/repos/systemli/user-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systemli/user-management/downloads","issues_url":"https://api.github.com/repos/systemli/user-management/issues{/number}","pulls_url":"https://api.github.com/repos/systemli/user-management/pulls{/number}","milestones_url":"https://api.github.com/repos/systemli/user-management/milestones{/number}","notifications_url":"https://api.github.com/repos/systemli/user-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systemli/user-management/labels{/name}","releases_url":"https://api.github.com/repos/systemli/user-management/releases{/id}","deployments_url":"https://api.github.com/repos/systemli/user-management/deployments","created_at":"2018-09-18T14:03:04Z","updated_at":"2018-10-09T14:41:36Z","pushed_at":"2018-10-09T16:39:52Z","git_url":"git://github.com/systemli/user-management.git","ssh_url":"git@github.com:systemli/user-management.git","clone_url":"https://github.com/systemli/user-management.git","svn_url":"https://github.com/systemli/user-management","homepage":null,"size":432,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemli/user-management/pulls/22"},"html":{"href":"https://github.com/systemli/user-management/pull/22"},"issue":{"href":"https://api.github.com/repos/systemli/user-management/issues/22"},"comments":{"href":"https://api.github.com/repos/systemli/user-management/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/systemli/user-management/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/systemli/user-management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systemli/user-management/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/systemli/user-management/statuses/5507056e338a4a794a977f1c2ea250a809d48961"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"0x46616c6b"}}