omniauth-uber 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b7b765857dcbd5da7cd1d928a8813f114ca9c7e
4
- data.tar.gz: 3f66c6558523ebd777e2008cf484d9dba81dfa37
3
+ metadata.gz: 2115b8f7ca794091028aea53c1a0eb2f212a5107
4
+ data.tar.gz: febdd4eee0a60f5f7e9b64f47eaf3f6c00dc6bf1
5
5
  SHA512:
6
- metadata.gz: 8de2b3989e02a36119232256131c4f23ab002bd50f75aff397114a2243f4854241f272553eac59818ce3177ff568203e29d2fbf32453d197b93ea76806b1446f
7
- data.tar.gz: 715c1e057771a09ea2cb4a944189549d669c43fe548ac90818bb7d7aeb8d8a339d90f234ea30f8428a097ab3c7a8a9a8232504ab5b55562e17e3892f9161e88f
6
+ metadata.gz: 8e94401be58e4ebe82bcb493c043ae968bf882b2a96dbddb53de1cb2f416ff5bc8a617e8d7780cb755a1cfec9c0e4195c261154cd45da8a9fe5bb0ff709b69e2
7
+ data.tar.gz: bea9bf156f8b5d503cec1985de66501af6b4a8536c83a23e51619966a888bf600578a2ee8c5bffcfccc5bf6ec9c4698cfbb9de2a316d0f28f99abf88528b8fe0
@@ -0,0 +1,58 @@
1
+ # see https://github.com/bbatsov/rubocop/blob/master/config/default.yml
2
+ # for default configuration
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.4
6
+ DisplayCopNames: true
7
+ Exclude:
8
+ - 'db/schema.rb'
9
+ - 'bin/*'
10
+ - 'vendor/**/*'
11
+
12
+ Rails:
13
+ Enabled: true
14
+
15
+ Documentation:
16
+ Enabled: false
17
+
18
+ Metrics/LineLength:
19
+ Max: 125
20
+ Exclude:
21
+ - 'db/migrate/*'
22
+ - 'config/initializers/devise.rb'
23
+
24
+ Metrics/MethodLength:
25
+ CountComments: false
26
+ Max: 10
27
+ Exclude:
28
+ - 'db/migrate/*'
29
+
30
+ Metrics/ModuleLength:
31
+ CountComments: false
32
+ Max: 100
33
+
34
+ Metrics/AbcSize:
35
+ # The ABC size is a calculated magnitude, so this number can be a Fixnum or a Float.
36
+ # http://c2.com/cgi/wiki?AbcMetric
37
+ Max: 15
38
+
39
+ Metrics/CyclomaticComplexity:
40
+ # http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/CyclomaticComplexity
41
+ Max: 6
42
+
43
+ Metrics/PerceivedComplexity:
44
+ # http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/PerceivedComplexity
45
+ Max: 7
46
+
47
+ Metrics/ClassLength:
48
+ CountComments: false
49
+ Max: 100
50
+
51
+ Style/MultilineMethodCallIndentation:
52
+ EnforcedStyle: indented
53
+
54
+ Style/FrozenStringLiteralComment:
55
+ Enabled: false
56
+
57
+ Style/ClassAndModuleChildren:
58
+ Enabled: false
@@ -1,84 +1,9 @@
1
- AllCops:
2
- Include:
3
- - 'Gemfile'
4
- - 'Rakefile'
5
- - 'omniauth-venmo.gemspec'
6
- Exclude:
7
- - 'lib/omniauth-venmo.rb'
8
-
9
- # Avoid long parameter lists
10
- ParameterLists:
11
- Max: 4
12
- CountKeywordArgs: true
13
-
14
- MethodLength:
15
- CountComments: false
16
- Max: 14
17
-
18
- # Avoid more than `Max` levels of nesting.
19
- BlockNesting:
20
- Max: 2
21
-
22
- # Align with the style guide.
23
- CollectionMethods:
24
- PreferredMethods:
25
- map: 'collect'
26
- reduce: 'inject'
27
- find: 'detect'
28
- find_all: 'select'
29
-
30
- # Limit line length
31
- LineLength:
32
- Enabled: false
33
-
34
- # Disable documentation checking until a class needs to be documented once
35
- Documentation:
36
- Enabled: false
37
-
38
- # Enforce Ruby 1.8-compatible hash syntax
39
- HashSyntax:
40
- EnforcedStyle: hash_rockets
41
-
42
- # No spaces inside hash literals
43
- SpaceInsideHashLiteralBraces:
44
- EnforcedStyle: no_space
45
-
46
- # Allow dots at the end of lines
47
- DotPosition:
48
- Enabled: false
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/tmilewski/rubocop-defaults/master/rubocop.yml
49
3
 
