{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/comments/69316124","id":69316124,"diff_hunk":"@@ -35,12 +46,34 @@ public AuthorizationContext(String token, String expires, IUser user, String sch\n \t\tthis.scheme = scheme;\n \t}\n \t\n+\tpublic AuthorizationContext clone() {\n+\t\tAuthorizationContext context = new AuthorizationContext(this.token, this.expires, this.user, this.scheme);\n+\t\tcontext.setUserName(this.userName);\n+\t\tcontext.setPassword(this.password);\n+\t\tcontext.setClient(this.client);\n+\t\treturn context;\n+\t}\n+\t\n+\tpublic void setClient(IClient client){\n+\t\tthis.client = client;\n+\t}\n+\t\n \t@Override\n \tpublic boolean isAuthorized() {\n+\t\tif(user == null) {\n+\t\t\tsynchronized (this) {\n+\t\t\t\tuser = client.get(ResourceKind.USER, \"~\", \"\");","path":"src/main/java/com/openshift/internal/restclient/authorization/AuthorizationContext.java","position":52,"original_position":52,"commit_id":"60b0c1b82d98977790104737aa1e584cadfd89e7","original_commit_id":"60b0c1b82d98977790104737aa1e584cadfd89e7","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"That is not strictly true as before we assumed you were authorized if your token was not null which is not necessarily correct; it just means you have a token.  In JBT we had logic that more or less did what was doing here so you were making a remote call anyway.  Since we simplified how the auth logic is consumed, I believe this is a reasonable trade off. At some point or another, remote calls are going to need to be made in the authorization process.","created_at":"2016-07-01T15:25:05Z","updated_at":"2016-07-01T15:25:05Z","html_url":"https://github.com/openshift/openshift-restclient-java/pull/179#discussion_r69316124","pull_request_url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/comments/69316124"},"html":{"href":"https://github.com/openshift/openshift-restclient-java/pull/179#discussion_r69316124"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179","id":75015532,"html_url":"https://github.com/openshift/openshift-restclient-java/pull/179","diff_url":"https://github.com/openshift/openshift-restclient-java/pull/179.diff","patch_url":"https://github.com/openshift/openshift-restclient-java/pull/179.patch","issue_url":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/179","number":179,"state":"open","locked":false,"title":"Impl OkHttpClient. Refactor authorization context","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"This PR provides:\r\n\r\n* Squashing multiple underlying httpclient dependencies to single library of OkHttp\r\n* Removes authorization strategies to rely on OkHttp and challange handlers (similiar to oc login)\r\n* Redefines what the authorization context api of IClient\r\n* Fixes or add various integration tests.","created_at":"2016-06-23T19:47:17Z","updated_at":"2016-07-01T15:25:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"526dca022d2197ac4278d5977755d78e44cc5719","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/179/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-restclient-java/statuses/60b0c1b82d98977790104737aa1e584cadfd89e7","head":{"label":"jcantrill:okhttp_spike","ref":"okhttp_spike","sha":"60b0c1b82d98977790104737aa1e584cadfd89e7","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"repo":{"id":33316652,"name":"openshift-restclient-java","full_name":"jcantrill/openshift-restclient-java","owner":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcantrill/openshift-restclient-java","description":"","fork":true,"url":"https://api.github.com/repos/jcantrill/openshift-restclient-java","forks_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/forks","keys_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/teams","hooks_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/hooks","issue_events_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/issues/events{/number}","events_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/events","assignees_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/assignees{/user}","branches_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/branches{/branch}","tags_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/tags","blobs_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/statuses/{sha}","languages_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/languages","stargazers_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/stargazers","contributors_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/contributors","subscribers_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/subscribers","subscription_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/subscription","commits_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/contents/{+path}","compare_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/merges","archive_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/downloads","issues_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/issues{/number}","pulls_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/pulls{/number}","milestones_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/milestones{/number}","notifications_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/labels{/name}","releases_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/releases{/id}","deployments_url":"https://api.github.com/repos/jcantrill/openshift-restclient-java/deployments","created_at":"2015-04-02T15:32:22Z","updated_at":"2015-04-29T21:28:17Z","pushed_at":"2016-06-30T14:33:08Z","git_url":"git://github.com/jcantrill/openshift-restclient-java.git","ssh_url":"git@github.com:jcantrill/openshift-restclient-java.git","clone_url":"https://github.com/jcantrill/openshift-restclient-java.git","svn_url":"https://github.com/jcantrill/openshift-restclient-java","homepage":"","size":3300,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openshift:master","ref":"master","sha":"d5b5076ee7c7b487863d4700dc1da10d012af0ea","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":33315367,"name":"openshift-restclient-java","full_name":"openshift/openshift-restclient-java","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/openshift-restclient-java","description":"","fork":false,"url":"https://api.github.com/repos/openshift/openshift-restclient-java","forks_url":"https://api.github.com/repos/openshift/openshift-restclient-java/forks","keys_url":"https://api.github.com/repos/openshift/openshift-restclient-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-restclient-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-restclient-java/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-restclient-java/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-restclient-java/events","assignees_url":"https://api.github.com/repos/openshift/openshift-restclient-java/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-restclient-java/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-restclient-java/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-restclient-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-restclient-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-restclient-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-restclient-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-restclient-java/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-restclient-java/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-restclient-java/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-restclient-java/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-restclient-java/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-restclient-java/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-restclient-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-restclient-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-restclient-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-restclient-java/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-restclient-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-restclient-java/merges","archive_url":"https://api.github.com/repos/openshift/openshift-restclient-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-restclient-java/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-restclient-java/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-restclient-java/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-restclient-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-restclient-java/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-restclient-java/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/openshift-restclient-java/deployments","created_at":"2015-04-02T15:09:56Z","updated_at":"2016-06-28T10:15:17Z","pushed_at":"2016-06-30T14:33:09Z","git_url":"git://github.com/openshift/openshift-restclient-java.git","ssh_url":"git@github.com:openshift/openshift-restclient-java.git","clone_url":"https://github.com/openshift/openshift-restclient-java.git","svn_url":"https://github.com/openshift/openshift-restclient-java","homepage":"","size":3347,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":8,"forks":46,"open_issues":8,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179"},"html":{"href":"https://github.com/openshift/openshift-restclient-java/pull/179"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/179"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-restclient-java/statuses/60b0c1b82d98977790104737aa1e584cadfd89e7"}}}}
{"actor":{"display_login":"jcantrill"}}