{"action":"created","comment":{"url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/comments/31217774","id":31217774,"diff_hunk":"@@ -0,0 +1,54 @@\n+/*\n+ * Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.\n+ * This program is made available under the terms of the BSD License.\n+ */\n+package com.gooddata.http.client;\n+\n+import org.apache.http.HttpResponse;\n+import org.apache.http.util.EntityUtils;\n+\n+import java.io.IOException;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+/**\n+ * Contains handy methods .\n+ */\n+class TokenUtils {\n+\n+    private static final String SST_ENTITY = \"userLogin\";\n+    private static final String TT_ENTITY = \"userToken\";\n+\n+    private static final String ANY_NAMED_VALUES = \"(?:\\\\s*\\\"\\\\w+\\\"\\\\s*\\\\:\\\\s*\\\"[\\\\w/]+\\\"\\\\s*,?\\\\s*)*\";\n+    private static final String TOKEN = \"\\\\s*\\\"token\\\"\\\\s*\\\\:\\\\s*\\\"(\\\\S+?)\\\"\\\\s*,?\\\\s*\";\n+\n+    private static final Pattern SST_PATTERN = Pattern.compile(\"\\\\s*\\\\{\\\\s*\\\"\" + SST_ENTITY + \"\\\"\\\\s*\\\\:\\\\s*\\\\{\" + ANY_NAMED_VALUES + TOKEN + ANY_NAMED_VALUES + \"\\\\}\\\\s*\\\\}\\\\s*\");","path":"src/main/java/com/gooddata/http/client/TokenUtils.java","position":25,"original_position":25,"commit_id":"ca5627233244fb5cca44da8e8063b49de89cb99f","original_commit_id":"ca5627233244fb5cca44da8e8063b49de89cb99f","user":{"login":"To-da","id":6453372,"avatar_url":"https://avatars.githubusercontent.com/u/6453372?v=3","gravatar_id":"","url":"https://api.github.com/users/To-da","html_url":"https://github.com/To-da","followers_url":"https://api.github.com/users/To-da/followers","following_url":"https://api.github.com/users/To-da/following{/other_user}","gists_url":"https://api.github.com/users/To-da/gists{/gist_id}","starred_url":"https://api.github.com/users/To-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/To-da/subscriptions","organizations_url":"https://api.github.com/users/To-da/orgs","repos_url":"https://api.github.com/users/To-da/repos","events_url":"https://api.github.com/users/To-da/events{/privacy}","received_events_url":"https://api.github.com/users/To-da/received_events","type":"User","site_admin":false},"body":"'}' do not need to be escaped","created_at":"2015-05-28T09:42:41Z","updated_at":"2015-05-28T09:42:41Z","html_url":"https://github.com/gooddata/gooddata-http-client/pull/16#discussion_r31217774","pull_request_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/comments/31217774"},"html":{"href":"https://github.com/gooddata/gooddata-http-client/pull/16#discussion_r31217774"},"pull_request":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16","id":24576838,"html_url":"https://github.com/gooddata/gooddata-http-client/pull/16","diff_url":"https://github.com/gooddata/gooddata-http-client/pull/16.diff","patch_url":"https://github.com/gooddata/gooddata-http-client/pull/16.patch","issue_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/16","number":16,"state":"open","locked":false,"title":"FEATURE: ATP-1799 Completely switch to header based auth","user":{"login":"martiner","id":430123,"avatar_url":"https://avatars.githubusercontent.com/u/430123?v=3","gravatar_id":"","url":"https://api.github.com/users/martiner","html_url":"https://github.com/martiner","followers_url":"https://api.github.com/users/martiner/followers","following_url":"https://api.github.com/users/martiner/following{/other_user}","gists_url":"https://api.github.com/users/martiner/gists{/gist_id}","starred_url":"https://api.github.com/users/martiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martiner/subscriptions","organizations_url":"https://api.github.com/users/martiner/orgs","repos_url":"https://api.github.com/users/martiner/repos","events_url":"https://api.github.com/users/martiner/events{/privacy}","received_events_url":"https://api.github.com/users/martiner/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-17T23:32:54Z","updated_at":"2015-05-28T09:42:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97f7af16ccdb5c8c71d37ca0589b41d746854194","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16/commits","review_comments_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16/comments","review_comment_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/16/comments","statuses_url":"https://api.github.com/repos/gooddata/gooddata-http-client/statuses/ca5627233244fb5cca44da8e8063b49de89cb99f","head":{"label":"gooddata:mcl-level","ref":"mcl-level","sha":"ca5627233244fb5cca44da8e8063b49de89cb99f","user":{"login":"gooddata","id":291394,"avatar_url":"https://avatars.githubusercontent.com/u/291394?v=3","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"repo":{"id":10687744,"name":"gooddata-http-client","full_name":"gooddata/gooddata-http-client","owner":{"login":"gooddata","id":291394,"avatar_url":"https://avatars.githubusercontent.com/u/291394?v=3","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gooddata/gooddata-http-client","description":"","fork":false,"url":"https://api.github.com/repos/gooddata/gooddata-http-client","forks_url":"https://api.github.com/repos/gooddata/gooddata-http-client/forks","keys_url":"https://api.github.com/repos/gooddata/gooddata-http-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gooddata/gooddata-http-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gooddata/gooddata-http-client/teams","hooks_url":"https://api.github.com/repos/gooddata/gooddata-http-client/hooks","issue_events_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/events{/number}","events_url":"https://api.github.com/repos/gooddata/gooddata-http-client/events","assignees_url":"https://api.github.com/repos/gooddata/gooddata-http-client/assignees{/user}","branches_url":"https://api.github.com/repos/gooddata/gooddata-http-client/branches{/branch}","tags_url":"https://api.github.com/repos/gooddata/gooddata-http-client/tags","blobs_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gooddata/gooddata-http-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gooddata/gooddata-http-client/languages","stargazers_url":"https://api.github.com/repos/gooddata/gooddata-http-client/stargazers","contributors_url":"https://api.github.com/repos/gooddata/gooddata-http-client/contributors","subscribers_url":"https://api.github.com/repos/gooddata/gooddata-http-client/subscribers","subscription_url":"https://api.github.com/repos/gooddata/gooddata-http-client/subscription","commits_url":"https://api.github.com/repos/gooddata/gooddata-http-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gooddata/gooddata-http-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gooddata/gooddata-http-client/contents/{+path}","compare_url":"https://api.github.com/repos/gooddata/gooddata-http-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gooddata/gooddata-http-client/merges","archive_url":"https://api.github.com/repos/gooddata/gooddata-http-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gooddata/gooddata-http-client/downloads","issues_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues{/number}","pulls_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gooddata/gooddata-http-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gooddata/gooddata-http-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gooddata/gooddata-http-client/labels{/name}","releases_url":"https://api.github.com/repos/gooddata/gooddata-http-client/releases{/id}","created_at":"2013-06-14T11:41:31Z","updated_at":"2015-02-17T13:03:10Z","pushed_at":"2015-05-27T13:28:46Z","git_url":"git://github.com/gooddata/gooddata-http-client.git","ssh_url":"git@github.com:gooddata/gooddata-http-client.git","clone_url":"https://github.com/gooddata/gooddata-http-client.git","svn_url":"https://github.com/gooddata/gooddata-http-client","homepage":null,"size":408,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"gooddata:master","ref":"master","sha":"eeed8b36b1ea6f847dd81650a413763baf73e180","user":{"login":"gooddata","id":291394,"avatar_url":"https://avatars.githubusercontent.com/u/291394?v=3","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"repo":{"id":10687744,"name":"gooddata-http-client","full_name":"gooddata/gooddata-http-client","owner":{"login":"gooddata","id":291394,"avatar_url":"https://avatars.githubusercontent.com/u/291394?v=3","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gooddata/gooddata-http-client","description":"","fork":false,"url":"https://api.github.com/repos/gooddata/gooddata-http-client","forks_url":"https://api.github.com/repos/gooddata/gooddata-http-client/forks","keys_url":"https://api.github.com/repos/gooddata/gooddata-http-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gooddata/gooddata-http-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gooddata/gooddata-http-client/teams","hooks_url":"https://api.github.com/repos/gooddata/gooddata-http-client/hooks","issue_events_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/events{/number}","events_url":"https://api.github.com/repos/gooddata/gooddata-http-client/events","assignees_url":"https://api.github.com/repos/gooddata/gooddata-http-client/assignees{/user}","branches_url":"https://api.github.com/repos/gooddata/gooddata-http-client/branches{/branch}","tags_url":"https://api.github.com/repos/gooddata/gooddata-http-client/tags","blobs_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gooddata/gooddata-http-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gooddata/gooddata-http-client/languages","stargazers_url":"https://api.github.com/repos/gooddata/gooddata-http-client/stargazers","contributors_url":"https://api.github.com/repos/gooddata/gooddata-http-client/contributors","subscribers_url":"https://api.github.com/repos/gooddata/gooddata-http-client/subscribers","subscription_url":"https://api.github.com/repos/gooddata/gooddata-http-client/subscription","commits_url":"https://api.github.com/repos/gooddata/gooddata-http-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gooddata/gooddata-http-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gooddata/gooddata-http-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gooddata/gooddata-http-client/contents/{+path}","compare_url":"https://api.github.com/repos/gooddata/gooddata-http-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gooddata/gooddata-http-client/merges","archive_url":"https://api.github.com/repos/gooddata/gooddata-http-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gooddata/gooddata-http-client/downloads","issues_url":"https://api.github.com/repos/gooddata/gooddata-http-client/issues{/number}","pulls_url":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gooddata/gooddata-http-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gooddata/gooddata-http-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gooddata/gooddata-http-client/labels{/name}","releases_url":"https://api.github.com/repos/gooddata/gooddata-http-client/releases{/id}","created_at":"2013-06-14T11:41:31Z","updated_at":"2015-02-17T13:03:10Z","pushed_at":"2015-05-27T13:28:46Z","git_url":"git://github.com/gooddata/gooddata-http-client.git","ssh_url":"git@github.com:gooddata/gooddata-http-client.git","clone_url":"https://github.com/gooddata/gooddata-http-client.git","svn_url":"https://github.com/gooddata/gooddata-http-client","homepage":null,"size":408,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16"},"html":{"href":"https://github.com/gooddata/gooddata-http-client/pull/16"},"issue":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/16"},"comments":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/gooddata/gooddata-http-client/statuses/ca5627233244fb5cca44da8e8063b49de89cb99f"}}}}