{"action":"created","comment":{"url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/comments/83970159","pull_request_review_id":4778140,"id":83970159,"diff_hunk":"@@ -16,7 +17,17 @@ def __init__(self, path):\n         self.version = config_server.get(\"version\")\n         self.identity = IdentityManager.get()\n \n-    def request(self, params):\n+    def check_token(self):\n+        if (self.identity.refresh and self.identity.expires_at <= time.time()):","path":"mycroft/api/__init__.py","position":13,"original_position":13,"commit_id":"fd9dc1931165b456c20cc7e61fa4a8772973f470","original_commit_id":"fd9dc1931165b456c20cc7e61fa4a8772973f470","user":{"login":"jdorleans","id":1254399,"avatar_url":"https://avatars.githubusercontent.com/u/1254399?v=3","gravatar_id":"","url":"https://api.github.com/users/jdorleans","html_url":"https://github.com/jdorleans","followers_url":"https://api.github.com/users/jdorleans/followers","following_url":"https://api.github.com/users/jdorleans/following{/other_user}","gists_url":"https://api.github.com/users/jdorleans/gists{/gist_id}","starred_url":"https://api.github.com/users/jdorleans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdorleans/subscriptions","organizations_url":"https://api.github.com/users/jdorleans/orgs","repos_url":"https://api.github.com/users/jdorleans/repos","events_url":"https://api.github.com/users/jdorleans/events{/privacy}","received_events_url":"https://api.github.com/users/jdorleans/received_events","type":"User","site_admin":false},"body":"We have to load the identity to ensure all processes will have the latest state of it. This solution will be temporary until we fix the way we manage the identity and configuration.","created_at":"2016-10-18T23:10:43Z","updated_at":"2016-10-18T23:10:43Z","html_url":"https://github.com/MycroftAI/mycroft-core/pull/381#discussion_r83970159","pull_request_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381","_links":{"self":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/comments/83970159"},"html":{"href":"https://github.com/MycroftAI/mycroft-core/pull/381#discussion_r83970159"},"pull_request":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381"}}},"pull_request":{"url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381","id":89904154,"html_url":"https://github.com/MycroftAI/mycroft-core/pull/381","diff_url":"https://github.com/MycroftAI/mycroft-core/pull/381.diff","patch_url":"https://github.com/MycroftAI/mycroft-core/pull/381.patch","issue_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/381","number":381,"state":"open","locked":false,"title":"Issues 380 - Implement refresh token","user":{"login":"augustnmonteiro","id":4174705,"avatar_url":"https://avatars.githubusercontent.com/u/4174705?v=3","gravatar_id":"","url":"https://api.github.com/users/augustnmonteiro","html_url":"https://github.com/augustnmonteiro","followers_url":"https://api.github.com/users/augustnmonteiro/followers","following_url":"https://api.github.com/users/augustnmonteiro/following{/other_user}","gists_url":"https://api.github.com/users/augustnmonteiro/gists{/gist_id}","starred_url":"https://api.github.com/users/augustnmonteiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustnmonteiro/subscriptions","organizations_url":"https://api.github.com/users/augustnmonteiro/orgs","repos_url":"https://api.github.com/users/augustnmonteiro/repos","events_url":"https://api.github.com/users/augustnmonteiro/events{/privacy}","received_events_url":"https://api.github.com/users/augustnmonteiro/received_events","type":"User","site_admin":false},"body":"Issues #380 \r\n- Checking if access token is up to date before API requests\r\n- When access token is expired, update it using refresh token","created_at":"2016-10-18T21:40:36Z","updated_at":"2016-10-18T23:10:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bf2ba32300602874d2c6cc6d7fc1a388cd3f1df","assignee":{"login":"jdorleans","id":1254399,"avatar_url":"https://avatars.githubusercontent.com/u/1254399?v=3","gravatar_id":"","url":"https://api.github.com/users/jdorleans","html_url":"https://github.com/jdorleans","followers_url":"https://api.github.com/users/jdorleans/followers","following_url":"https://api.github.com/users/jdorleans/following{/other_user}","gists_url":"https://api.github.com/users/jdorleans/gists{/gist_id}","starred_url":"https://api.github.com/users/jdorleans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdorleans/subscriptions","organizations_url":"https://api.github.com/users/jdorleans/orgs","repos_url":"https://api.github.com/users/jdorleans/repos","events_url":"https://api.github.com/users/jdorleans/events{/privacy}","received_events_url":"https://api.github.com/users/jdorleans/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdorleans","id":1254399,"avatar_url":"https://avatars.githubusercontent.com/u/1254399?v=3","gravatar_id":"","url":"https://api.github.com/users/jdorleans","html_url":"https://github.com/jdorleans","followers_url":"https://api.github.com/users/jdorleans/followers","following_url":"https://api.github.com/users/jdorleans/following{/other_user}","gists_url":"https://api.github.com/users/jdorleans/gists{/gist_id}","starred_url":"https://api.github.com/users/jdorleans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdorleans/subscriptions","organizations_url":"https://api.github.com/users/jdorleans/orgs","repos_url":"https://api.github.com/users/jdorleans/repos","events_url":"https://api.github.com/users/jdorleans/events{/privacy}","received_events_url":"https://api.github.com/users/jdorleans/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381/commits","review_comments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381/comments","review_comment_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/381/comments","statuses_url":"https://api.github.com/repos/MycroftAI/mycroft-core/statuses/fd9dc1931165b456c20cc7e61fa4a8772973f470","head":{"label":"MycroftAI:feature/issues-380","ref":"feature/issues-380","sha":"fd9dc1931165b456c20cc7e61fa4a8772973f470","user":{"login":"MycroftAI","id":14171097,"avatar_url":"https://avatars.githubusercontent.com/u/14171097?v=3","gravatar_id":"","url":"https://api.github.com/users/MycroftAI","html_url":"https://github.com/MycroftAI","followers_url":"https://api.github.com/users/MycroftAI/followers","following_url":"https://api.github.com/users/MycroftAI/following{/other_user}","gists_url":"https://api.github.com/users/MycroftAI/gists{/gist_id}","starred_url":"https://api.github.com/users/MycroftAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MycroftAI/subscriptions","organizations_url":"https://api.github.com/users/MycroftAI/orgs","repos_url":"https://api.github.com/users/MycroftAI/repos","events_url":"https://api.github.com/users/MycroftAI/events{/privacy}","received_events_url":"https://api.github.com/users/MycroftAI/received_events","type":"Organization","site_admin":false},"repo":{"id":59299524,"name":"mycroft-core","full_name":"MycroftAI/mycroft-core","owner":{"login":"MycroftAI","id":14171097,"avatar_url":"https://avatars.githubusercontent.com/u/14171097?v=3","gravatar_id":"","url":"https://api.github.com/users/MycroftAI","html_url":"https://github.com/MycroftAI","followers_url":"https://api.github.com/users/MycroftAI/followers","following_url":"https://api.github.com/users/MycroftAI/following{/other_user}","gists_url":"https://api.github.com/users/MycroftAI/gists{/gist_id}","starred_url":"https://api.github.com/users/MycroftAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MycroftAI/subscriptions","organizations_url":"https://api.github.com/users/MycroftAI/orgs","repos_url":"https://api.github.com/users/MycroftAI/repos","events_url":"https://api.github.com/users/MycroftAI/events{/privacy}","received_events_url":"https://api.github.com/users/MycroftAI/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MycroftAI/mycroft-core","description":"Mycroft Core, the Mycroft Artificial Intelligence platform.","fork":false,"url":"https://api.github.com/repos/MycroftAI/mycroft-core","forks_url":"https://api.github.com/repos/MycroftAI/mycroft-core/forks","keys_url":"https://api.github.com/repos/MycroftAI/mycroft-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MycroftAI/mycroft-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MycroftAI/mycroft-core/teams","hooks_url":"https://api.github.com/repos/MycroftAI/mycroft-core/hooks","issue_events_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/events{/number}","events_url":"https://api.github.com/repos/MycroftAI/mycroft-core/events","assignees_url":"https://api.github.com/repos/MycroftAI/mycroft-core/assignees{/user}","branches_url":"https://api.github.com/repos/MycroftAI/mycroft-core/branches{/branch}","tags_url":"https://api.github.com/repos/MycroftAI/mycroft-core/tags","blobs_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MycroftAI/mycroft-core/statuses/{sha}","languages_url":"https://api.github.com/repos/MycroftAI/mycroft-core/languages","stargazers_url":"https://api.github.com/repos/MycroftAI/mycroft-core/stargazers","contributors_url":"https://api.github.com/repos/MycroftAI/mycroft-core/contributors","subscribers_url":"https://api.github.com/repos/MycroftAI/mycroft-core/subscribers","subscription_url":"https://api.github.com/repos/MycroftAI/mycroft-core/subscription","commits_url":"https://api.github.com/repos/MycroftAI/mycroft-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/MycroftAI/mycroft-core/contents/{+path}","compare_url":"https://api.github.com/repos/MycroftAI/mycroft-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MycroftAI/mycroft-core/merges","archive_url":"https://api.github.com/repos/MycroftAI/mycroft-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MycroftAI/mycroft-core/downloads","issues_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues{/number}","pulls_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls{/number}","milestones_url":"https://api.github.com/repos/MycroftAI/mycroft-core/milestones{/number}","notifications_url":"https://api.github.com/repos/MycroftAI/mycroft-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MycroftAI/mycroft-core/labels{/name}","releases_url":"https://api.github.com/repos/MycroftAI/mycroft-core/releases{/id}","deployments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/deployments","created_at":"2016-05-20T14:11:07Z","updated_at":"2016-10-18T08:06:59Z","pushed_at":"2016-10-18T22:19:23Z","git_url":"git://github.com/MycroftAI/mycroft-core.git","ssh_url":"git@github.com:MycroftAI/mycroft-core.git","clone_url":"https://github.com/MycroftAI/mycroft-core.git","svn_url":"https://github.com/MycroftAI/mycroft-core","homepage":"https://mycroft.ai","size":77002,"stargazers_count":393,"watchers_count":393,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":61,"forks":95,"open_issues":61,"watchers":393,"default_branch":"master"}},"base":{"label":"MycroftAI:dev","ref":"dev","sha":"020fa31bc1d121808251c6e9cffece78779dc6a0","user":{"login":"MycroftAI","id":14171097,"avatar_url":"https://avatars.githubusercontent.com/u/14171097?v=3","gravatar_id":"","url":"https://api.github.com/users/MycroftAI","html_url":"https://github.com/MycroftAI","followers_url":"https://api.github.com/users/MycroftAI/followers","following_url":"https://api.github.com/users/MycroftAI/following{/other_user}","gists_url":"https://api.github.com/users/MycroftAI/gists{/gist_id}","starred_url":"https://api.github.com/users/MycroftAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MycroftAI/subscriptions","organizations_url":"https://api.github.com/users/MycroftAI/orgs","repos_url":"https://api.github.com/users/MycroftAI/repos","events_url":"https://api.github.com/users/MycroftAI/events{/privacy}","received_events_url":"https://api.github.com/users/MycroftAI/received_events","type":"Organization","site_admin":false},"repo":{"id":59299524,"name":"mycroft-core","full_name":"MycroftAI/mycroft-core","owner":{"login":"MycroftAI","id":14171097,"avatar_url":"https://avatars.githubusercontent.com/u/14171097?v=3","gravatar_id":"","url":"https://api.github.com/users/MycroftAI","html_url":"https://github.com/MycroftAI","followers_url":"https://api.github.com/users/MycroftAI/followers","following_url":"https://api.github.com/users/MycroftAI/following{/other_user}","gists_url":"https://api.github.com/users/MycroftAI/gists{/gist_id}","starred_url":"https://api.github.com/users/MycroftAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MycroftAI/subscriptions","organizations_url":"https://api.github.com/users/MycroftAI/orgs","repos_url":"https://api.github.com/users/MycroftAI/repos","events_url":"https://api.github.com/users/MycroftAI/events{/privacy}","received_events_url":"https://api.github.com/users/MycroftAI/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MycroftAI/mycroft-core","description":"Mycroft Core, the Mycroft Artificial Intelligence platform.","fork":false,"url":"https://api.github.com/repos/MycroftAI/mycroft-core","forks_url":"https://api.github.com/repos/MycroftAI/mycroft-core/forks","keys_url":"https://api.github.com/repos/MycroftAI/mycroft-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MycroftAI/mycroft-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MycroftAI/mycroft-core/teams","hooks_url":"https://api.github.com/repos/MycroftAI/mycroft-core/hooks","issue_events_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/events{/number}","events_url":"https://api.github.com/repos/MycroftAI/mycroft-core/events","assignees_url":"https://api.github.com/repos/MycroftAI/mycroft-core/assignees{/user}","branches_url":"https://api.github.com/repos/MycroftAI/mycroft-core/branches{/branch}","tags_url":"https://api.github.com/repos/MycroftAI/mycroft-core/tags","blobs_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MycroftAI/mycroft-core/statuses/{sha}","languages_url":"https://api.github.com/repos/MycroftAI/mycroft-core/languages","stargazers_url":"https://api.github.com/repos/MycroftAI/mycroft-core/stargazers","contributors_url":"https://api.github.com/repos/MycroftAI/mycroft-core/contributors","subscribers_url":"https://api.github.com/repos/MycroftAI/mycroft-core/subscribers","subscription_url":"https://api.github.com/repos/MycroftAI/mycroft-core/subscription","commits_url":"https://api.github.com/repos/MycroftAI/mycroft-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/MycroftAI/mycroft-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/MycroftAI/mycroft-core/contents/{+path}","compare_url":"https://api.github.com/repos/MycroftAI/mycroft-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MycroftAI/mycroft-core/merges","archive_url":"https://api.github.com/repos/MycroftAI/mycroft-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MycroftAI/mycroft-core/downloads","issues_url":"https://api.github.com/repos/MycroftAI/mycroft-core/issues{/number}","pulls_url":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls{/number}","milestones_url":"https://api.github.com/repos/MycroftAI/mycroft-core/milestones{/number}","notifications_url":"https://api.github.com/repos/MycroftAI/mycroft-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MycroftAI/mycroft-core/labels{/name}","releases_url":"https://api.github.com/repos/MycroftAI/mycroft-core/releases{/id}","deployments_url":"https://api.github.com/repos/MycroftAI/mycroft-core/deployments","created_at":"2016-05-20T14:11:07Z","updated_at":"2016-10-18T08:06:59Z","pushed_at":"2016-10-18T22:19:23Z","git_url":"git://github.com/MycroftAI/mycroft-core.git","ssh_url":"git@github.com:MycroftAI/mycroft-core.git","clone_url":"https://github.com/MycroftAI/mycroft-core.git","svn_url":"https://github.com/MycroftAI/mycroft-core","homepage":"https://mycroft.ai","size":77002,"stargazers_count":393,"watchers_count":393,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":61,"forks":95,"open_issues":61,"watchers":393,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381"},"html":{"href":"https://github.com/MycroftAI/mycroft-core/pull/381"},"issue":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/381"},"comments":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/issues/381/comments"},"review_comments":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381/comments"},"review_comment":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/pulls/381/commits"},"statuses":{"href":"https://api.github.com/repos/MycroftAI/mycroft-core/statuses/fd9dc1931165b456c20cc7e61fa4a8772973f470"}}}}
{"actor":{"display_login":"jdorleans"}}