50
- # Don't require magic comment at the top of every file
51
- Encoding:
52
- Enabled: false
53
-
54
- # Enforce outdenting of access modifiers (i.e. public, private, protected)
55
- AccessModifierIndentation:
56
- EnforcedStyle: outdent
57
-
58
- EmptyLinesAroundAccessModifier:
59
- Enabled: true
60
-
61
- # Align ends correctly
62
- EndAlignment:
63
- AlignWith: variable
64
-
65
- # Indentation of when/else
66
- CaseIndentation:
67
- IndentWhenRelativeTo: end
68
- IndentOneStep: false
69
-
70
- Lambda:
71
- Enabled: false
72
-
73
- HandleExceptions:
74
- Enabled: false
75
-
76
- RaiseArgs:
77
- EnforcedStyle: compact
78
-
79
- TrailingComma:
4
+ Style/FileName:
80
5
  Enabled: false
81
6
 
82
- Style/FileName:
7
+ AllCops:
83
8
  Exclude:
84
- - 'lib/omniauth-uber.rb'
9
+ - 'tmp/**/*'
@@ -1,17 +1,17 @@
1
1
  bundler_args: --without development
2
- gemfile:
3
- - Gemfile
2
+ before_install: gem update bundler
3
+ cache: bundler
4
+ env:
5
+ global:
6
+ - JRUBY_OPTS="$JRUBY_OPTS --debug"
4
7
  language: ruby
5
8
  rvm:
6
- - 1.9.2
7
- - 1.9.3
8
- - 2.0.0
9
- - 2.1.0
10
- - rbx-2
9
+ - 2.2.6
10
+ - 2.3.3
11
+ - 2.4.1
11
12
  - ruby-head
12
- - jruby-19mode
13
- - jruby-head
14
13
  matrix:
15
14
  allow_failures:
16
- - rvm: jruby-head
17
15
  - rvm: ruby-head
16
+ fast_finish: true
17
+ sudo: false
data/Gemfile CHANGED
@@ -3,14 +3,14 @@ source 'https://rubygems.org'
3
3
  gem 'rake'
4
4
 
5
5
  group :development do
6
- gem 'rubocop'
6
+ gem 'rubocop', '>= 0.48.1'
7
7
  end
8
8
 
9
9
  group :test do
10
- gem 'coveralls', :require => false
10
+ gem 'coveralls', require: false
11
11
  gem 'rack-test'
12
- gem 'rspec', '~> 2.7'
13
- gem 'simplecov', :require => false
12
+ gem 'rspec', '~> 3.6.0'
13
+ gem 'simplecov', require: false
14
14
  end
15
15
 
