{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/comments/31675502","id":31675502,"diff_hunk":"@@ -0,0 +1,64 @@\n+var auth = require('http-auth');\n+var crypto = require('crypto');\n+var fmt = require('util').format;\n+\n+module.exports = makeAuthMiddleware;\n+module.exports.parse = parseAuth;\n+\n+var authMethods = {\n+  basic: makeBasicAuth,\n+  digest: makeDigestAuth,\n+  none: makeNoAuth,\n+};\n+\n+function makeAuthMiddleware(pmAuthStr) {\n+  var parts = parseAuth(pmAuthStr);\n+  return authMethods[parts.scheme](parts.user, parts.realm, parts.pass);\n+}\n+\n+var AUTH_REGEXP = /^(basic|digest):(.+):(.+)$/;\n+function parseAuth(pmAuthStr) {\n+  var parts = AUTH_REGEXP.exec(pmAuthStr) ||\n+              AUTH_REGEXP.exec('basic:' + pmAuthStr);\n+  var result = {\n+    scheme: parts ? parts[1] : 'none',\n+    user: parts && parts[2],\n+    pass: parts && parts[3],\n+    realm: 'strong-pm',\n+  };\n+  result.normalized = fmt('%s:%s:%s', result.scheme, result.user, result.pass);\n+  return result;\n+}\n+\n+function makeNoAuth() {\n+  return function noop(req, res, next) {\n+    next();\n+  };\n+}\n+\n+function makeBasicAuth(user, realm, pass) {\n+  console.log('PM: enabling HTTP authentication (Basic)');","path":"server/auth.js","position":40,"original_position":40,"commit_id":"f3a0df728080216a19ef940cb42c1b6c00031a2c","original_commit_id":"f3a0df728080216a19ef940cb42c1b6c00031a2c","user":{"login":"rmg","id":17978,"avatar_url":"https://avatars.githubusercontent.com/u/17978?v=3","gravatar_id":"","url":"https://api.github.com/users/rmg","html_url":"https://github.com/rmg","followers_url":"https://api.github.com/users/rmg/followers","following_url":"https://api.github.com/users/rmg/following{/other_user}","gists_url":"https://api.github.com/users/rmg/gists{/gist_id}","starred_url":"https://api.github.com/users/rmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmg/subscriptions","organizations_url":"https://api.github.com/users/rmg/orgs","repos_url":"https://api.github.com/users/rmg/repos","events_url":"https://api.github.com/users/rmg/events{/privacy}","received_events_url":"https://api.github.com/users/rmg/received_events","type":"User","site_admin":false},"body":"log message should be updated, it's not PM specific anymore","created_at":"2015-06-03T22:05:37Z","updated_at":"2015-06-03T22:05:37Z","html_url":"https://github.com/strongloop/strong-mesh-models/pull/66#discussion_r31675502","pull_request_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/comments/31675502"},"html":{"href":"https://github.com/strongloop/strong-mesh-models/pull/66#discussion_r31675502"},"pull_request":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66","id":36370463,"html_url":"https://github.com/strongloop/strong-mesh-models/pull/66","diff_url":"https://github.com/strongloop/strong-mesh-models/pull/66.diff","patch_url":"https://github.com/strongloop/strong-mesh-models/pull/66.patch","issue_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/66","number":66,"state":"open","locked":false,"title":"Model updates for strong-central","user":{"login":"kraman","id":449065,"avatar_url":"https://avatars.githubusercontent.com/u/449065?v=3","gravatar_id":"","url":"https://api.github.com/users/kraman","html_url":"https://github.com/kraman","followers_url":"https://api.github.com/users/kraman/followers","following_url":"https://api.github.com/users/kraman/following{/other_user}","gists_url":"https://api.github.com/users/kraman/gists{/gist_id}","starred_url":"https://api.github.com/users/kraman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kraman/subscriptions","organizations_url":"https://api.github.com/users/kraman/orgs","repos_url":"https://api.github.com/users/kraman/repos","events_url":"https://api.github.com/users/kraman/events{/privacy}","received_events_url":"https://api.github.com/users/kraman/received_events","type":"User","site_admin":false},"body":"Connect to strongloop-internal/scrum-nodeops#421","created_at":"2015-05-28T04:05:50Z","updated_at":"2015-06-03T22:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fa45e81791b25d08d5eb5ee26eaf178931fb26e","assignee":{"login":"kraman","id":449065,"avatar_url":"https://avatars.githubusercontent.com/u/449065?v=3","gravatar_id":"","url":"https://api.github.com/users/kraman","html_url":"https://github.com/kraman","followers_url":"https://api.github.com/users/kraman/followers","following_url":"https://api.github.com/users/kraman/following{/other_user}","gists_url":"https://api.github.com/users/kraman/gists{/gist_id}","starred_url":"https://api.github.com/users/kraman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kraman/subscriptions","organizations_url":"https://api.github.com/users/kraman/orgs","repos_url":"https://api.github.com/users/kraman/repos","events_url":"https://api.github.com/users/kraman/events{/privacy}","received_events_url":"https://api.github.com/users/kraman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66/commits","review_comments_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66/comments","review_comment_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/66/comments","statuses_url":"https://api.github.com/repos/strongloop/strong-mesh-models/statuses/f3a0df728080216a19ef940cb42c1b6c00031a2c","head":{"label":"strongloop:feature/strong-central","ref":"feature/strong-central","sha":"f3a0df728080216a19ef940cb42c1b6c00031a2c","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":24951510,"name":"strong-mesh-models","full_name":"strongloop/strong-mesh-models","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-mesh-models","description":"Set of common models used by strong-pm and strong-scheduler","fork":false,"url":"https://api.github.com/repos/strongloop/strong-mesh-models","forks_url":"https://api.github.com/repos/strongloop/strong-mesh-models/forks","keys_url":"https://api.github.com/repos/strongloop/strong-mesh-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-mesh-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-mesh-models/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-mesh-models/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-mesh-models/events","assignees_url":"https://api.github.com/repos/strongloop/strong-mesh-models/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-mesh-models/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-mesh-models/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-mesh-models/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-mesh-models/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-mesh-models/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-mesh-models/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-mesh-models/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-mesh-models/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-mesh-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-mesh-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-mesh-models/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-mesh-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-mesh-models/merges","archive_url":"https://api.github.com/repos/strongloop/strong-mesh-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-mesh-models/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-mesh-models/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-mesh-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-mesh-models/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-mesh-models/releases{/id}","created_at":"2014-10-08T17:14:11Z","updated_at":"2015-05-08T17:06:10Z","pushed_at":"2015-06-03T20:59:58Z","git_url":"git://github.com/strongloop/strong-mesh-models.git","ssh_url":"git@github.com:strongloop/strong-mesh-models.git","clone_url":"https://github.com/strongloop/strong-mesh-models.git","svn_url":"https://github.com/strongloop/strong-mesh-models","homepage":null,"size":2788,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"fe1314852840628fd1f66c2a613d9e3f29f59e92","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":24951510,"name":"strong-mesh-models","full_name":"strongloop/strong-mesh-models","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-mesh-models","description":"Set of common models used by strong-pm and strong-scheduler","fork":false,"url":"https://api.github.com/repos/strongloop/strong-mesh-models","forks_url":"https://api.github.com/repos/strongloop/strong-mesh-models/forks","keys_url":"https://api.github.com/repos/strongloop/strong-mesh-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-mesh-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-mesh-models/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-mesh-models/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-mesh-models/events","assignees_url":"https://api.github.com/repos/strongloop/strong-mesh-models/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-mesh-models/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-mesh-models/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-mesh-models/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-mesh-models/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-mesh-models/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-mesh-models/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-mesh-models/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-mesh-models/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-mesh-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-mesh-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-mesh-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-mesh-models/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-mesh-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-mesh-models/merges","archive_url":"https://api.github.com/repos/strongloop/strong-mesh-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-mesh-models/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-mesh-models/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-mesh-models/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-mesh-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-mesh-models/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-mesh-models/releases{/id}","created_at":"2014-10-08T17:14:11Z","updated_at":"2015-05-08T17:06:10Z","pushed_at":"2015-06-03T20:59:58Z","git_url":"git://github.com/strongloop/strong-mesh-models.git","ssh_url":"git@github.com:strongloop/strong-mesh-models.git","clone_url":"https://github.com/strongloop/strong-mesh-models.git","svn_url":"https://github.com/strongloop/strong-mesh-models","homepage":null,"size":2788,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66"},"html":{"href":"https://github.com/strongloop/strong-mesh-models/pull/66"},"issue":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/66"},"comments":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/strong-mesh-models/statuses/f3a0df728080216a19ef940cb42c1b6c00031a2c"}}}}