{"action":"created","comment":{"url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/comments/69137905","id":69137905,"diff_hunk":"@@ -0,0 +1,152 @@\n+<?php\n+namespace common\\models;\n+\n+use common\\helpers\\Utils;\n+use common\\helpers\\ZxcvbnPasswordValidator;\n+use yii\\base\\Model;\n+use yii\\helpers\\Json;\n+use yii\\web\\BadRequestHttpException;\n+use yii\\web\\ServerErrorHttpException;\n+\n+class Password extends Model\n+{\n+    /** @var string */\n+    public $password;\n+\n+    /** @var \\Sil\\IdpPw\\Common\\PasswordStore\\PasswordStoreInterface */\n+    public $passwordStore;\n+\n+    /** @var array */\n+    public $config;\n+\n+    public function init()\n+    {\n+        $this->passwordStore = \\Yii::$app->passwordStore;\n+        $this->config = \\Yii::$app->params['password'];\n+    }\n+\n+    public function rules()\n+    {\n+        return [\n+            [\n+                'password', 'match', 'pattern' => $this->config['minLength']['phpRegex'],\n+                'skipOnError' => false,\n+                'message' => \\Yii::t(\n+                    'app',\n+                    'Your password does not meet the minimum length of {minLength} (code 100)',\n+                    ['minLength' => $this->config['minLength']['value']]\n+                ),\n+                'when' => function() { return $this->config['minLength']['enabled']; }\n+            ],\n+            [\n+                'password', 'match', 'pattern' => $this->config['maxLength']['phpRegex'],\n+                'skipOnError' => false,\n+                'message' => \\Yii::t(\n+                    'app',\n+                    'Your password exceeds the maximum length of {maxLength} (code 110)',\n+                    ['maxLength' => $this->config['maxLength']['value']]\n+                ),\n+                'when' => function() { return $this->config['maxLength']['enabled']; }\n+            ],\n+            [\n+                'password', 'match', 'pattern' => $this->config['minNum']['phpRegex'],\n+                'skipOnError' => false,\n+                'message' => \\Yii::t(\n+                    'app',\n+                    'Your password must contain at least {minNum} numbers (code 120)',\n+                    ['minNum' => $this->config['minNum']['value']]\n+                ),\n+                'when' => function() { return $this->config['minNum']['enabled']; }\n+            ],\n+            [\n+                'password', 'match', 'pattern' => $this->config['minUpper']['phpRegex'],\n+                'skipOnError' => false,\n+                'message' => \\Yii::t(\n+                    'app',\n+                    'Your password must contain at least {minUpper} upper case letters (code 130)',\n+                    ['minUpper' => $this->config['minUpper']['value']]\n+                ),\n+                'when' => function() { return $this->config['minUpper']['enabled']; }\n+            ],\n+            [\n+                'password', 'match', 'pattern' => $this->config['minSpecial']['phpRegex'],\n+                'skipOnError' => false,\n+                'message' => \\Yii::t(\n+                    'app',\n+                    'Your password must contain at least {minSpecial} special characters (code 140)',\n+                    ['minSpecial' => $this->config['minSpecial']['value']]\n+                ),\n+                'when' => function() { return $this->config['minSpecial']['enabled']; }\n+            ],\n+            [\n+                'password', ZxcvbnPasswordValidator::className(), 'minScore' => $this->config['zxcvbn']['minScore'],\n+                'skipOnError' => true,","path":"application/common/models/Password.php","position":83,"original_position":83,"commit_id":"77e2eef654e03b654a802264df20e4fffdddf1f6","original_commit_id":"77e2eef654e03b654a802264df20e4fffdddf1f6","user":{"login":"forevermatt","id":6233204,"avatar_url":"https://avatars.githubusercontent.com/u/6233204?v=3","gravatar_id":"","url":"https://api.github.com/users/forevermatt","html_url":"https://github.com/forevermatt","followers_url":"https://api.github.com/users/forevermatt/followers","following_url":"https://api.github.com/users/forevermatt/following{/other_user}","gists_url":"https://api.github.com/users/forevermatt/gists{/gist_id}","starred_url":"https://api.github.com/users/forevermatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forevermatt/subscriptions","organizations_url":"https://api.github.com/users/forevermatt/orgs","repos_url":"https://api.github.com/users/forevermatt/repos","events_url":"https://api.github.com/users/forevermatt/events{/privacy}","received_events_url":"https://api.github.com/users/forevermatt/received_events","type":"User","site_admin":false},"body":"What is `skipOnError` for?","created_at":"2016-06-30T14:06:15Z","updated_at":"2016-06-30T14:06:15Z","html_url":"https://github.com/silinternational/idp-pw-api/pull/26#discussion_r69137905","pull_request_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/comments/69137905"},"html":{"href":"https://github.com/silinternational/idp-pw-api/pull/26#discussion_r69137905"},"pull_request":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26","id":70868037,"html_url":"https://github.com/silinternational/idp-pw-api/pull/26","diff_url":"https://github.com/silinternational/idp-pw-api/pull/26.diff","patch_url":"https://github.com/silinternational/idp-pw-api/pull/26.patch","issue_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/26","number":26,"state":"open","locked":false,"title":"Password APIs","user":{"login":"fillup","id":556105,"avatar_url":"https://avatars.githubusercontent.com/u/556105?v=3","gravatar_id":"","url":"https://api.github.com/users/fillup","html_url":"https://github.com/fillup","followers_url":"https://api.github.com/users/fillup/followers","following_url":"https://api.github.com/users/fillup/following{/other_user}","gists_url":"https://api.github.com/users/fillup/gists{/gist_id}","starred_url":"https://api.github.com/users/fillup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillup/subscriptions","organizations_url":"https://api.github.com/users/fillup/orgs","repos_url":"https://api.github.com/users/fillup/repos","events_url":"https://api.github.com/users/fillup/events{/privacy}","received_events_url":"https://api.github.com/users/fillup/received_events","type":"User","site_admin":false},"body":"Adding password APIs for getting metadata and changing password. At this time the actual changing of the password is just stubbed out until the LDAP backend integration is ready.\r\n\r\n@wcjr @forevermatt @Baggerone ","created_at":"2016-05-20T14:56:18Z","updated_at":"2016-06-30T14:06:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3963f55963e898ed09dacb52efd8fadf7a0f758","assignee":{"login":"fillup","id":556105,"avatar_url":"https://avatars.githubusercontent.com/u/556105?v=3","gravatar_id":"","url":"https://api.github.com/users/fillup","html_url":"https://github.com/fillup","followers_url":"https://api.github.com/users/fillup/followers","following_url":"https://api.github.com/users/fillup/following{/other_user}","gists_url":"https://api.github.com/users/fillup/gists{/gist_id}","starred_url":"https://api.github.com/users/fillup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillup/subscriptions","organizations_url":"https://api.github.com/users/fillup/orgs","repos_url":"https://api.github.com/users/fillup/repos","events_url":"https://api.github.com/users/fillup/events{/privacy}","received_events_url":"https://api.github.com/users/fillup/received_events","type":"User","site_admin":false},"assignees":[{"login":"fillup","id":556105,"avatar_url":"https://avatars.githubusercontent.com/u/556105?v=3","gravatar_id":"","url":"https://api.github.com/users/fillup","html_url":"https://github.com/fillup","followers_url":"https://api.github.com/users/fillup/followers","following_url":"https://api.github.com/users/fillup/following{/other_user}","gists_url":"https://api.github.com/users/fillup/gists{/gist_id}","starred_url":"https://api.github.com/users/fillup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillup/subscriptions","organizations_url":"https://api.github.com/users/fillup/orgs","repos_url":"https://api.github.com/users/fillup/repos","events_url":"https://api.github.com/users/fillup/events{/privacy}","received_events_url":"https://api.github.com/users/fillup/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26/commits","review_comments_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26/comments","review_comment_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/26/comments","statuses_url":"https://api.github.com/repos/silinternational/idp-pw-api/statuses/77e2eef654e03b654a802264df20e4fffdddf1f6","head":{"label":"silinternational:feature/passwordApis","ref":"feature/passwordApis","sha":"77e2eef654e03b654a802264df20e4fffdddf1f6","user":{"login":"silinternational","id":1247676,"avatar_url":"https://avatars.githubusercontent.com/u/1247676?v=3","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"repo":{"id":52492026,"name":"idp-pw-api","full_name":"silinternational/idp-pw-api","owner":{"login":"silinternational","id":1247676,"avatar_url":"https://avatars.githubusercontent.com/u/1247676?v=3","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silinternational/idp-pw-api","description":"Identity Provider Password Manager API","fork":false,"url":"https://api.github.com/repos/silinternational/idp-pw-api","forks_url":"https://api.github.com/repos/silinternational/idp-pw-api/forks","keys_url":"https://api.github.com/repos/silinternational/idp-pw-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silinternational/idp-pw-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silinternational/idp-pw-api/teams","hooks_url":"https://api.github.com/repos/silinternational/idp-pw-api/hooks","issue_events_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/events{/number}","events_url":"https://api.github.com/repos/silinternational/idp-pw-api/events","assignees_url":"https://api.github.com/repos/silinternational/idp-pw-api/assignees{/user}","branches_url":"https://api.github.com/repos/silinternational/idp-pw-api/branches{/branch}","tags_url":"https://api.github.com/repos/silinternational/idp-pw-api/tags","blobs_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silinternational/idp-pw-api/statuses/{sha}","languages_url":"https://api.github.com/repos/silinternational/idp-pw-api/languages","stargazers_url":"https://api.github.com/repos/silinternational/idp-pw-api/stargazers","contributors_url":"https://api.github.com/repos/silinternational/idp-pw-api/contributors","subscribers_url":"https://api.github.com/repos/silinternational/idp-pw-api/subscribers","subscription_url":"https://api.github.com/repos/silinternational/idp-pw-api/subscription","commits_url":"https://api.github.com/repos/silinternational/idp-pw-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/silinternational/idp-pw-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/silinternational/idp-pw-api/contents/{+path}","compare_url":"https://api.github.com/repos/silinternational/idp-pw-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silinternational/idp-pw-api/merges","archive_url":"https://api.github.com/repos/silinternational/idp-pw-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silinternational/idp-pw-api/downloads","issues_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues{/number}","pulls_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls{/number}","milestones_url":"https://api.github.com/repos/silinternational/idp-pw-api/milestones{/number}","notifications_url":"https://api.github.com/repos/silinternational/idp-pw-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silinternational/idp-pw-api/labels{/name}","releases_url":"https://api.github.com/repos/silinternational/idp-pw-api/releases{/id}","deployments_url":"https://api.github.com/repos/silinternational/idp-pw-api/deployments","created_at":"2016-02-25T02:53:23Z","updated_at":"2016-02-26T15:25:24Z","pushed_at":"2016-06-30T13:23:00Z","git_url":"git://github.com/silinternational/idp-pw-api.git","ssh_url":"git@github.com:silinternational/idp-pw-api.git","clone_url":"https://github.com/silinternational/idp-pw-api.git","svn_url":"https://github.com/silinternational/idp-pw-api","homepage":null,"size":438,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":1,"default_branch":"develop"}},"base":{"label":"silinternational:develop","ref":"develop","sha":"10945b3f1527e41dea3081fe3e8141e01b6111dc","user":{"login":"silinternational","id":1247676,"avatar_url":"https://avatars.githubusercontent.com/u/1247676?v=3","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"repo":{"id":52492026,"name":"idp-pw-api","full_name":"silinternational/idp-pw-api","owner":{"login":"silinternational","id":1247676,"avatar_url":"https://avatars.githubusercontent.com/u/1247676?v=3","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silinternational/idp-pw-api","description":"Identity Provider Password Manager API","fork":false,"url":"https://api.github.com/repos/silinternational/idp-pw-api","forks_url":"https://api.github.com/repos/silinternational/idp-pw-api/forks","keys_url":"https://api.github.com/repos/silinternational/idp-pw-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silinternational/idp-pw-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silinternational/idp-pw-api/teams","hooks_url":"https://api.github.com/repos/silinternational/idp-pw-api/hooks","issue_events_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/events{/number}","events_url":"https://api.github.com/repos/silinternational/idp-pw-api/events","assignees_url":"https://api.github.com/repos/silinternational/idp-pw-api/assignees{/user}","branches_url":"https://api.github.com/repos/silinternational/idp-pw-api/branches{/branch}","tags_url":"https://api.github.com/repos/silinternational/idp-pw-api/tags","blobs_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silinternational/idp-pw-api/statuses/{sha}","languages_url":"https://api.github.com/repos/silinternational/idp-pw-api/languages","stargazers_url":"https://api.github.com/repos/silinternational/idp-pw-api/stargazers","contributors_url":"https://api.github.com/repos/silinternational/idp-pw-api/contributors","subscribers_url":"https://api.github.com/repos/silinternational/idp-pw-api/subscribers","subscription_url":"https://api.github.com/repos/silinternational/idp-pw-api/subscription","commits_url":"https://api.github.com/repos/silinternational/idp-pw-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/silinternational/idp-pw-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/silinternational/idp-pw-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/silinternational/idp-pw-api/contents/{+path}","compare_url":"https://api.github.com/repos/silinternational/idp-pw-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silinternational/idp-pw-api/merges","archive_url":"https://api.github.com/repos/silinternational/idp-pw-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silinternational/idp-pw-api/downloads","issues_url":"https://api.github.com/repos/silinternational/idp-pw-api/issues{/number}","pulls_url":"https://api.github.com/repos/silinternational/idp-pw-api/pulls{/number}","milestones_url":"https://api.github.com/repos/silinternational/idp-pw-api/milestones{/number}","notifications_url":"https://api.github.com/repos/silinternational/idp-pw-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silinternational/idp-pw-api/labels{/name}","releases_url":"https://api.github.com/repos/silinternational/idp-pw-api/releases{/id}","deployments_url":"https://api.github.com/repos/silinternational/idp-pw-api/deployments","created_at":"2016-02-25T02:53:23Z","updated_at":"2016-02-26T15:25:24Z","pushed_at":"2016-06-30T13:23:00Z","git_url":"git://github.com/silinternational/idp-pw-api.git","ssh_url":"git@github.com:silinternational/idp-pw-api.git","clone_url":"https://github.com/silinternational/idp-pw-api.git","svn_url":"https://github.com/silinternational/idp-pw-api","homepage":null,"size":438,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26"},"html":{"href":"https://github.com/silinternational/idp-pw-api/pull/26"},"issue":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/issues/26"},"comments":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/silinternational/idp-pw-api/statuses/77e2eef654e03b654a802264df20e4fffdddf1f6"}}}}
{"actor":{"display_login":"forevermatt"}}