{"action":"created","comment":{"url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/comments/96147410","pull_request_review_id":16723154,"id":96147410,"diff_hunk":"@@ -42,6 +42,22 @@ describe 'Url Builder', ->\n       '/' + config.db + '?ssl=true'\n     done()\n \n+  it 'builds a single node url with an authDatabase', (done) ->\n+    config =\n+      user: 'someuser'\n+      password: 'somepass'\n+      host: 'abcde',\n+      port: 27111\n+      db: '_mm'\n+      collection: '_migrations',\n+      authDatabase: 'admin'\n+\n+    connString = urlBuilder.buildMongoConnString config\n+    connString.should.be.equal 'mongodb://' + config.user + ':' +","path":"test/url-builder.coffee","position":15,"original_position":15,"commit_id":"3284563f57b87fc31a202d672772e35664a45684","original_commit_id":"3284563f57b87fc31a202d672772e35664a45684","user":{"login":"emirotin","id":525832,"avatar_url":"https://avatars.githubusercontent.com/u/525832?v=3","gravatar_id":"","url":"https://api.github.com/users/emirotin","html_url":"https://github.com/emirotin","followers_url":"https://api.github.com/users/emirotin/followers","following_url":"https://api.github.com/users/emirotin/following{/other_user}","gists_url":"https://api.github.com/users/emirotin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirotin/subscriptions","organizations_url":"https://api.github.com/users/emirotin/orgs","repos_url":"https://api.github.com/users/emirotin/repos","events_url":"https://api.github.com/users/emirotin/events{/privacy}","received_events_url":"https://api.github.com/users/emirotin/received_events","type":"User","site_admin":false},"body":"Can you please use string interpolation here too, and switch the previous test as well?","created_at":"2017-01-15T20:50:14Z","updated_at":"2017-01-15T20:50:26Z","html_url":"https://github.com/emirotin/mongodb-migrations/pull/38#discussion_r96147410","pull_request_url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/comments/96147410"},"html":{"href":"https://github.com/emirotin/mongodb-migrations/pull/38#discussion_r96147410"},"pull_request":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38","id":101566595,"html_url":"https://github.com/emirotin/mongodb-migrations/pull/38","diff_url":"https://github.com/emirotin/mongodb-migrations/pull/38.diff","patch_url":"https://github.com/emirotin/mongodb-migrations/pull/38.patch","issue_url":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/38","number":38,"state":"open","locked":false,"title":"Allow setting authentication database in the MongoClient connection via config","user":{"login":"samgavinio","id":8102514,"avatar_url":"https://avatars.githubusercontent.com/u/8102514?v=3","gravatar_id":"","url":"https://api.github.com/users/samgavinio","html_url":"https://github.com/samgavinio","followers_url":"https://api.github.com/users/samgavinio/followers","following_url":"https://api.github.com/users/samgavinio/following{/other_user}","gists_url":"https://api.github.com/users/samgavinio/gists{/gist_id}","starred_url":"https://api.github.com/users/samgavinio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samgavinio/subscriptions","organizations_url":"https://api.github.com/users/samgavinio/orgs","repos_url":"https://api.github.com/users/samgavinio/repos","events_url":"https://api.github.com/users/samgavinio/events{/privacy}","received_events_url":"https://api.github.com/users/samgavinio/received_events","type":"User","site_admin":false},"body":"@emirotin pretty cool work here! I like how there's not much bloat in here compared to other migration frameworks. Please review this PR when you find the time.\r\n\r\n#### Description\r\n\r\nAdds an option to allow setting of the mongodb authentication database via the config file. This resolves an issue where the MongoClient cannot connect to an authentication-enabled mongo instance because the user is stored on a separate authentication database. Achieved by simply appending `authSource` to the connection string\r\n\r\nAn alternative work around to the issue is to set the `authSource` directly in the url string but this sort of defeats the purpose of having the rest of the JSON file so may as well add this in.\r\n\r\n#### References\r\n\r\n* Mongo AuthDatabase reference - https://docs.mongodb.com/manual/core/security-users/#user-authentication-database\r\n* Mongo Nodejs driver: https://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#auth-options\r\n\r\n#### Risks\r\n\r\n* [Pretty low] Basically just appends a new connection string query parameter","created_at":"2017-01-14T16:40:40Z","updated_at":"2017-01-15T20:50:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc5da3942b1ddda36a55fd540f6d81eef3f70737","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38/commits","review_comments_url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38/comments","review_comment_url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/38/comments","statuses_url":"https://api.github.com/repos/emirotin/mongodb-migrations/statuses/3284563f57b87fc31a202d672772e35664a45684","head":{"label":"samgavinio:samgavinio/auth-database-connection","ref":"samgavinio/auth-database-connection","sha":"3284563f57b87fc31a202d672772e35664a45684","user":{"login":"samgavinio","id":8102514,"avatar_url":"https://avatars.githubusercontent.com/u/8102514?v=3","gravatar_id":"","url":"https://api.github.com/users/samgavinio","html_url":"https://github.com/samgavinio","followers_url":"https://api.github.com/users/samgavinio/followers","following_url":"https://api.github.com/users/samgavinio/following{/other_user}","gists_url":"https://api.github.com/users/samgavinio/gists{/gist_id}","starred_url":"https://api.github.com/users/samgavinio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samgavinio/subscriptions","organizations_url":"https://api.github.com/users/samgavinio/orgs","repos_url":"https://api.github.com/users/samgavinio/repos","events_url":"https://api.github.com/users/samgavinio/events{/privacy}","received_events_url":"https://api.github.com/users/samgavinio/received_events","type":"User","site_admin":false},"repo":{"id":78950359,"name":"mongodb-migrations","full_name":"samgavinio/mongodb-migrations","owner":{"login":"samgavinio","id":8102514,"avatar_url":"https://avatars.githubusercontent.com/u/8102514?v=3","gravatar_id":"","url":"https://api.github.com/users/samgavinio","html_url":"https://github.com/samgavinio","followers_url":"https://api.github.com/users/samgavinio/followers","following_url":"https://api.github.com/users/samgavinio/following{/other_user}","gists_url":"https://api.github.com/users/samgavinio/gists{/gist_id}","starred_url":"https://api.github.com/users/samgavinio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samgavinio/subscriptions","organizations_url":"https://api.github.com/users/samgavinio/orgs","repos_url":"https://api.github.com/users/samgavinio/repos","events_url":"https://api.github.com/users/samgavinio/events{/privacy}","received_events_url":"https://api.github.com/users/samgavinio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samgavinio/mongodb-migrations","description":"A Node.js migration framework for MongoDB","fork":true,"url":"https://api.github.com/repos/samgavinio/mongodb-migrations","forks_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/forks","keys_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/teams","hooks_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/hooks","issue_events_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/issues/events{/number}","events_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/events","assignees_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/assignees{/user}","branches_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/branches{/branch}","tags_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/tags","blobs_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/git/refs{/sha}","trees_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/statuses/{sha}","languages_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/languages","stargazers_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/stargazers","contributors_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/contributors","subscribers_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/subscribers","subscription_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/subscription","commits_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/commits{/sha}","git_commits_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/git/commits{/sha}","comments_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/comments{/number}","issue_comment_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/issues/comments{/number}","contents_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/contents/{+path}","compare_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/merges","archive_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/downloads","issues_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/issues{/number}","pulls_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/pulls{/number}","milestones_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/milestones{/number}","notifications_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/labels{/name}","releases_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/releases{/id}","deployments_url":"https://api.github.com/repos/samgavinio/mongodb-migrations/deployments","created_at":"2017-01-14T16:07:55Z","updated_at":"2017-01-14T16:07:57Z","pushed_at":"2017-01-14T17:16:46Z","git_url":"git://github.com/samgavinio/mongodb-migrations.git","ssh_url":"git@github.com:samgavinio/mongodb-migrations.git","clone_url":"https://github.com/samgavinio/mongodb-migrations.git","svn_url":"https://github.com/samgavinio/mongodb-migrations","homepage":null,"size":137,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":"develop"}},"base":{"label":"emirotin:develop","ref":"develop","sha":"f256b435ebdeba692a6897acd3eda71bb9139bb1","user":{"login":"emirotin","id":525832,"avatar_url":"https://avatars.githubusercontent.com/u/525832?v=3","gravatar_id":"","url":"https://api.github.com/users/emirotin","html_url":"https://github.com/emirotin","followers_url":"https://api.github.com/users/emirotin/followers","following_url":"https://api.github.com/users/emirotin/following{/other_user}","gists_url":"https://api.github.com/users/emirotin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirotin/subscriptions","organizations_url":"https://api.github.com/users/emirotin/orgs","repos_url":"https://api.github.com/users/emirotin/repos","events_url":"https://api.github.com/users/emirotin/events{/privacy}","received_events_url":"https://api.github.com/users/emirotin/received_events","type":"User","site_admin":false},"repo":{"id":17434418,"name":"mongodb-migrations","full_name":"emirotin/mongodb-migrations","owner":{"login":"emirotin","id":525832,"avatar_url":"https://avatars.githubusercontent.com/u/525832?v=3","gravatar_id":"","url":"https://api.github.com/users/emirotin","html_url":"https://github.com/emirotin","followers_url":"https://api.github.com/users/emirotin/followers","following_url":"https://api.github.com/users/emirotin/following{/other_user}","gists_url":"https://api.github.com/users/emirotin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirotin/subscriptions","organizations_url":"https://api.github.com/users/emirotin/orgs","repos_url":"https://api.github.com/users/emirotin/repos","events_url":"https://api.github.com/users/emirotin/events{/privacy}","received_events_url":"https://api.github.com/users/emirotin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emirotin/mongodb-migrations","description":"A Node.js migration framework for MongoDB","fork":false,"url":"https://api.github.com/repos/emirotin/mongodb-migrations","forks_url":"https://api.github.com/repos/emirotin/mongodb-migrations/forks","keys_url":"https://api.github.com/repos/emirotin/mongodb-migrations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emirotin/mongodb-migrations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emirotin/mongodb-migrations/teams","hooks_url":"https://api.github.com/repos/emirotin/mongodb-migrations/hooks","issue_events_url":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/events{/number}","events_url":"https://api.github.com/repos/emirotin/mongodb-migrations/events","assignees_url":"https://api.github.com/repos/emirotin/mongodb-migrations/assignees{/user}","branches_url":"https://api.github.com/repos/emirotin/mongodb-migrations/branches{/branch}","tags_url":"https://api.github.com/repos/emirotin/mongodb-migrations/tags","blobs_url":"https://api.github.com/repos/emirotin/mongodb-migrations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emirotin/mongodb-migrations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emirotin/mongodb-migrations/git/refs{/sha}","trees_url":"https://api.github.com/repos/emirotin/mongodb-migrations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emirotin/mongodb-migrations/statuses/{sha}","languages_url":"https://api.github.com/repos/emirotin/mongodb-migrations/languages","stargazers_url":"https://api.github.com/repos/emirotin/mongodb-migrations/stargazers","contributors_url":"https://api.github.com/repos/emirotin/mongodb-migrations/contributors","subscribers_url":"https://api.github.com/repos/emirotin/mongodb-migrations/subscribers","subscription_url":"https://api.github.com/repos/emirotin/mongodb-migrations/subscription","commits_url":"https://api.github.com/repos/emirotin/mongodb-migrations/commits{/sha}","git_commits_url":"https://api.github.com/repos/emirotin/mongodb-migrations/git/commits{/sha}","comments_url":"https://api.github.com/repos/emirotin/mongodb-migrations/comments{/number}","issue_comment_url":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/comments{/number}","contents_url":"https://api.github.com/repos/emirotin/mongodb-migrations/contents/{+path}","compare_url":"https://api.github.com/repos/emirotin/mongodb-migrations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emirotin/mongodb-migrations/merges","archive_url":"https://api.github.com/repos/emirotin/mongodb-migrations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emirotin/mongodb-migrations/downloads","issues_url":"https://api.github.com/repos/emirotin/mongodb-migrations/issues{/number}","pulls_url":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls{/number}","milestones_url":"https://api.github.com/repos/emirotin/mongodb-migrations/milestones{/number}","notifications_url":"https://api.github.com/repos/emirotin/mongodb-migrations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emirotin/mongodb-migrations/labels{/name}","releases_url":"https://api.github.com/repos/emirotin/mongodb-migrations/releases{/id}","deployments_url":"https://api.github.com/repos/emirotin/mongodb-migrations/deployments","created_at":"2014-03-05T09:16:18Z","updated_at":"2017-01-04T05:44:08Z","pushed_at":"2017-01-15T01:12:10Z","git_url":"git://github.com/emirotin/mongodb-migrations.git","ssh_url":"git@github.com:emirotin/mongodb-migrations.git","clone_url":"https://github.com/emirotin/mongodb-migrations.git","svn_url":"https://github.com/emirotin/mongodb-migrations","homepage":null,"size":138,"stargazers_count":100,"watchers_count":100,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":6,"forks":26,"open_issues":6,"watchers":100,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38"},"html":{"href":"https://github.com/emirotin/mongodb-migrations/pull/38"},"issue":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/38"},"comments":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/emirotin/mongodb-migrations/statuses/3284563f57b87fc31a202d672772e35664a45684"}}}}
{"actor":{"display_login":"emirotin"}}