{"action":"created","comment":{"url":"https://api.github.com/repos/abonas/kubeclient/pulls/comments/30229135","id":30229135,"diff_hunk":"@@ -232,6 +232,37 @@ def test_get_all\n     assert_instance_of(Kubeclient::Namespace, result['namespace'][0])\n   end\n \n+  def test_api_bearer_token_success\n+    stub_request(:get, 'http://localhost:8080/api/v1beta3/pods')\n+      .with(headers: { Authorization: 'Bearer valid_token' })\n+      .to_return(body: open_test_json_file('pod_list_b3.json'),\n+                 status: 200)\n+\n+    client = Kubeclient::Client.new 'http://localhost:8080/api/'\n+    client.bearer_token('valid_token')\n+\n+    pods = client.get_pods\n+\n+    assert_equal('Pod', pods.kind)\n+    assert_equal(1, pods.size)\n+  end\n+\n+  def test_api_bearer_token_failure\n+    error_message = '\"/api/v1beta3/pods\" is forbidden because ' \\\n+                    'system:anonymous cannot list on pods in'\n+\n+    stub_request(:get, 'http://localhost:8080/api/v1beta3/pods')\n+      .with(headers: { Authorization: 'Bearer invalid_token' })","path":"test/test_kubeclient.rb","position":24,"original_position":24,"commit_id":"cbb580899f350b3fa8b3d4f893b0d753bd251e80","original_commit_id":"cbb580899f350b3fa8b3d4f893b0d753bd251e80","user":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"body":"Yeah it treats them the same way.","created_at":"2015-05-13T13:20:35Z","updated_at":"2015-05-13T13:20:35Z","html_url":"https://github.com/abonas/kubeclient/pull/80#discussion_r30229135","pull_request_url":"https://api.github.com/repos/abonas/kubeclient/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/comments/30229135"},"html":{"href":"https://github.com/abonas/kubeclient/pull/80#discussion_r30229135"},"pull_request":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/abonas/kubeclient/pulls/80","id":35136858,"html_url":"https://github.com/abonas/kubeclient/pull/80","diff_url":"https://github.com/abonas/kubeclient/pull/80.diff","patch_url":"https://github.com/abonas/kubeclient/pull/80.patch","issue_url":"https://api.github.com/repos/abonas/kubeclient/issues/80","number":80,"state":"open","locked":false,"title":"Fixes #79: Bearer token support","user":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-11T15:12:02Z","updated_at":"2015-05-13T13:20:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727d66096bc0848a99e9c91f6fe0f837831346c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/abonas/kubeclient/pulls/80/commits","review_comments_url":"https://api.github.com/repos/abonas/kubeclient/pulls/80/comments","review_comment_url":"https://api.github.com/repos/abonas/kubeclient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abonas/kubeclient/issues/80/comments","statuses_url":"https://api.github.com/repos/abonas/kubeclient/statuses/cbb580899f350b3fa8b3d4f893b0d753bd251e80","head":{"label":"jimmidyson:bearer_token_support","ref":"bearer_token_support","sha":"cbb580899f350b3fa8b3d4f893b0d753bd251e80","user":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"repo":{"id":35425798,"name":"kubeclient","full_name":"jimmidyson/kubeclient","owner":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimmidyson/kubeclient","description":"A Ruby client for Kubernetes REST api","fork":true,"url":"https://api.github.com/repos/jimmidyson/kubeclient","forks_url":"https://api.github.com/repos/jimmidyson/kubeclient/forks","keys_url":"https://api.github.com/repos/jimmidyson/kubeclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimmidyson/kubeclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimmidyson/kubeclient/teams","hooks_url":"https://api.github.com/repos/jimmidyson/kubeclient/hooks","issue_events_url":"https://api.github.com/repos/jimmidyson/kubeclient/issues/events{/number}","events_url":"https://api.github.com/repos/jimmidyson/kubeclient/events","assignees_url":"https://api.github.com/repos/jimmidyson/kubeclient/assignees{/user}","branches_url":"https://api.github.com/repos/jimmidyson/kubeclient/branches{/branch}","tags_url":"https://api.github.com/repos/jimmidyson/kubeclient/tags","blobs_url":"https://api.github.com/repos/jimmidyson/kubeclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimmidyson/kubeclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimmidyson/kubeclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimmidyson/kubeclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimmidyson/kubeclient/statuses/{sha}","languages_url":"https://api.github.com/repos/jimmidyson/kubeclient/languages","stargazers_url":"https://api.github.com/repos/jimmidyson/kubeclient/stargazers","contributors_url":"https://api.github.com/repos/jimmidyson/kubeclient/contributors","subscribers_url":"https://api.github.com/repos/jimmidyson/kubeclient/subscribers","subscription_url":"https://api.github.com/repos/jimmidyson/kubeclient/subscription","commits_url":"https://api.github.com/repos/jimmidyson/kubeclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimmidyson/kubeclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimmidyson/kubeclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimmidyson/kubeclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimmidyson/kubeclient/contents/{+path}","compare_url":"https://api.github.com/repos/jimmidyson/kubeclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimmidyson/kubeclient/merges","archive_url":"https://api.github.com/repos/jimmidyson/kubeclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimmidyson/kubeclient/downloads","issues_url":"https://api.github.com/repos/jimmidyson/kubeclient/issues{/number}","pulls_url":"https://api.github.com/repos/jimmidyson/kubeclient/pulls{/number}","milestones_url":"https://api.github.com/repos/jimmidyson/kubeclient/milestones{/number}","notifications_url":"https://api.github.com/repos/jimmidyson/kubeclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimmidyson/kubeclient/labels{/name}","releases_url":"https://api.github.com/repos/jimmidyson/kubeclient/releases{/id}","created_at":"2015-05-11T13:30:37Z","updated_at":"2015-05-11T13:30:37Z","pushed_at":"2015-05-13T09:17:22Z","git_url":"git://github.com/jimmidyson/kubeclient.git","ssh_url":"git@github.com:jimmidyson/kubeclient.git","clone_url":"https://github.com/jimmidyson/kubeclient.git","svn_url":"https://github.com/jimmidyson/kubeclient","homepage":"","size":1550,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"abonas:master","ref":"master","sha":"052de42ca01dc2b4e1f972752340af84c03ea281","user":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"repo":{"id":28627094,"name":"kubeclient","full_name":"abonas/kubeclient","owner":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abonas/kubeclient","description":"A Ruby client for Kubernetes REST api","fork":false,"url":"https://api.github.com/repos/abonas/kubeclient","forks_url":"https://api.github.com/repos/abonas/kubeclient/forks","keys_url":"https://api.github.com/repos/abonas/kubeclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abonas/kubeclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abonas/kubeclient/teams","hooks_url":"https://api.github.com/repos/abonas/kubeclient/hooks","issue_events_url":"https://api.github.com/repos/abonas/kubeclient/issues/events{/number}","events_url":"https://api.github.com/repos/abonas/kubeclient/events","assignees_url":"https://api.github.com/repos/abonas/kubeclient/assignees{/user}","branches_url":"https://api.github.com/repos/abonas/kubeclient/branches{/branch}","tags_url":"https://api.github.com/repos/abonas/kubeclient/tags","blobs_url":"https://api.github.com/repos/abonas/kubeclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abonas/kubeclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abonas/kubeclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/abonas/kubeclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abonas/kubeclient/statuses/{sha}","languages_url":"https://api.github.com/repos/abonas/kubeclient/languages","stargazers_url":"https://api.github.com/repos/abonas/kubeclient/stargazers","contributors_url":"https://api.github.com/repos/abonas/kubeclient/contributors","subscribers_url":"https://api.github.com/repos/abonas/kubeclient/subscribers","subscription_url":"https://api.github.com/repos/abonas/kubeclient/subscription","commits_url":"https://api.github.com/repos/abonas/kubeclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/abonas/kubeclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/abonas/kubeclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/abonas/kubeclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/abonas/kubeclient/contents/{+path}","compare_url":"https://api.github.com/repos/abonas/kubeclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abonas/kubeclient/merges","archive_url":"https://api.github.com/repos/abonas/kubeclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abonas/kubeclient/downloads","issues_url":"https://api.github.com/repos/abonas/kubeclient/issues{/number}","pulls_url":"https://api.github.com/repos/abonas/kubeclient/pulls{/number}","milestones_url":"https://api.github.com/repos/abonas/kubeclient/milestones{/number}","notifications_url":"https://api.github.com/repos/abonas/kubeclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abonas/kubeclient/labels{/name}","releases_url":"https://api.github.com/repos/abonas/kubeclient/releases{/id}","created_at":"2014-12-30T10:38:54Z","updated_at":"2015-05-11T14:58:40Z","pushed_at":"2015-05-13T09:17:22Z","git_url":"git://github.com/abonas/kubeclient.git","ssh_url":"git@github.com:abonas/kubeclient.git","clone_url":"https://github.com/abonas/kubeclient.git","svn_url":"https://github.com/abonas/kubeclient","homepage":"","size":1550,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/80"},"html":{"href":"https://github.com/abonas/kubeclient/pull/80"},"issue":{"href":"https://api.github.com/repos/abonas/kubeclient/issues/80"},"comments":{"href":"https://api.github.com/repos/abonas/kubeclient/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abonas/kubeclient/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/abonas/kubeclient/statuses/cbb580899f350b3fa8b3d4f893b0d753bd251e80"}}}}