16
16
  gemspec
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  omniauth-uber
2
2
  ==============
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/omniauth-uber.png)](http://badge.fury.io/rb/omniauth-uber)
5
- [![Build Status](https://travis-ci.org/tmilewski/omniauth-uber.png?branch=master)](https://travis-ci.org/tmilewski/omniauth-uber)
4
+ [![Gem Version](https://badge.fury.io/rb/omniauth-uber.svg)](http://badge.fury.io/rb/omniauth-uber)
5
+ [![Build Status](https://travis-ci.org/omniauth/omniauth-uber.svg?branch=master)](https://travis-ci.org/omniauth/omniauth-uber)
6
6
 
7
7
  Uber OAuth2 Strategy for OmniAuth 1.x and supports the OAuth 2.0 server-side flow.
8
8
 
@@ -21,7 +21,7 @@ Then `bundle install`.
21
21
 
22
22
  ## Usage
23
23
 
24
- `OmniAuth::Strategies::Uber` is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.
24
+ `OmniAuth::Strategies::Uber` is simply Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.
25
25
 
26
26
  Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
27
27
 
@@ -35,14 +35,20 @@ end
35
35
 
36
36
  Currently, there is only one configuration option that needs to be set:
37
37
 
38
- * `scope`: A comma-separated list of permissions you want to request from the user. The available permissions are as follows: `access_email`, `access_phone`, `access_balance`, `access_feed`, `access_profile`, `access_friends`, and `make_payments`. Default: `access_profile`
38
+ * `scope`: A comma-separated list of permissions you want to request from the user. The available permissions are as follows: `profile`, `history`. Default: `profile`
39
39
 
40
40
  ```ruby
41
41
  Rails.application.config.middleware.use OmniAuth::Builder do
42
42
  provider :uber, ENV['UBER_CLIENT_ID'], ENV['UBER_CLIENT_SECRET'], :scope => 'profile,history'
43
43
  end
44
+
44
45
  ```
45
46
 
47
+ ## Scope Details
48
+
49
+ * `profile`: Access the basic profile information on a user's Uber account including their first name, email address, and profile picture.
50
+ * `history`: Pull trip data including the locations, times, and product type of a user's historical pickups and drop-offs.
51
+
46
52
  ## Auth Hash
47
53
 
48
54
  Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
@@ -50,20 +56,33 @@ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
50
56
  ```ruby
51
57
  {
52
58
  :provider => 'uber',
53
- :uid => nil,
54
- :info => {}, # Being worked on
59
+ :uid => 'xxxxxx-yyyyy-zzzz-aaaa-bbbbbbbbbb',
60
+ :info => {
61
+ :email => 'foo@bar.com',
62
+ :first_name => 'Tom',
63
+ :last_name => 'Milewski',
64
+ :picture => 'https://d1w2poirtb3as9.cloudfront.net/default.jpeg',
65
+ :promo_code => 'xxxxx',
66
+ },
55
67
  :credentials => {
56
68
  :token => 'ABCDEF...',
69
+ :refresh_token => 'ABCDEF...',
57
70
  :expires => true
58
71
  },
59
- :extra => {} # Being worked on
72
+ :extra => {
73
+ :email => 'foo@bar.com',
74
+ :first_name => 'Tom',
75
+ :last_name => 'Milewski',
76
+ :picture => 'https://d1w2poirtb3as9.cloudfront.net/default.jpeg',
77
+ :promo_code => 'xxxxx',
78
+ :uuid => 'xxxxxx-yyyyy-zzzz-aaaa-bbbbbbbbbb'
60
79
  }
61
80
  }
62
81
  ```
63
82
 
64
83
  ## Supported Ruby Versions
65
- `omniauth-uber` is tested under 1.8.7, 1.9.2, 1.9.3, 2.0.0, JRuby (1.8 mode), and Rubinius
66
- (1.8 and 1.9 modes).
84
+ `omniauth-uber` is tested under 1.9.2, 1.9.3, 2.0.0, 2.1.0, MRI Ruby HEAD, JRuby (1.9 mode and HEAD), and Rubinius
85
+ (2.0 mode).
67
86
 
68
87
  ## Versioning
69
88
  This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
@@ -83,7 +102,7 @@ Constraint][pvc] with two digits of precision. For example:
83
102
 
84
103
  ## License
85
104
 
86
- Copyright (c) 2013 by Tom Milewski
105
+ Copyright (c) 2014 by Tom Milewski
87
106
 
88
107
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
89
108
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :test => :spec
6
+ task test: :spec
7
7
 
8
8
  begin
9
9
  require 'rubocop/rake_task'
@@ -14,4 +14,4 @@ rescue LoadError
14
14
  end
15
15
  end
16
16
 
17
- task :default => [:spec, :rubocop]
17
+ task default: %i[spec rubocop]
@@ -3,27 +3,27 @@ require 'omniauth-oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Uber < OmniAuth::Strategies::OAuth2
6
- DEFAULT_SCOPE = 'profile'
6
+ DEFAULT_SCOPE = 'profile'.freeze
7
7
 
8
- option :client_options, :site => 'https://api.uber.com',
9
- :authorize_url => 'https://login.uber.com/oauth/authorize',
10
- :token_url => 'https://login.uber.com/oauth/token'
8
+ option :client_options, site: 'https://api.uber.com',
9
+ authorize_url: 'https://login.uber.com/oauth/authorize',
10
+ token_url: 'https://login.uber.com/oauth/token'
11
11
 
12
12
  uid { raw_info['uuid'] }
13
13
 
14
14
  info do
15
15
  {
16
- :first_name => raw_info['first_name'],
17
- :last_name => raw_info['last_name'],
18
- :email => raw_info['email'],
19
- :picture => raw_info['picture'],
20
- :promo_code => raw_info['promo_code']
16
+ first_name: raw_info['first_name'],
17
+ last_name: raw_info['last_name'],
18
+ email: raw_info['email'],
19
+ picture: raw_info['picture'],
20
+ promo_code: raw_info['promo_code']
21
21
  }
22
22
  end
23
23
 
24
24
  extra do
25
25
  {
26
- :raw_info => raw_info
26
+ raw_info: raw_info
27
27
  }
28
28
  end
29
29
 
@@ -33,9 +33,9 @@ module OmniAuth
33
33
 
34
34
  def request_phase
35
35
  options[:authorize_params] = {
36
- :client_id => options['client_id'],
37
- :response_type => 'code',
38
- :scopes => (options['scope'] || DEFAULT_SCOPE)
36
+ client_id: options['client_id'],
37
+ response_type: 'code',
38
+ scopes: (options['scope'] || DEFAULT_SCOPE)
39
39
  }
40
40
 
41
41
  super
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Uber
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.0'.freeze
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
4
  require 'omniauth/uber/version'
4
5
 
@@ -20,6 +21,6 @@ Gem::Specification.new do |s|
20
21
  s.add_runtime_dependency 'omniauth', '~> 1.2'
21
22
  s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
22
23
 
23
- s.add_development_dependency 'dotenv', '~> 0'
24
- s.add_development_dependency 'sinatra', '~> 0'
24
+ s.add_development_dependency 'dotenv', '>= 2.0'
25
+ s.add_development_dependency 'sinatra', '>= 2.0'
25
26
  end
@@ -31,8 +31,8 @@ get '/auth/:name/callback' do
31
31
  >> UID
32
32
  #{auth.uid.inspect}
33
33
 
34
- >> ACCESS TOKEN
35
- #{auth.credentials.token.inspect}
34
+ >> CREDENTIALS
35
+ #{auth.credentials.inspect}
36
36
 
37
37
  >> INFO
38
38
  #{auth.info.inspect}
@@ -3,7 +3,8 @@ require 'spec_helper'
3
3
  describe OmniAuth::Strategies::Uber do
4
4
  subject do
5
5
  @subject ||= begin
6
- args = ['client_id', 'client_secret', @options || {}].compact
6
+ @options ||= {}
7
+ args = ['client_id', 'client_secret', @options].compact
7
8
  OmniAuth::Strategies::Uber.new(*args)
8
9
  end
9
10
  end
@@ -9,5 +9,5 @@ require 'omniauth'
9
9
  require 'omniauth-uber'
10
10
 
11
11
  RSpec.configure do |config|
12
- config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
12
+ config.extend OmniAuth::Test::StrategyMacros, type: :strategy
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-uber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Milewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -42,30 +42,30 @@ dependencies:
42
42
  name: dotenv
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sinatra
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '2.0'
69
69
  description: Uber strategy for OmniAuth v1.2
70
70
  email:
71
71
  - tmilewski@gmail.com
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - ".rubocop-https---raw-githubusercontent-com-tmilewski-rubocop-defaults-master-rubocop-yml"
77
78
  - ".rubocop.yml"
78
79
  - ".travis.yml"
79
80
  - Gemfile
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  version: '0'
107
108
  requirements: []
108
109
  rubyforge_project:
109
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.6.11
110
111
  signing_key:
111
112
  specification_version: 4
112
113
  summary: Uber strategy for OmniAuth
@@ -114,4 +115,3 @@ test_files:
114
115
  - spec/app.rb
115
116
  - spec/omniauth/strategies/uber_spec.rb
116
117
  - spec/spec_helper.rb
117
- has_rdoc: