{"action":"created","issue":{"url":"https://api.github.com/repos/shopware/shopware/issues/1743","repository_url":"https://api.github.com/repos/shopware/shopware","labels_url":"https://api.github.com/repos/shopware/shopware/issues/1743/labels{/name}","comments_url":"https://api.github.com/repos/shopware/shopware/issues/1743/comments","events_url":"https://api.github.com/repos/shopware/shopware/issues/1743/events","html_url":"https://github.com/shopware/shopware/pull/1743","id":348785769,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MDU0NDMy","number":1743,"title":"Add regex validation to registration","user":{"login":"t2oh4e","id":3286907,"node_id":"MDQ6VXNlcjMyODY5MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/3286907?v=4","gravatar_id":"","url":"https://api.github.com/users/t2oh4e","html_url":"https://github.com/t2oh4e","followers_url":"https://api.github.com/users/t2oh4e/followers","following_url":"https://api.github.com/users/t2oh4e/following{/other_user}","gists_url":"https://api.github.com/users/t2oh4e/gists{/gist_id}","starred_url":"https://api.github.com/users/t2oh4e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t2oh4e/subscriptions","organizations_url":"https://api.github.com/users/t2oh4e/orgs","repos_url":"https://api.github.com/users/t2oh4e/repos","events_url":"https://api.github.com/users/t2oh4e/events{/privacy}","received_events_url":"https://api.github.com/users/t2oh4e/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-08T15:49:18Z","updated_at":"2018-08-09T10:09:37Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/shopware/shopware/pulls/1743","html_url":"https://github.com/shopware/shopware/pull/1743","diff_url":"https://github.com/shopware/shopware/pull/1743.diff","patch_url":"https://github.com/shopware/shopware/pull/1743.patch"},"body":"### 1. Why is this change necessary?\r\nTo force customers to use certain characters in their password.\r\n\r\n### 2. What does this change do, exactly?\r\nIt adds a new config option to define a regular expression. If it is set passwords will be validated against the regular expression\r\n\r\n### 3. Describe each step to reproduce the issue or behaviour.\r\nSet the new config option in the basic settings at \"Registration / login\" to\r\n`/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).+/`.\r\nNow you will have to provide a password with at least one uppercase letter, one lowercase letter, a number and a special character.\r\nOtherwise you will not be able to register and get an error message.\r\n\r\n### 4. Please link to the relevant issues (if any).\r\n-\r\n\r\n### 5. Which documentation changes (if any) need to be made because of this PR?\r\n-\r\n\r\n### 6. Checklist\r\n\r\n- [ ] I have written tests and verified that they fail without my change\r\n- [x] I have squashed any insignificant commits\r\n- [x] This change has comments for package types, values, functions, and non-obvious lines of code\r\n- [x] I have read the contribution requirements and fulfil them."},"comment":{"url":"https://api.github.com/repos/shopware/shopware/issues/comments/411707774","html_url":"https://github.com/shopware/shopware/pull/1743#issuecomment-411707774","issue_url":"https://api.github.com/repos/shopware/shopware/issues/1743","id":411707774,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTcwNzc3NA==","user":{"login":"soebbing","id":174161,"node_id":"MDQ6VXNlcjE3NDE2MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/174161?v=4","gravatar_id":"","url":"https://api.github.com/users/soebbing","html_url":"https://github.com/soebbing","followers_url":"https://api.github.com/users/soebbing/followers","following_url":"https://api.github.com/users/soebbing/following{/other_user}","gists_url":"https://api.github.com/users/soebbing/gists{/gist_id}","starred_url":"https://api.github.com/users/soebbing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soebbing/subscriptions","organizations_url":"https://api.github.com/users/soebbing/orgs","repos_url":"https://api.github.com/users/soebbing/repos","events_url":"https://api.github.com/users/soebbing/events{/privacy}","received_events_url":"https://api.github.com/users/soebbing/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T10:09:37Z","updated_at":"2018-08-09T10:09:37Z","author_association":"CONTRIBUTOR","body":"I see some issues with this change :/\r\n\r\nFor one: The initial regex (an empty one) has nothing to do with the error message you provide. That could lead to a wrong error message and incorrect password requirements being shown.\r\n\r\nAlso: I am not yet sure if it is a good idea to provide shop owners with such a basic tool like a regex. It is far too easy even for tech savy shop owners to shoot themselves in the foot. I think at best we would have to provide a list of validations from which a shop owner can choose from, like \"no validation\", \"small and capital letters\", \"small and capital letters and a number\", \"small and capital letters, a number and special char\", etc. which also automatically shows the correct error in the frontend.\r\n\r\nBottom line: I can see the need for agencies and developers for an easy way to implement a project's custom password requirements in a straight-forward way, but I would very much prefer something like e.g. a custom `RegexConstraint` which only needs to be implemented by a plugin. But I am pretty sure the Symfony Form Components have all that is necessary for such a feature. Maybe a little DevDocs-article on how to best change password requirements would already be enough?"}}
{"actor":{"display_login":"soebbing"}}