omniauth 1.8.1 → 1.9.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d44b113518272f233522832707ca3d6212dca359
4
- data.tar.gz: 558b3aad56d54629e5ae18ca72944008ca4d4a1e
2
+ SHA256:
3
+ metadata.gz: 35d19268ad77477704f29c8bb7aa989bc4fd087dfc75cad3757f0dba77615ab0
4
+ data.tar.gz: 7d6405feca4e14d010330e2c577aa815b7593de7ebc2591e9b45c266af3e05b5
5
5
  SHA512:
6
- metadata.gz: fc2cdd4f9decc4537dd2fdda21b9a18d005a29cff9e18f6db923571bde2c9f85d68483230c395a82983438bd16cec2754576625ed2ecb599dce3d1b752832523
7
- data.tar.gz: 0beb474c0fea700dfb8032a71fdf6062d952466a31ddb496433b4935405902cf0cd2cd0b18888700ccc838e0577822bdb300a97ff3d22385deb605c252d57946
6
+ metadata.gz: f2f0a59be54f42f5c6747e9601599eee747d0220c8cfbfd3037e713840453c29598b325beae1e0ca8c41db8581d02cd1adada18d1dcfb5afe8cab2fb8c5c7e61
7
+ data.tar.gz: 945998eec68b09718830c23c75ca2cd1ad23da58f9541d38c39ec0c4c08b587cb35827390a003c3c1fb551793d2b5a1ade0cf354236035c6489b229fa66a699f
data/.rubocop.yml CHANGED
@@ -1,6 +1,12 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.2
3
+
1
4
  Layout/AccessModifierIndentation:
2
5
  EnforcedStyle: outdent
3
6
 
7
+ Layout/AlignHash:
8
+ Enabled: false
9
+
4
10
  Layout/DotPosition:
5
11
  EnforcedStyle: trailing
6
12
 
@@ -50,6 +56,9 @@ Style/EachWithObject:
50
56
  Style/Encoding:
51
57
  Enabled: false
52
58
 
59
+ Style/ExpandPathArguments:
60
+ Enabled: false
61
+
53
62
  Style/HashSyntax:
54
63
  EnforcedStyle: hash_rockets
55
64
 
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  bundler_args: --without development
2
2
  before_install:
3
- - gem update --system
4
- - gem update bundler
3
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
4
+ - gem install bundler -v '1.17.3'
5
+ install:
6
+ - bundle _1.17.3_ install --jobs=3 --retry=3
5
7
  cache: bundler
6
8
  env:
7
9
  global:
@@ -9,11 +11,10 @@ env:
9
11
  language: ruby
10
12
  rvm:
11
13
  - jruby-9000
12
- - 2.1.10 # EOL Soon
13
- - 2.2.6
14
- - 2.3.3
15
- - 2.4.0
16
- - 2.5.0
14
+ - 2.2.9
15
+ - 2.3.5
16
+ - 2.4.4
17
+ - 2.5.3
17
18
  - jruby-head
18
19
  - ruby-head
19
20
  matrix:
data/Gemfile CHANGED
@@ -13,14 +13,14 @@ end
13
13
 
14
14
  group :test do
15
15
  gem 'coveralls', :require => false
16
- gem 'hashie', '>= 3.4.6', '< 3.6.0', :platforms => [:jruby_18]
16
+ gem 'hashie', '>= 3.4.6', '~> 4.0.0', :platforms => [:jruby_18]
17
17
  gem 'json', '~> 2.0.3', :platforms => %i[jruby_18 jruby_19 ruby_19]
18
18
  gem 'mime-types', '~> 3.1', :platforms => [:jruby_18]
19
- gem 'rack', '>= 1.6.2', :platforms => %i[jruby_18 jruby_19 ruby_19 ruby_20 ruby_21]
19
+ gem 'rack', '>= 2.0.6', :platforms => %i[jruby_18 jruby_19 ruby_19 ruby_20 ruby_21]
20
20
  gem 'rack-test'
21
21
  gem 'rest-client', '~> 2.0.0', :platforms => [:jruby_18]
22
22
  gem 'rspec', '~> 3.5.0'
23
- gem 'rubocop', '>= 0.47', :platforms => %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
23
+ gem 'rubocop', '>= 0.58.2', '< 0.69.0', :platforms => %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
24
24
  gem 'tins', '~> 1.13.0', :platforms => %i[jruby_18 jruby_19 ruby_19]
25
25
  end
26
26
 
data/README.md CHANGED
@@ -2,14 +2,12 @@
2
2
 
