{"action":"opened","number":21,"pull_request":{"url":"https://api.github.com/repos/socrata/socrata-http/pulls/21","id":31183490,"html_url":"https://github.com/socrata/socrata-http/pull/21","diff_url":"https://github.com/socrata/socrata-http/pull/21.diff","patch_url":"https://github.com/socrata/socrata-http/pull/21.patch","issue_url":"https://api.github.com/repos/socrata/socrata-http/issues/21","number":21,"state":"open","locked":false,"title":"Add basic auth in HttpClientHttpClient","user":{"login":"splittingfield","id":867682,"avatar_url":"https://avatars.githubusercontent.com/u/867682?v=3","gravatar_id":"","url":"https://api.github.com/users/splittingfield","html_url":"https://github.com/splittingfield","followers_url":"https://api.github.com/users/splittingfield/followers","following_url":"https://api.github.com/users/splittingfield/following{/other_user}","gists_url":"https://api.github.com/users/splittingfield/gists{/gist_id}","starred_url":"https://api.github.com/users/splittingfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splittingfield/subscriptions","organizations_url":"https://api.github.com/users/splittingfield/orgs","repos_url":"https://api.github.com/users/splittingfield/repos","events_url":"https://api.github.com/users/splittingfield/events{/privacy}","received_events_url":"https://api.github.com/users/splittingfield/received_events","type":"User","site_admin":false},"body":"In many backend services, our http client is tied to precisely ony\r\nAuthScope and we wish to have BasicAuth against that host.  We could\r\nset the header's and such on every request at the calling site, but I\r\nthink it would be cleaner to have this be set on the Apache HttpClient.\r\n\r\nThis commits creates an HttpRequestInterceptor that is added to the\r\nHttpClient that uses the provided credentials provider and\r\nwell does basic auth.\r\n\r\n\r\nThis is a optimistic PR, as I am \r\n 1. Not certain if this is even a good idea\r\n 2. Not 100% confident that I did this correctly\r\n\r\n\r\nI have now used this code to issue authenticated requests to an internal BasicAuth Service and it worked wonderfully, but I could easily be missing something here. Currently, you have to define your authScope BEFORE your credentialsProvider in the `HttpClientHttpClient.Options` Builder, as well you just have to.\r\n\r\nIf this is a dumb idea, please do not hesitate to let me know or help me figure out a better idea.  This is what happens on Friday night at 1AM when I am frustrated with computers.","created_at":"2015-03-14T13:33:44Z","updated_at":"2015-03-14T13:33:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/socrata/socrata-http/pulls/21/commits","review_comments_url":"https://api.github.com/repos/socrata/socrata-http/pulls/21/comments","review_comment_url":"https://api.github.com/repos/socrata/socrata-http/pulls/comments{/number}","comments_url":"https://api.github.com/repos/socrata/socrata-http/issues/21/comments","statuses_url":"https://api.github.com/repos/socrata/socrata-http/statuses/81c741bb027a17f46d85f5f6b9aa9e42c3bd244d","head":{"label":"socrata:add_basic_auth","ref":"add_basic_auth","sha":"81c741bb027a17f46d85f5f6b9aa9e42c3bd244d","user":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"repo":{"id":9105718,"name":"socrata-http","full_name":"socrata/socrata-http","owner":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/socrata/socrata-http","description":"Toolkits for HTTP client access and building rack-style servers","fork":false,"url":"https://api.github.com/repos/socrata/socrata-http","forks_url":"https://api.github.com/repos/socrata/socrata-http/forks","keys_url":"https://api.github.com/repos/socrata/socrata-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socrata/socrata-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socrata/socrata-http/teams","hooks_url":"https://api.github.com/repos/socrata/socrata-http/hooks","issue_events_url":"https://api.github.com/repos/socrata/socrata-http/issues/events{/number}","events_url":"https://api.github.com/repos/socrata/socrata-http/events","assignees_url":"https://api.github.com/repos/socrata/socrata-http/assignees{/user}","branches_url":"https://api.github.com/repos/socrata/socrata-http/branches{/branch}","tags_url":"https://api.github.com/repos/socrata/socrata-http/tags","blobs_url":"https://api.github.com/repos/socrata/socrata-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socrata/socrata-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socrata/socrata-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/socrata/socrata-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socrata/socrata-http/statuses/{sha}","languages_url":"https://api.github.com/repos/socrata/socrata-http/languages","stargazers_url":"https://api.github.com/repos/socrata/socrata-http/stargazers","contributors_url":"https://api.github.com/repos/socrata/socrata-http/contributors","subscribers_url":"https://api.github.com/repos/socrata/socrata-http/subscribers","subscription_url":"https://api.github.com/repos/socrata/socrata-http/subscription","commits_url":"https://api.github.com/repos/socrata/socrata-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/socrata/socrata-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/socrata/socrata-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/socrata/socrata-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/socrata/socrata-http/contents/{+path}","compare_url":"https://api.github.com/repos/socrata/socrata-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socrata/socrata-http/merges","archive_url":"https://api.github.com/repos/socrata/socrata-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socrata/socrata-http/downloads","issues_url":"https://api.github.com/repos/socrata/socrata-http/issues{/number}","pulls_url":"https://api.github.com/repos/socrata/socrata-http/pulls{/number}","milestones_url":"https://api.github.com/repos/socrata/socrata-http/milestones{/number}","notifications_url":"https://api.github.com/repos/socrata/socrata-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socrata/socrata-http/labels{/name}","releases_url":"https://api.github.com/repos/socrata/socrata-http/releases{/id}","created_at":"2013-03-29T20:09:48Z","updated_at":"2015-03-05T21:29:47Z","pushed_at":"2015-03-14T13:29:43Z","git_url":"git://github.com/socrata/socrata-http.git","ssh_url":"git@github.com:socrata/socrata-http.git","clone_url":"https://github.com/socrata/socrata-http.git","svn_url":"https://github.com/socrata/socrata-http","homepage":"","size":1207,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"socrata:master","ref":"master","sha":"a0f71b2cc575ee95a4da307c574d725e939535bf","user":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"repo":{"id":9105718,"name":"socrata-http","full_name":"socrata/socrata-http","owner":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/socrata/socrata-http","description":"Toolkits for HTTP client access and building rack-style servers","fork":false,"url":"https://api.github.com/repos/socrata/socrata-http","forks_url":"https://api.github.com/repos/socrata/socrata-http/forks","keys_url":"https://api.github.com/repos/socrata/socrata-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socrata/socrata-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socrata/socrata-http/teams","hooks_url":"https://api.github.com/repos/socrata/socrata-http/hooks","issue_events_url":"https://api.github.com/repos/socrata/socrata-http/issues/events{/number}","events_url":"https://api.github.com/repos/socrata/socrata-http/events","assignees_url":"https://api.github.com/repos/socrata/socrata-http/assignees{/user}","branches_url":"https://api.github.com/repos/socrata/socrata-http/branches{/branch}","tags_url":"https://api.github.com/repos/socrata/socrata-http/tags","blobs_url":"https://api.github.com/repos/socrata/socrata-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socrata/socrata-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socrata/socrata-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/socrata/socrata-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socrata/socrata-http/statuses/{sha}","languages_url":"https://api.github.com/repos/socrata/socrata-http/languages","stargazers_url":"https://api.github.com/repos/socrata/socrata-http/stargazers","contributors_url":"https://api.github.com/repos/socrata/socrata-http/contributors","subscribers_url":"https://api.github.com/repos/socrata/socrata-http/subscribers","subscription_url":"https://api.github.com/repos/socrata/socrata-http/subscription","commits_url":"https://api.github.com/repos/socrata/socrata-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/socrata/socrata-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/socrata/socrata-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/socrata/socrata-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/socrata/socrata-http/contents/{+path}","compare_url":"https://api.github.com/repos/socrata/socrata-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socrata/socrata-http/merges","archive_url":"https://api.github.com/repos/socrata/socrata-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socrata/socrata-http/downloads","issues_url":"https://api.github.com/repos/socrata/socrata-http/issues{/number}","pulls_url":"https://api.github.com/repos/socrata/socrata-http/pulls{/number}","milestones_url":"https://api.github.com/repos/socrata/socrata-http/milestones{/number}","notifications_url":"https://api.github.com/repos/socrata/socrata-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socrata/socrata-http/labels{/name}","releases_url":"https://api.github.com/repos/socrata/socrata-http/releases{/id}","created_at":"2013-03-29T20:09:48Z","updated_at":"2015-03-05T21:29:47Z","pushed_at":"2015-03-14T13:29:43Z","git_url":"git://github.com/socrata/socrata-http.git","ssh_url":"git@github.com:socrata/socrata-http.git","clone_url":"https://github.com/socrata/socrata-http.git","svn_url":"https://github.com/socrata/socrata-http","homepage":"","size":1207,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/socrata/socrata-http/pulls/21"},"html":{"href":"https://github.com/socrata/socrata-http/pull/21"},"issue":{"href":"https://api.github.com/repos/socrata/socrata-http/issues/21"},"comments":{"href":"https://api.github.com/repos/socrata/socrata-http/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/socrata/socrata-http/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/socrata/socrata-http/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/socrata/socrata-http/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/socrata/socrata-http/statuses/81c741bb027a17f46d85f5f6b9aa9e42c3bd244d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":62,"deletions":2,"changed_files":1}}