{"action":"created","comment":{"url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/comments/53678173","id":53678173,"diff_hunk":"@@ -11,13 +13,65 @@ function isRunningTests () {\n      process.argv[1].endsWith('mocha'))\n }\n \n+function useTestConfig () {\n+  return !Config.castBool(process.env.UNIT_TEST_OVERRIDE) && isRunningTests()\n+}\n+\n function generateDefaultPairs (ledgers) {\n   return Utils.getPairs(ledgers).map((pair) => {\n     return pair.map(desc => desc.currency + '@' + desc.ledger)\n   })\n }\n \n+function parseCredentialsEnv () {\n+  return JSON.parse(Config.getEnv(envPrefix, 'CREDENTIALS') || '{}')\n+}\n+\n+function parseCredentials () {\n+  const credentialsEnv = parseCredentialsEnv()\n+\n+  return _.reduce(credentialsEnv, (parsed, credentials, ledger) => {\n+    const isClientCertCredential = credentials.key !== undefined\n+\n+    if (isClientCertCredential) {\n+      parsed[ledger] = _.assign(credentials, {\n+        key: fs.readFileSync(credentials.key),\n+        cert: fs.readFileSync(credentials.cert),\n+        ca: credentials.cert && fs.readFileSync(credentials.ca)\n+      })\n+    } else {\n+      parsed[ledger] = credentials\n+    }\n+\n+    return parsed\n+  }, {})\n+}\n+\n+function validateLocalEnvConfig () {\n+  const credentials = parseCredentialsEnv()\n+\n+  _.forEach(credentials, (credential, ledger) => {\n+    if (credential.username === undefined ^ credential.password === undefined) {","path":"src/lib/config.js","position":52,"original_position":52,"commit_id":"f2ffff9d643a138cd59b9df86fa61574b3e116d4","original_commit_id":"f2ffff9d643a138cd59b9df86fa61574b3e116d4","user":{"login":"clark800","id":1238722,"avatar_url":"https://avatars.githubusercontent.com/u/1238722?v=3","gravatar_id":"","url":"https://api.github.com/users/clark800","html_url":"https://github.com/clark800","followers_url":"https://api.github.com/users/clark800/followers","following_url":"https://api.github.com/users/clark800/following{/other_user}","gists_url":"https://api.github.com/users/clark800/gists{/gist_id}","starred_url":"https://api.github.com/users/clark800/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clark800/subscriptions","organizations_url":"https://api.github.com/users/clark800/orgs","repos_url":"https://api.github.com/users/clark800/repos","events_url":"https://api.github.com/users/clark800/events{/privacy}","received_events_url":"https://api.github.com/users/clark800/received_events","type":"User","site_admin":false},"body":"Note: boolean XOR operator is `!==`","created_at":"2016-02-22T19:30:04Z","updated_at":"2016-02-22T19:30:04Z","html_url":"https://github.com/interledger/five-bells-connector/pull/87#discussion_r53678173","pull_request_url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/comments/53678173"},"html":{"href":"https://github.com/interledger/five-bells-connector/pull/87#discussion_r53678173"},"pull_request":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87","id":60124275,"html_url":"https://github.com/interledger/five-bells-connector/pull/87","diff_url":"https://github.com/interledger/five-bells-connector/pull/87.diff","patch_url":"https://github.com/interledger/five-bells-connector/pull/87.patch","issue_url":"https://api.github.com/repos/interledger/five-bells-connector/issues/87","number":87,"state":"open","locked":false,"title":"Enable using client certificate authentication","user":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-22T04:32:12Z","updated_at":"2016-02-22T19:30:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ece7eb366684b006d5092ea5e3537f45c571d3e","assignee":{"login":"sentientwaffle","id":461112,"avatar_url":"https://avatars.githubusercontent.com/u/461112?v=3","gravatar_id":"","url":"https://api.github.com/users/sentientwaffle","html_url":"https://github.com/sentientwaffle","followers_url":"https://api.github.com/users/sentientwaffle/followers","following_url":"https://api.github.com/users/sentientwaffle/following{/other_user}","gists_url":"https://api.github.com/users/sentientwaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/sentientwaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sentientwaffle/subscriptions","organizations_url":"https://api.github.com/users/sentientwaffle/orgs","repos_url":"https://api.github.com/users/sentientwaffle/repos","events_url":"https://api.github.com/users/sentientwaffle/events{/privacy}","received_events_url":"https://api.github.com/users/sentientwaffle/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87/commits","review_comments_url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87/comments","review_comment_url":"https://api.github.com/repos/interledger/five-bells-connector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/interledger/five-bells-connector/issues/87/comments","statuses_url":"https://api.github.com/repos/interledger/five-bells-connector/statuses/f2ffff9d643a138cd59b9df86fa61574b3e116d4","head":{"label":"lumberj:client-cert-request","ref":"client-cert-request","sha":"f2ffff9d643a138cd59b9df86fa61574b3e116d4","user":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"repo":{"id":49222576,"name":"five-bells-connector","full_name":"lumberj/five-bells-connector","owner":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lumberj/five-bells-connector","description":"An implementation of an Interledger connector.","fork":true,"url":"https://api.github.com/repos/lumberj/five-bells-connector","forks_url":"https://api.github.com/repos/lumberj/five-bells-connector/forks","keys_url":"https://api.github.com/repos/lumberj/five-bells-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lumberj/five-bells-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lumberj/five-bells-connector/teams","hooks_url":"https://api.github.com/repos/lumberj/five-bells-connector/hooks","issue_events_url":"https://api.github.com/repos/lumberj/five-bells-connector/issues/events{/number}","events_url":"https://api.github.com/repos/lumberj/five-bells-connector/events","assignees_url":"https://api.github.com/repos/lumberj/five-bells-connector/assignees{/user}","branches_url":"https://api.github.com/repos/lumberj/five-bells-connector/branches{/branch}","tags_url":"https://api.github.com/repos/lumberj/five-bells-connector/tags","blobs_url":"https://api.github.com/repos/lumberj/five-bells-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lumberj/five-bells-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lumberj/five-bells-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/lumberj/five-bells-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lumberj/five-bells-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/lumberj/five-bells-connector/languages","stargazers_url":"https://api.github.com/repos/lumberj/five-bells-connector/stargazers","contributors_url":"https://api.github.com/repos/lumberj/five-bells-connector/contributors","subscribers_url":"https://api.github.com/repos/lumberj/five-bells-connector/subscribers","subscription_url":"https://api.github.com/repos/lumberj/five-bells-connector/subscription","commits_url":"https://api.github.com/repos/lumberj/five-bells-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/lumberj/five-bells-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/lumberj/five-bells-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/lumberj/five-bells-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/lumberj/five-bells-connector/contents/{+path}","compare_url":"https://api.github.com/repos/lumberj/five-bells-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lumberj/five-bells-connector/merges","archive_url":"https://api.github.com/repos/lumberj/five-bells-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lumberj/five-bells-connector/downloads","issues_url":"https://api.github.com/repos/lumberj/five-bells-connector/issues{/number}","pulls_url":"https://api.github.com/repos/lumberj/five-bells-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/lumberj/five-bells-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/lumberj/five-bells-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lumberj/five-bells-connector/labels{/name}","releases_url":"https://api.github.com/repos/lumberj/five-bells-connector/releases{/id}","deployments_url":"https://api.github.com/repos/lumberj/five-bells-connector/deployments","created_at":"2016-01-07T18:30:36Z","updated_at":"2016-01-22T17:36:45Z","pushed_at":"2016-02-22T04:39:21Z","git_url":"git://github.com/lumberj/five-bells-connector.git","ssh_url":"git@github.com:lumberj/five-bells-connector.git","clone_url":"https://github.com/lumberj/five-bells-connector.git","svn_url":"https://github.com/lumberj/five-bells-connector","homepage":"","size":367,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"interledger:master","ref":"master","sha":"703175a23b96eea7db62183a2e9d882df62ae9de","user":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"repo":{"id":30608872,"name":"five-bells-connector","full_name":"interledger/five-bells-connector","owner":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/interledger/five-bells-connector","description":"An implementation of an Interledger connector.","fork":false,"url":"https://api.github.com/repos/interledger/five-bells-connector","forks_url":"https://api.github.com/repos/interledger/five-bells-connector/forks","keys_url":"https://api.github.com/repos/interledger/five-bells-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interledger/five-bells-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interledger/five-bells-connector/teams","hooks_url":"https://api.github.com/repos/interledger/five-bells-connector/hooks","issue_events_url":"https://api.github.com/repos/interledger/five-bells-connector/issues/events{/number}","events_url":"https://api.github.com/repos/interledger/five-bells-connector/events","assignees_url":"https://api.github.com/repos/interledger/five-bells-connector/assignees{/user}","branches_url":"https://api.github.com/repos/interledger/five-bells-connector/branches{/branch}","tags_url":"https://api.github.com/repos/interledger/five-bells-connector/tags","blobs_url":"https://api.github.com/repos/interledger/five-bells-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interledger/five-bells-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interledger/five-bells-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/interledger/five-bells-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interledger/five-bells-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/interledger/five-bells-connector/languages","stargazers_url":"https://api.github.com/repos/interledger/five-bells-connector/stargazers","contributors_url":"https://api.github.com/repos/interledger/five-bells-connector/contributors","subscribers_url":"https://api.github.com/repos/interledger/five-bells-connector/subscribers","subscription_url":"https://api.github.com/repos/interledger/five-bells-connector/subscription","commits_url":"https://api.github.com/repos/interledger/five-bells-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/interledger/five-bells-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/interledger/five-bells-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/interledger/five-bells-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/interledger/five-bells-connector/contents/{+path}","compare_url":"https://api.github.com/repos/interledger/five-bells-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interledger/five-bells-connector/merges","archive_url":"https://api.github.com/repos/interledger/five-bells-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interledger/five-bells-connector/downloads","issues_url":"https://api.github.com/repos/interledger/five-bells-connector/issues{/number}","pulls_url":"https://api.github.com/repos/interledger/five-bells-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/interledger/five-bells-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/interledger/five-bells-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interledger/five-bells-connector/labels{/name}","releases_url":"https://api.github.com/repos/interledger/five-bells-connector/releases{/id}","deployments_url":"https://api.github.com/repos/interledger/five-bells-connector/deployments","created_at":"2015-02-10T19:01:26Z","updated_at":"2016-01-25T22:20:22Z","pushed_at":"2016-02-22T17:48:52Z","git_url":"git://github.com/interledger/five-bells-connector.git","ssh_url":"git@github.com:interledger/five-bells-connector.git","clone_url":"https://github.com/interledger/five-bells-connector.git","svn_url":"https://github.com/interledger/five-bells-connector","homepage":"","size":378,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":8,"forks":5,"open_issues":8,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87"},"html":{"href":"https://github.com/interledger/five-bells-connector/pull/87"},"issue":{"href":"https://api.github.com/repos/interledger/five-bells-connector/issues/87"},"comments":{"href":"https://api.github.com/repos/interledger/five-bells-connector/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/interledger/five-bells-connector/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/interledger/five-bells-connector/statuses/f2ffff9d643a138cd59b9df86fa61574b3e116d4"}}}}