{"action":"created","comment":{"url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/comments/26550692","id":26550692,"diff_hunk":"@@ -0,0 +1,94 @@\n+'use strict';\n+/**\n+* ##User API Adapter\n+*\n+* The user API adapter allows you to quert the /user API\n+*\n+*\n+*/\n+\n+var ConfigService = require('./configuration-service');\n+var TransportFactory = require('../transport/http-transport-factory');\n+var qutil = require('../util/query-util');\n+\n+module.exports = function (config) {\n+    var defaults = {\n+\n+       account: '',\n+\n+       token: '',\n+\n+        //Options to pass on to the underlying transport layer\n+        transport: {}\n+    };\n+\n+    var serviceOptions = $.extend({}, defaults, config);\n+    var urlConfig = new ConfigService(serviceOptions).get('server');\n+    var transportOptions = $.extend(true, {}, serviceOptions.transport, {\n+        url: urlConfig.getAPIPath('user')\n+    });\n+\n+    if (serviceOptions.token) {\n+        transportOptions.headers = {\n+            'Authorization': 'Bearer ' + serviceOptions.token\n+        };\n+    }\n+\n+    if (serviceOptions.apiKey) {","path":"src/service/user-api-adapter.js","position":37,"original_position":37,"commit_id":"f91bebf7bad3f81165756236f7e50b6adbc6e0c9","original_commit_id":"f91bebf7bad3f81165756236f7e50b6adbc6e0c9","user":{"login":"narenranjit","id":830274,"avatar_url":"https://avatars.githubusercontent.com/u/830274?v=3","gravatar_id":"","url":"https://api.github.com/users/narenranjit","html_url":"https://github.com/narenranjit","followers_url":"https://api.github.com/users/narenranjit/followers","following_url":"https://api.github.com/users/narenranjit/following{/other_user}","gists_url":"https://api.github.com/users/narenranjit/gists{/gist_id}","starred_url":"https://api.github.com/users/narenranjit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narenranjit/subscriptions","organizations_url":"https://api.github.com/users/narenranjit/orgs","repos_url":"https://api.github.com/users/narenranjit/repos","events_url":"https://api.github.com/users/narenranjit/events{/privacy}","received_events_url":"https://api.github.com/users/narenranjit/received_events","type":"User","site_admin":false},"body":"Can we specify both token and apiKey? Also, is the apiKey valid for other services also?","created_at":"2015-03-17T05:42:52Z","updated_at":"2015-03-17T05:42:52Z","html_url":"https://github.com/forio/epicenter-js-libs/pull/64#discussion_r26550692","pull_request_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/comments/26550692"},"html":{"href":"https://github.com/forio/epicenter-js-libs/pull/64#discussion_r26550692"},"pull_request":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64","id":30214135,"html_url":"https://github.com/forio/epicenter-js-libs/pull/64","diff_url":"https://github.com/forio/epicenter-js-libs/pull/64.diff","patch_url":"https://github.com/forio/epicenter-js-libs/pull/64.patch","issue_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/64","number":64,"state":"open","locked":false,"title":"Assignment","user":{"login":"jaimedp","id":352921,"avatar_url":"https://avatars.githubusercontent.com/u/352921?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimedp","html_url":"https://github.com/jaimedp","followers_url":"https://api.github.com/users/jaimedp/followers","following_url":"https://api.github.com/users/jaimedp/following{/other_user}","gists_url":"https://api.github.com/users/jaimedp/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimedp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimedp/subscriptions","organizations_url":"https://api.github.com/users/jaimedp/orgs","repos_url":"https://api.github.com/users/jaimedp/repos","events_url":"https://api.github.com/users/jaimedp/events{/privacy}","received_events_url":"https://api.github.com/users/jaimedp/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-28T00:56:44Z","updated_at":"2015-03-17T05:42:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"549d5a2c72bfe5af3524285be2b422ecfe8cddab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64/commits","review_comments_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64/comments","review_comment_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/64/comments","statuses_url":"https://api.github.com/repos/forio/epicenter-js-libs/statuses/f91bebf7bad3f81165756236f7e50b6adbc6e0c9","head":{"label":"forio:assignment","ref":"assignment","sha":"f91bebf7bad3f81165756236f7e50b6adbc6e0c9","user":{"login":"forio","id":1878641,"avatar_url":"https://avatars.githubusercontent.com/u/1878641?v=3","gravatar_id":"","url":"https://api.github.com/users/forio","html_url":"https://github.com/forio","followers_url":"https://api.github.com/users/forio/followers","following_url":"https://api.github.com/users/forio/following{/other_user}","gists_url":"https://api.github.com/users/forio/gists{/gist_id}","starred_url":"https://api.github.com/users/forio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forio/subscriptions","organizations_url":"https://api.github.com/users/forio/orgs","repos_url":"https://api.github.com/users/forio/repos","events_url":"https://api.github.com/users/forio/events{/privacy}","received_events_url":"https://api.github.com/users/forio/received_events","type":"Organization","site_admin":false},"repo":{"id":20453304,"name":"epicenter-js-libs","full_name":"forio/epicenter-js-libs","owner":{"login":"forio","id":1878641,"avatar_url":"https://avatars.githubusercontent.com/u/1878641?v=3","gravatar_id":"","url":"https://api.github.com/users/forio","html_url":"https://github.com/forio","followers_url":"https://api.github.com/users/forio/followers","following_url":"https://api.github.com/users/forio/following{/other_user}","gists_url":"https://api.github.com/users/forio/gists{/gist_id}","starred_url":"https://api.github.com/users/forio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forio/subscriptions","organizations_url":"https://api.github.com/users/forio/orgs","repos_url":"https://api.github.com/users/forio/repos","events_url":"https://api.github.com/users/forio/events{/privacy}","received_events_url":"https://api.github.com/users/forio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/forio/epicenter-js-libs","description":"","fork":false,"url":"https://api.github.com/repos/forio/epicenter-js-libs","forks_url":"https://api.github.com/repos/forio/epicenter-js-libs/forks","keys_url":"https://api.github.com/repos/forio/epicenter-js-libs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/forio/epicenter-js-libs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/forio/epicenter-js-libs/teams","hooks_url":"https://api.github.com/repos/forio/epicenter-js-libs/hooks","issue_events_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/events{/number}","events_url":"https://api.github.com/repos/forio/epicenter-js-libs/events","assignees_url":"https://api.github.com/repos/forio/epicenter-js-libs/assignees{/user}","branches_url":"https://api.github.com/repos/forio/epicenter-js-libs/branches{/branch}","tags_url":"https://api.github.com/repos/forio/epicenter-js-libs/tags","blobs_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/refs{/sha}","trees_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/forio/epicenter-js-libs/statuses/{sha}","languages_url":"https://api.github.com/repos/forio/epicenter-js-libs/languages","stargazers_url":"https://api.github.com/repos/forio/epicenter-js-libs/stargazers","contributors_url":"https://api.github.com/repos/forio/epicenter-js-libs/contributors","subscribers_url":"https://api.github.com/repos/forio/epicenter-js-libs/subscribers","subscription_url":"https://api.github.com/repos/forio/epicenter-js-libs/subscription","commits_url":"https://api.github.com/repos/forio/epicenter-js-libs/commits{/sha}","git_commits_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/commits{/sha}","comments_url":"https://api.github.com/repos/forio/epicenter-js-libs/comments{/number}","issue_comment_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/comments{/number}","contents_url":"https://api.github.com/repos/forio/epicenter-js-libs/contents/{+path}","compare_url":"https://api.github.com/repos/forio/epicenter-js-libs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/forio/epicenter-js-libs/merges","archive_url":"https://api.github.com/repos/forio/epicenter-js-libs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/forio/epicenter-js-libs/downloads","issues_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues{/number}","pulls_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls{/number}","milestones_url":"https://api.github.com/repos/forio/epicenter-js-libs/milestones{/number}","notifications_url":"https://api.github.com/repos/forio/epicenter-js-libs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/forio/epicenter-js-libs/labels{/name}","releases_url":"https://api.github.com/repos/forio/epicenter-js-libs/releases{/id}","created_at":"2014-06-03T17:56:32Z","updated_at":"2015-03-16T19:22:29Z","pushed_at":"2015-03-16T23:24:21Z","git_url":"git://github.com/forio/epicenter-js-libs.git","ssh_url":"git@github.com:forio/epicenter-js-libs.git","clone_url":"https://github.com/forio/epicenter-js-libs.git","svn_url":"https://github.com/forio/epicenter-js-libs","homepage":null,"size":4594,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":19,"forks":1,"open_issues":19,"watchers":0,"default_branch":"master"}},"base":{"label":"forio:master","ref":"master","sha":"23ee4391ef5ba2bf17f3605d24221628237b24d3","user":{"login":"forio","id":1878641,"avatar_url":"https://avatars.githubusercontent.com/u/1878641?v=3","gravatar_id":"","url":"https://api.github.com/users/forio","html_url":"https://github.com/forio","followers_url":"https://api.github.com/users/forio/followers","following_url":"https://api.github.com/users/forio/following{/other_user}","gists_url":"https://api.github.com/users/forio/gists{/gist_id}","starred_url":"https://api.github.com/users/forio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forio/subscriptions","organizations_url":"https://api.github.com/users/forio/orgs","repos_url":"https://api.github.com/users/forio/repos","events_url":"https://api.github.com/users/forio/events{/privacy}","received_events_url":"https://api.github.com/users/forio/received_events","type":"Organization","site_admin":false},"repo":{"id":20453304,"name":"epicenter-js-libs","full_name":"forio/epicenter-js-libs","owner":{"login":"forio","id":1878641,"avatar_url":"https://avatars.githubusercontent.com/u/1878641?v=3","gravatar_id":"","url":"https://api.github.com/users/forio","html_url":"https://github.com/forio","followers_url":"https://api.github.com/users/forio/followers","following_url":"https://api.github.com/users/forio/following{/other_user}","gists_url":"https://api.github.com/users/forio/gists{/gist_id}","starred_url":"https://api.github.com/users/forio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forio/subscriptions","organizations_url":"https://api.github.com/users/forio/orgs","repos_url":"https://api.github.com/users/forio/repos","events_url":"https://api.github.com/users/forio/events{/privacy}","received_events_url":"https://api.github.com/users/forio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/forio/epicenter-js-libs","description":"","fork":false,"url":"https://api.github.com/repos/forio/epicenter-js-libs","forks_url":"https://api.github.com/repos/forio/epicenter-js-libs/forks","keys_url":"https://api.github.com/repos/forio/epicenter-js-libs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/forio/epicenter-js-libs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/forio/epicenter-js-libs/teams","hooks_url":"https://api.github.com/repos/forio/epicenter-js-libs/hooks","issue_events_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/events{/number}","events_url":"https://api.github.com/repos/forio/epicenter-js-libs/events","assignees_url":"https://api.github.com/repos/forio/epicenter-js-libs/assignees{/user}","branches_url":"https://api.github.com/repos/forio/epicenter-js-libs/branches{/branch}","tags_url":"https://api.github.com/repos/forio/epicenter-js-libs/tags","blobs_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/refs{/sha}","trees_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/forio/epicenter-js-libs/statuses/{sha}","languages_url":"https://api.github.com/repos/forio/epicenter-js-libs/languages","stargazers_url":"https://api.github.com/repos/forio/epicenter-js-libs/stargazers","contributors_url":"https://api.github.com/repos/forio/epicenter-js-libs/contributors","subscribers_url":"https://api.github.com/repos/forio/epicenter-js-libs/subscribers","subscription_url":"https://api.github.com/repos/forio/epicenter-js-libs/subscription","commits_url":"https://api.github.com/repos/forio/epicenter-js-libs/commits{/sha}","git_commits_url":"https://api.github.com/repos/forio/epicenter-js-libs/git/commits{/sha}","comments_url":"https://api.github.com/repos/forio/epicenter-js-libs/comments{/number}","issue_comment_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues/comments{/number}","contents_url":"https://api.github.com/repos/forio/epicenter-js-libs/contents/{+path}","compare_url":"https://api.github.com/repos/forio/epicenter-js-libs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/forio/epicenter-js-libs/merges","archive_url":"https://api.github.com/repos/forio/epicenter-js-libs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/forio/epicenter-js-libs/downloads","issues_url":"https://api.github.com/repos/forio/epicenter-js-libs/issues{/number}","pulls_url":"https://api.github.com/repos/forio/epicenter-js-libs/pulls{/number}","milestones_url":"https://api.github.com/repos/forio/epicenter-js-libs/milestones{/number}","notifications_url":"https://api.github.com/repos/forio/epicenter-js-libs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/forio/epicenter-js-libs/labels{/name}","releases_url":"https://api.github.com/repos/forio/epicenter-js-libs/releases{/id}","created_at":"2014-06-03T17:56:32Z","updated_at":"2015-03-16T19:22:29Z","pushed_at":"2015-03-16T23:24:21Z","git_url":"git://github.com/forio/epicenter-js-libs.git","ssh_url":"git@github.com:forio/epicenter-js-libs.git","clone_url":"https://github.com/forio/epicenter-js-libs.git","svn_url":"https://github.com/forio/epicenter-js-libs","homepage":null,"size":4594,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":19,"forks":1,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64"},"html":{"href":"https://github.com/forio/epicenter-js-libs/pull/64"},"issue":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/issues/64"},"comments":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/forio/epicenter-js-libs/statuses/f91bebf7bad3f81165756236f7e50b6adbc6e0c9"}}}}