{"action":"created","comment":{"url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/comments/31668398","id":31668398,"diff_hunk":"@@ -8,46 +7,37 @@ module Strategies\n     # Usage:\n     #    use OmniAuth::Strategies::Digitalocean, 'consumerkey', 'consumersecret', :scope => 'read write', :display => 'plain'\n     #\n-    class Digitalocean < OmniAuth::Strategies::OAuth2\n+    class DigitalOcean < OmniAuth::Strategies::OAuth2\n       AUTHENTICATION_PARAMETERS = %w(display state scope)\n-      BASE_URL = \"https://cloud.digitalocean.com\"\n \n-      option :name, :digitalocean\n+      # Name of this strategy\n+      option :name, 'digitalocean'\n \n-      unless OmniAuth.config.test_mode\n-        option :client_options, {\n-          :authorize_url => \"#{BASE_URL}/v1/oauth/authorize\",\n-          :token_url => \"#{BASE_URL}/v1/oauth/token\",\n-          :site => BASE_URL\n-        }\n-      else\n-        option :client_options, {\n-          :authorize_url => \"http://localhost:3000/v1/oauth/authorize\",\n-          :token_url => \"http://localhost:3000/v1/oauth/token\",\n-          :site => \"http://localhost:3000\"\n-        }\n-      end\n+      # Client options ( see https://github.com/intridea/omniauth-oauth2 )\n+      option :client_options, {\n+        site: 'https://api.digitalocean.com',\n+        authorize_url: 'https://cloud.digitalocean.com/v1/oauth/authorize',\n+        token_url: 'https://cloud.digitalocean.com/v1/oauth/token',\n+      }\n \n       option :authorize_options, AUTHENTICATION_PARAMETERS\n \n-      uid do\n-        access_token.params['uid']\n-      end\n+      uid { raw_info['uuid'] }\n \n       info do\n-        access_token.params['info']\n-      end\n-\n-      # Hook useful for appending parameters into the auth url before sending\n-      # to provider.\n-      def request_phase\n-        super\n+        {\n+          droplet_limit: raw_info['droplet_limit'],\n+          email: raw_info['email'],\n+          uuid: raw_info['uuid'],\n+          email_verified: raw_info['email_verified'],\n+        }\n       end\n \n-      # Hook used after response with code from provider. Used to prep token\n-      # request from provider.\n-      def callback_phase\n-        super\n+      ##\n+      # Retrieves the information about the user\n+      #\n+      def raw_info\n+        @raw_info ||= access_token.get('v2/account').parsed['account']","path":"lib/omniauth/strategies/digitalocean.rb","position":70,"original_position":70,"commit_id":"1fb5929c1e82d9690dbaf6f65554a3fe77a39d22","original_commit_id":"1fb5929c1e82d9690dbaf6f65554a3fe77a39d22","user":{"login":"bobbytables","id":521627,"avatar_url":"https://avatars.githubusercontent.com/u/521627?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbytables","html_url":"https://github.com/bobbytables","followers_url":"https://api.github.com/users/bobbytables/followers","following_url":"https://api.github.com/users/bobbytables/following{/other_user}","gists_url":"https://api.github.com/users/bobbytables/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbytables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbytables/subscriptions","organizations_url":"https://api.github.com/users/bobbytables/orgs","repos_url":"https://api.github.com/users/bobbytables/repos","events_url":"https://api.github.com/users/bobbytables/events{/privacy}","received_events_url":"https://api.github.com/users/bobbytables/received_events","type":"User","site_admin":false},"body":"I can take this as a todo.","created_at":"2015-06-03T20:51:31Z","updated_at":"2015-06-03T20:51:31Z","html_url":"https://github.com/digitalocean/omniauth-digitalocean/pull/4#discussion_r31668398","pull_request_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/comments/31668398"},"html":{"href":"https://github.com/digitalocean/omniauth-digitalocean/pull/4#discussion_r31668398"},"pull_request":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4","id":25242835,"html_url":"https://github.com/digitalocean/omniauth-digitalocean/pull/4","diff_url":"https://github.com/digitalocean/omniauth-digitalocean/pull/4.diff","patch_url":"https://github.com/digitalocean/omniauth-digitalocean/pull/4.patch","issue_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/4","number":4,"state":"open","locked":false,"title":"Update OmniAuth strategy to include User information.","user":{"login":"bobbytables","id":521627,"avatar_url":"https://avatars.githubusercontent.com/u/521627?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbytables","html_url":"https://github.com/bobbytables","followers_url":"https://api.github.com/users/bobbytables/followers","following_url":"https://api.github.com/users/bobbytables/following{/other_user}","gists_url":"https://api.github.com/users/bobbytables/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbytables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbytables/subscriptions","organizations_url":"https://api.github.com/users/bobbytables/orgs","repos_url":"https://api.github.com/users/bobbytables/repos","events_url":"https://api.github.com/users/bobbytables/events{/privacy}","received_events_url":"https://api.github.com/users/bobbytables/received_events","type":"User","site_admin":false},"body":"Also general cleanup of things that were never used.","created_at":"2014-12-01T00:57:04Z","updated_at":"2015-06-03T20:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4fca450416e2517c31756bb2e8c17dd453fbde3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4/commits","review_comments_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4/comments","review_comment_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/4/comments","statuses_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/statuses/1fb5929c1e82d9690dbaf6f65554a3fe77a39d22","head":{"label":"bobbytables:include-account-info","ref":"include-account-info","sha":"1fb5929c1e82d9690dbaf6f65554a3fe77a39d22","user":{"login":"bobbytables","id":521627,"avatar_url":"https://avatars.githubusercontent.com/u/521627?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbytables","html_url":"https://github.com/bobbytables","followers_url":"https://api.github.com/users/bobbytables/followers","following_url":"https://api.github.com/users/bobbytables/following{/other_user}","gists_url":"https://api.github.com/users/bobbytables/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbytables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbytables/subscriptions","organizations_url":"https://api.github.com/users/bobbytables/orgs","repos_url":"https://api.github.com/users/bobbytables/repos","events_url":"https://api.github.com/users/bobbytables/events{/privacy}","received_events_url":"https://api.github.com/users/bobbytables/received_events","type":"User","site_admin":false},"repo":{"id":27356081,"name":"omniauth-digitalocean","full_name":"bobbytables/omniauth-digitalocean","owner":{"login":"bobbytables","id":521627,"avatar_url":"https://avatars.githubusercontent.com/u/521627?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbytables","html_url":"https://github.com/bobbytables","followers_url":"https://api.github.com/users/bobbytables/followers","following_url":"https://api.github.com/users/bobbytables/following{/other_user}","gists_url":"https://api.github.com/users/bobbytables/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbytables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbytables/subscriptions","organizations_url":"https://api.github.com/users/bobbytables/orgs","repos_url":"https://api.github.com/users/bobbytables/repos","events_url":"https://api.github.com/users/bobbytables/events{/privacy}","received_events_url":"https://api.github.com/users/bobbytables/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bobbytables/omniauth-digitalocean","description":"DigitalOcean OAuth2 Strategy for OmniAuth","fork":true,"url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean","forks_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/forks","keys_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/teams","hooks_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/hooks","issue_events_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/issues/events{/number}","events_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/events","assignees_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/assignees{/user}","branches_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/branches{/branch}","tags_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/tags","blobs_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/statuses/{sha}","languages_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/languages","stargazers_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/stargazers","contributors_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/contributors","subscribers_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/subscribers","subscription_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/subscription","commits_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/contents/{+path}","compare_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/merges","archive_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/downloads","issues_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/issues{/number}","pulls_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/pulls{/number}","milestones_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/milestones{/number}","notifications_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/labels{/name}","releases_url":"https://api.github.com/repos/bobbytables/omniauth-digitalocean/releases{/id}","created_at":"2014-12-01T00:47:47Z","updated_at":"2014-12-01T00:47:48Z","pushed_at":"2014-12-01T15:10:22Z","git_url":"git://github.com/bobbytables/omniauth-digitalocean.git","ssh_url":"git@github.com:bobbytables/omniauth-digitalocean.git","clone_url":"https://github.com/bobbytables/omniauth-digitalocean.git","svn_url":"https://github.com/bobbytables/omniauth-digitalocean","homepage":"https://github.com/digitaloceancloud/omniauth-digitalocean","size":108,"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":"digitalocean:master","ref":"master","sha":"4f1d3bb2cc58250f77d368357f3c61b1555d24ab","user":{"login":"digitalocean","id":4650108,"avatar_url":"https://avatars.githubusercontent.com/u/4650108?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalocean","html_url":"https://github.com/digitalocean","followers_url":"https://api.github.com/users/digitalocean/followers","following_url":"https://api.github.com/users/digitalocean/following{/other_user}","gists_url":"https://api.github.com/users/digitalocean/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalocean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalocean/subscriptions","organizations_url":"https://api.github.com/users/digitalocean/orgs","repos_url":"https://api.github.com/users/digitalocean/repos","events_url":"https://api.github.com/users/digitalocean/events{/privacy}","received_events_url":"https://api.github.com/users/digitalocean/received_events","type":"Organization","site_admin":false},"repo":{"id":18678939,"name":"omniauth-digitalocean","full_name":"digitalocean/omniauth-digitalocean","owner":{"login":"digitalocean","id":4650108,"avatar_url":"https://avatars.githubusercontent.com/u/4650108?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalocean","html_url":"https://github.com/digitalocean","followers_url":"https://api.github.com/users/digitalocean/followers","following_url":"https://api.github.com/users/digitalocean/following{/other_user}","gists_url":"https://api.github.com/users/digitalocean/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalocean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalocean/subscriptions","organizations_url":"https://api.github.com/users/digitalocean/orgs","repos_url":"https://api.github.com/users/digitalocean/repos","events_url":"https://api.github.com/users/digitalocean/events{/privacy}","received_events_url":"https://api.github.com/users/digitalocean/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digitalocean/omniauth-digitalocean","description":"DigitalOcean OAuth2 Strategy for OmniAuth","fork":false,"url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean","forks_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/forks","keys_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/teams","hooks_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/hooks","issue_events_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/events{/number}","events_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/events","assignees_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/assignees{/user}","branches_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/branches{/branch}","tags_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/tags","blobs_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/languages","stargazers_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/stargazers","contributors_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/contributors","subscribers_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/subscribers","subscription_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/subscription","commits_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/contents/{+path}","compare_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/merges","archive_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/downloads","issues_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues{/number}","pulls_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/labels{/name}","releases_url":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/releases{/id}","created_at":"2014-04-11T15:30:24Z","updated_at":"2015-05-30T02:42:25Z","pushed_at":"2014-07-24T16:38:30Z","git_url":"git://github.com/digitalocean/omniauth-digitalocean.git","ssh_url":"git@github.com:digitalocean/omniauth-digitalocean.git","clone_url":"https://github.com/digitalocean/omniauth-digitalocean.git","svn_url":"https://github.com/digitalocean/omniauth-digitalocean","homepage":"https://github.com/digitaloceancloud/omniauth-digitalocean","size":346,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4"},"html":{"href":"https://github.com/digitalocean/omniauth-digitalocean/pull/4"},"issue":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/4"},"comments":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/digitalocean/omniauth-digitalocean/statuses/1fb5929c1e82d9690dbaf6f65554a3fe77a39d22"}}}}