{"action":"created","comment":{"url":"https://api.github.com/repos/systemli/user-management/pulls/comments/227490662","pull_request_review_id":167530687,"id":227490662,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ5MDY2Mg==","diff_hunk":"@@ -39,26 +40,44 @@ public function __construct(ObjectManager $manager, AliasCreator $creator)\n \n     /**\n      * @param array $aliases\n+     * @param int   $limit\n      *\n      * @return bool\n      */\n-    public function checkAliasLimit(array $aliases): bool\n+    public function checkAliasLimit(array $aliases, int $limit = self::ALIAS_LIMIT_CUSTOM): bool\n     {\n-        return (count($aliases) < self::ALIAS_LIMIT) ? true : false;\n+        return (count($aliases) < $limit) ? true : false;\n     }\n \n     /**\n-     * @param User        $user\n-     * @param null|string $localPart\n+     * @param User $user\n      *\n      * @return Alias|null\n      *\n      * @throws ValidationException\n      */\n-    public function create(User $user, ?string $localPart): ?Alias\n+    public function createRandom(User $user): ?Alias","path":"src/Handler/AliasHandler.php","position":35,"original_position":35,"commit_id":"476f7d6757fbf3e0f45fab93770f3fd1a764fc03","original_commit_id":"476f7d6757fbf3e0f45fab93770f3fd1a764fc03","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":"Why not keep a single method `create()` and use the condition `if (null === $localPart)` to distinguish between randomAlias and customAlias?\r\n\r\n```\r\n$limit = (null === $localPart) ? self::ALIAS_LIMIT_RANDOM : self::ALIAS_LIMIT_CUSTOM;\r\n```\r\n\r\nThe `repository->find*ByUser()` condition needs to be unified anyway (see next two comments).","created_at":"2018-10-23T17:28:45Z","updated_at":"2018-10-23T17:29:06Z","html_url":"https://github.com/systemli/user-management/pull/41#discussion_r227490662","pull_request_url":"https://api.github.com/repos/systemli/user-management/pulls/41","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/systemli/user-management/pulls/comments/227490662"},"html":{"href":"https://github.com/systemli/user-management/pull/41#discussion_r227490662"},"pull_request":{"href":"https://api.github.com/repos/systemli/user-management/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/systemli/user-management/pulls/41","id":225033603,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDMzNjAz","html_url":"https://github.com/systemli/user-management/pull/41","diff_url":"https://github.com/systemli/user-management/pull/41.diff","patch_url":"https://github.com/systemli/user-management/pull/41.patch","issue_url":"https://api.github.com/repos/systemli/user-management/issues/41","number":41,"state":"open","locked":false,"title":"Add form for custom aliases","user":{"login":"t2d","id":1834580,"node_id":"MDQ6VXNlcjE4MzQ1ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/1834580?v=4","gravatar_id":"","url":"https://api.github.com/users/t2d","html_url":"https://github.com/t2d","followers_url":"https://api.github.com/users/t2d/followers","following_url":"https://api.github.com/users/t2d/following{/other_user}","gists_url":"https://api.github.com/users/t2d/gists{/gist_id}","starred_url":"https://api.github.com/users/t2d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t2d/subscriptions","organizations_url":"https://api.github.com/users/t2d/orgs","repos_url":"https://api.github.com/users/t2d/repos","events_url":"https://api.github.com/users/t2d/events{/privacy}","received_events_url":"https://api.github.com/users/t2d/received_events","type":"User","site_admin":false},"body":"Right now, I expose the validator error message. On the good side, it shows why an alias couldn't be created. On the bad side:\r\n\r\n1) Allows to see if an email address already exists\r\n2) Error is always shown in English\r\n\r\nNumber 1) is a bigger problem than in registration because users have the possibility to create and delete an infinite amount of aliases. Which makes enumeration easy. Do you have an idea how to handle this?","created_at":"2018-10-23T13:14:23Z","updated_at":"2018-10-23T17:29:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e653d0d2a1ee39d0a364532300408699f8d0561","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/systemli/user-management/milestones/4","html_url":"https://github.com/systemli/user-management/milestone/4","labels_url":"https://api.github.com/repos/systemli/user-management/milestones/4/labels","id":3733183,"node_id":"MDk6TWlsZXN0b25lMzczMzE4Mw==","number":4,"title":"1.4.0","description":null,"creator":{"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},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2018-10-12T11:22:42Z","updated_at":"2018-10-23T13:14:40Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/systemli/user-management/pulls/41/commits","review_comments_url":"https://api.github.com/repos/systemli/user-management/pulls/41/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/41/comments","statuses_url":"https://api.github.com/repos/systemli/user-management/statuses/476f7d6757fbf3e0f45fab93770f3fd1a764fc03","head":{"label":"systemli:alias","ref":"alias","sha":"476f7d6757fbf3e0f45fab93770f3fd1a764fc03","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-23T16:47:36Z","pushed_at":"2018-10-23T16:51:17Z","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":492,"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":9,"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":9,"watchers":3,"default_branch":"master"}},"base":{"label":"systemli:master","ref":"master","sha":"f2d063a35db876b18728ec7fc0e46bff234fbe88","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-23T16:47:36Z","pushed_at":"2018-10-23T16:51:17Z","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":492,"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":9,"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":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemli/user-management/pulls/41"},"html":{"href":"https://github.com/systemli/user-management/pull/41"},"issue":{"href":"https://api.github.com/repos/systemli/user-management/issues/41"},"comments":{"href":"https://api.github.com/repos/systemli/user-management/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/systemli/user-management/pulls/41/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/41/commits"},"statuses":{"href":"https://api.github.com/repos/systemli/user-management/statuses/476f7d6757fbf3e0f45fab93770f3fd1a764fc03"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"doobry-systemli"}}