3
3
  [![Gem Version](http://img.shields.io/gem/v/omniauth.svg)][gem]
4
4
  [![Build Status](http://img.shields.io/travis/omniauth/omniauth.svg)][travis]
5
- [![Dependency Status](http://img.shields.io/gemnasium/omniauth/omniauth.svg)][gemnasium]
6
5
  [![Code Climate](http://img.shields.io/codeclimate/github/omniauth/omniauth.svg)][codeclimate]
7
6
  [![Coverage Status](http://img.shields.io/coveralls/omniauth/omniauth.svg)][coveralls]
8
7
  [![Security](https://hakiri.io/github/omniauth/omniauth/master.svg)](https://hakiri.io/github/omniauth/omniauth/master)
9
8
 
10
9
  [gem]: https://rubygems.org/gems/omniauth
11
10
  [travis]: http://travis-ci.org/omniauth/omniauth
12
- [gemnasium]: https://gemnasium.com/omniauth/omniauth
13
11
  [codeclimate]: https://codeclimate.com/github/omniauth/omniauth
14
12
  [coveralls]: https://coveralls.io/r/omniauth/omniauth
15
13
 
@@ -122,6 +120,8 @@ environment information on the callback request. It is entirely up to
122
120
  you how you want to implement the particulars of your application's
123
121
  authentication flow.
124
122
 
123
+ **Please note:** there is currently a CSRF vulnerability which affects OmniAuth (designated [CVE-2015-9284](https://nvd.nist.gov/vuln/detail/CVE-2015-9284)) that requires mitigation at the application level. More details on how to do this can be found on the [Wiki](https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284).
124
+
125
125
  ## Configuring The `origin` Param
126
126
  The `origin` url parameter is typically used to inform where a user came from and where, should you choose to use it, they'd want to return to.
127
127
 
data/Rakefile CHANGED
@@ -30,6 +30,7 @@ namespace :perf do
30
30
  def call_app(path = ENV['GET_PATH'] || '/')
31
31
  result = @app.get(path)
32
32
  raise "Did not succeed #{result.body}" unless result.status == 200
33
+
33
34
  result
34
35
  end
35
36
  end
@@ -20,9 +20,7 @@ module OmniAuth
20
20
  end
21
21
 
22
22
  def regular_writer(key, value)
23
- if key.to_s == 'info' && value.is_a?(::Hash) && !value.is_a?(InfoHash)
24
- value = InfoHash.new(value)
25
- end
23
+ value = InfoHash.new(value) if key.to_s == 'info' && value.is_a?(::Hash) && !value.is_a?(InfoHash)
26
24
  super
27
25
  end
28
26
 
@@ -36,6 +34,7 @@ module OmniAuth
36
34
  return "#{first_name} #{last_name}".strip if first_name? || last_name?
37
35
  return nickname if nickname?
38
36
  return email if email?
37
+
39
38
  nil
40
39
  end
41
40
 
@@ -1,24 +1,5 @@
1
1
  module OmniAuth
2
2
  class Builder < ::Rack::Builder
3
- def initialize(app, &block)
4
- @options = nil
5
- if rack14? || rack2?
6
- super
7
- else
8
- @app = app
9
- super(&block)
10
- @ins << @app
11
- end
12
- end
13
-
14
- def rack14?
15
- Rack.release.start_with?('1.') && (Rack.release.split('.')[1].to_i >= 4)
16
- end
17
-
18
- def rack2?
19
- Rack.release.start_with? '2.'
20
- end
21
-
22
3
  def on_failure(&block)
23
4
  OmniAuth.config.on_failure = block
24
5
  end
@@ -40,7 +21,8 @@ module OmniAuth
40
21
  end
41
22
 
42
23
  def options(options = false)
43
- return @options || {} if options == false
24
+ return @options ||= {} if options == false
25
+
44
26
  @options = options
45
27
  end
46
28
 
@@ -27,17 +27,19 @@ module OmniAuth
27
27
 
28
28
  def redirect_to_failure
29
29
  message_key = env['omniauth.error.type']
30
- new_path = "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?message=#{message_key}#{origin_query_param}#{strategy_name_query_param}"
30
+ new_path = "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?message=#{Rack::Utils.escape(message_key)}#{origin_query_param}#{strategy_name_query_param}"
31
31
  Rack::Response.new(['302 Moved'], 302, 'Location' => new_path).finish
32
32
  end
33
33
 
34
34
  def strategy_name_query_param
35
35
  return '' unless env['omniauth.error.strategy']
36
+
36
37
  "&strategy=#{env['omniauth.error.strategy'].name}"
37
38
  end
38
39
 
39
40
  def origin_query_param
40
41
  return '' unless env['omniauth.origin']
42
+
41
43
  "&origin=#{Rack::Utils.escape(env['omniauth.origin'])}"
42
44
  end
43
45
  end
data/lib/omniauth/form.rb CHANGED
@@ -82,6 +82,7 @@ module OmniAuth
82
82
 
83
83
  def footer
84
84
  return self if @footer
85
+
85
86
  @html << "\n<button type='submit'>Connect</button>" unless @with_custom_button
86
87
  @html << <<-HTML
87
88
  </form>
@@ -140,6 +140,7 @@ module OmniAuth
140
140
 
141
141
  self.class.args.each do |arg|
142
142
  break if args.empty?
143
+
143
144
  options[arg] = args.shift
144
145
  end
145
146
 
@@ -187,6 +188,7 @@ module OmniAuth
187
188
  return request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
188
189
  return callback_call if on_callback_path?
189
190
  return other_phase if respond_to?(:other_phase)
191
+
190
192
  @app.call(env)
191
193
  end
192
194
 
@@ -268,6 +270,7 @@ module OmniAuth
268
270
  def mock_call!(*)
269
271
  return mock_request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
270
272
  return mock_callback_call if on_callback_path?
273
+
271
274
  call_app!
272
275
  end
273
276
 
@@ -361,6 +364,7 @@ module OmniAuth
361
364
  def skip_info?
362
365
  return false unless options.skip_info?
363
366
  return true unless options.skip_info.respond_to?(:call)
367
+
364
368
  options.skip_info.call(uid)
365
369
  end
366
370
 
@@ -377,6 +381,7 @@ module OmniAuth
377
381
  if options[kind].respond_to?(:call)
378
382
  result = options[kind].call(env)
379
383
  return nil unless result.is_a?(String)
384
+
380
385
  result
381
386
  else
382
387
  options[kind]
@@ -401,7 +406,7 @@ module OmniAuth
401
406
  options[:setup_path] || "#{path_prefix}/#{name}/setup"
402
407
  end
403
408
 
404
- CURRENT_PATH_REGEX = %r{/$}
409
+ CURRENT_PATH_REGEX = %r{/$}.freeze
405
410
  EMPTY_STRING = ''.freeze
406
411
  def current_path
407
412
  @current_path ||= request.path_info.downcase.sub(CURRENT_PATH_REGEX, EMPTY_STRING)
@@ -1,3 +1,3 @@
1
1
  module OmniAuth
2
- VERSION = '1.8.1'.freeze
2
+ VERSION = '1.9.2'.freeze
3
3
  end
data/lib/omniauth.rb CHANGED
@@ -132,7 +132,7 @@ module OmniAuth
132
132
  end
133
133
 
134
134
  module Utils
135
- module_function
135
+ module_function # rubocop:disable Layout/IndentationWidth
136
136
 
137
137
  def form_css
138
138
  "<style type='text/css'>#{OmniAuth.config.form_css}</style>"
data/omniauth.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'omniauth/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.add_dependency 'hashie', ['>= 3.4.6', '< 3.6.0']
8
+ spec.add_dependency 'hashie', ['>= 3.4.6']
9
9
  spec.add_dependency 'rack', ['>= 1.6.2', '< 3']
10
10
  spec.add_development_dependency 'bundler', '~> 1.14'
11
11
  spec.add_development_dependency 'rake', '~> 12.0'
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.name = 'omniauth'
19
19
  spec.require_paths = %w[lib]
20
20
  spec.required_rubygems_version = '>= 1.3.5'
21
- spec.required_ruby_version = '>= 2.1.9'
21
+ spec.required_ruby_version = '>= 2.2'
22
22
  spec.summary = spec.description
23
23
  spec.version = OmniAuth::VERSION
24
24
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
8
8
  - Erik Michaels-Ober
9
9
  - Tom Milewski
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-28 00:00:00.000000000 Z
13
+ date: 2022-08-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hashie
@@ -19,9 +19,6 @@ dependencies:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: 3.4.6
22
- - - "<"
23
- - !ruby/object:Gem::Version
24
- version: 3.6.0
25
22
  type: :runtime
26
23
  prerelease: false
27
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,9 +26,6 @@ dependencies:
29
26
  - - ">="
30
27
  - !ruby/object:Gem::Version
31
28
  version: 3.4.6
32
- - - "<"
33
- - !ruby/object:Gem::Version
34
- version: 3.6.0
35
29
  - !ruby/object:Gem::Dependency
36
30
  name: rack
37
31
  requirement: !ruby/object:Gem::Requirement
@@ -118,7 +112,7 @@ homepage: https://github.com/omniauth/omniauth
118
112
  licenses:
119
113
  - MIT
120
114
  metadata: {}
121
- post_install_message:
115
+ post_install_message:
122
116
  rdoc_options: []
123
117
  require_paths:
124
118
  - lib
@@ -126,16 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
120
  requirements:
127
121
  - - ">="
128
122
  - !ruby/object:Gem::Version
129
- version: 2.1.9
123
+ version: '2.2'
130
124
  required_rubygems_version: !ruby/object:Gem::Requirement
131
125
  requirements:
132
126
  - - ">="
133
127
  - !ruby/object:Gem::Version
134
128
  version: 1.3.5
135
129
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.6.11
138
- signing_key:
130
+ rubygems_version: 3.2.32
131
+ signing_key:
139
132
  specification_version: 4
140
133
  summary: A generalized Rack framework for multiple-provider authentication.
141
134
  test_files: []