omniauth 2.1.0 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df50309ac3b4098a460e7a52f233798a3246cffdfeb2c6f6f60d373b8af8af2c
4
- data.tar.gz: bf5c53ceadb04c431b88aa17dfe6a11b46475b38bc9d4fa74865e1eb21d27772
3
+ metadata.gz: 72f75a04a8d177ece789f87bafb01954e87e25006087e1c4b469d9a7245d3f65
4
+ data.tar.gz: 04f1b32853317188896eecf634ce2d2592e0de9441f5ccc2bb24a55a84c0af01
5
5
  SHA512:
6
- metadata.gz: dfd0bb2add456a51a393e672cba45d310f6ab7d2b5aa37c058a7242b8b0dc9b644877596c0a47c9e1c462d1e593516d1474379f103cae0988cced76c37260d4a
7
- data.tar.gz: 6a0c4302b25339ca10e304ef1fb968e5dd36cb5e6d686499c1b9d5185f9165fef864f54603f385076bf81160980ca532285a00ebdf23de82f3a1bacf95655856
6
+ metadata.gz: 5e99d765970df98de46c2872a3bf65ccd8012fba74910fa9b608909725a64e167dbd34b53b4b5d673f07955e107893965a3fd7012ef4b2219bdb3ed5dfd5a9ae
7
+ data.tar.gz: 59455629cd76bfa5220a625b6ba4d470be36df8d11a973967f06219015516ca77fdf4c9afa79ba3033a159f5d95d971379f1882afc0973873fabcf779672ac17
@@ -0,0 +1,18 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: bundler
9
+ directory: '/'
10
+ schedule:
11
+ interval: weekly
12
+ open-pull-requests-limit: 99
13
+
14
+ - package-ecosystem: github-actions
15
+ directory: '/'
16
+ schedule:
17
+ interval: daily
18
+ open-pull-requests-limit: 99
@@ -0,0 +1,28 @@
1
+ name: JRuby
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ pull_request:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu, macos]
15
+ jruby: [jruby, jruby-head]
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.jruby }}
22
+ bundler-cache: true
23
+ env:
24
+ JRUBY_OPTS: --debug
25
+ - name: Run tests
26
+ env:
27
+ JRUBY_OPTS: --debug
28
+ run: bundle exec rake
@@ -15,75 +15,50 @@ on:
15
15
 
16
16
  jobs:
17
17
  test:
18
- runs-on: ubuntu-18.04
18
+ runs-on: ${{ matrix.os }}-latest
19
19
  strategy:
20
20
  fail-fast: false
21
21
  matrix:
22
22
  os: [ubuntu, macos]
23
- ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head, debug, truffleruby, truffleruby-head]
23
+ ruby: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, head, debug]
24
+ exclude:
25
+ - os: macos
26
+ ruby: 2.5
24
27
  steps:
25
- - uses: actions/checkout@v2
28
+ - uses: actions/checkout@v3
26
29
  - name: Set up Ruby
27
30
  uses: ruby/setup-ruby@v1
28
31
  with:
29
32
  ruby-version: ${{ matrix.ruby }}
30
33
  bundler-cache: true
31
- - name: Install dependencies
32
- run: bundle install
33
34
  - name: Run tests
34
35
  run: bundle exec rake
35
- test-jruby:
36
- runs-on: ubuntu-18.04
37
- strategy:
38
- fail-fast: false
39
- matrix:
40
- os: [ubuntu, macos]
41
- jruby: [jruby] # TODO: Add back jruby-head once we figure out why there's a bundler mismatch
42
- steps:
43
- - uses: actions/checkout@v2
44
- - name: Set up Ruby
45
- uses: ruby/setup-ruby@v1
46
- with:
47
- ruby-version: ${{ matrix.jruby }}
48
- bundler-cache: true
49
- - name: Install dependencies
50
- env:
51
- JRUBY_OPTS: --debug
52
- run: bundle install
53
- - name: Run tests
54
- env:
55
- JRUBY_OPTS: --debug
56
- run: bundle exec rake
57
36
  frozen-string-compat:
58
- runs-on: ubuntu-18.04
37
+ runs-on: ubuntu-latest
59
38
  steps:
60
- - uses: actions/checkout@v2
39
+ - uses: actions/checkout@v3
61
40
  - name: Set up Ruby
62
41
  uses: ruby/setup-ruby@v1
63
42
  with:
64
43
  ruby-version: 2.6
65
44
  bundler-cache: true
66
- - name: Install dependencies
67
- run: bundle install
68
45
  - name: Run tests
69
46
  env:
70
47
  RUBYOPT: "--enable-frozen-string-literal"
71
48
  run: bundle exec rake
72
49
  coveralls:
73
- runs-on: ubuntu-18.04
50
+ runs-on: ubuntu-latest
74
51
  steps:
75
- - uses: actions/checkout@v2
52
+ - uses: actions/checkout@v3
76
53
  - name: Set up Ruby
77
54
  uses: ruby/setup-ruby@v1
78
55
  with:
79
56
  ruby-version: 2.6
80
57
  bundler-cache: true
81
- - name: Install dependencies
82
- run: bundle install
83
58
  - name: Run tests
84
59
  run: bundle exec rake
85
60
  - name: Coveralls GitHub Action
86
- uses: coverallsapp/github-action@v1.1.2
61
+ uses: coverallsapp/github-action@v2
87
62
  with:
88
63
  github-token: ${{ secrets.github_token }}
89
64
  path-to-lcov: './coverage/lcov/omniauth.lcov'
@@ -0,0 +1,24 @@
1
+ name: TruffleRuby
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ pull_request:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu, macos]
15
+ ruby: [truffleruby, truffleruby-head]
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - name: Run tests
24
+ run: bundle exec rake
data/Gemfile CHANGED
@@ -13,16 +13,11 @@ end
13
13
 
14
14
  group :test do
15
15
  gem 'coveralls_reborn', '~> 0.19.0', require: false
16
- gem 'hashie', '>= 3.4.6', '~> 4.0.0', platforms: [:jruby_18]
17
- gem 'json', '~> 2.3.0', platforms: %i[jruby_18 jruby_19 ruby_19]
18
- gem 'mime-types', '~> 3.1', platforms: [:jruby_18]
19
16
  gem 'rack-test'
20
- gem 'rest-client', '~> 2.0.0', platforms: [:jruby_18]
21
17
  gem 'rspec', '~> 3.5'
22
18
  gem 'rack-freeze'
23
- gem 'rubocop', '>= 0.58.2', '< 0.69.0', platforms: %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
19
+ gem 'rubocop', '>= 0.58.2', '< 0.69.0', platforms: %i[ruby_22 ruby_23 ruby_24]
24
20
  gem 'simplecov-lcov'
25
- gem 'tins', '~> 1.13', platforms: %i[jruby_18 jruby_19 ruby_19]
26
21
  end
27
22
 
28
23
  gemspec
data/README.md CHANGED
@@ -1,16 +1,21 @@
1
1
  # OmniAuth: Standardized Multi-Provider Authentication
2
2
 
3
3
  [![Gem Version](http://img.shields.io/gem/v/omniauth.svg)][gem]
4
- [![Build Status](http://img.shields.io/travis/omniauth/omniauth.svg)][travis]
4
+ [![Ruby](https://github.com/omniauth/omniauth/actions/workflows/main.yml/badge.svg)][githubactions]
5
+ [![TruffleRuby](https://github.com/omniauth/omniauth/actions/workflows/truffle_ruby.yml/badge.svg)][githubactionstruffle]
6
+ [![JRuby](https://github.com/omniauth/omniauth/actions/workflows/jruby.yml/badge.svg)][githubactionsjruby]
5
7
  [![Code Climate](https://api.codeclimate.com/v1/badges/ffd33970723587806744/maintainability)][codeclimate]
6
8
  [![Coverage Status](http://img.shields.io/coveralls/omniauth/omniauth.svg)][coveralls]
7
9
 
8
10
  [gem]: https://rubygems.org/gems/omniauth
9
- [travis]: http://travis-ci.org/omniauth/omniauth
11
+ [githubactions]: https://github.com/omniauth/omniauth/actions/workflows/main.yml
12
+ [githubactionstruffle]: https://github.com/omniauth/omniauth/actions/workflows/truffle_ruby.yml
13
+ [githubactionsjruby]: https://github.com/omniauth/omniauth/actions/workflows/jruby.yml
10
14
  [codeclimate]: https://codeclimate.com/github/omniauth/omniauth
11
15
  [coveralls]: https://coveralls.io/r/omniauth/omniauth
12
16
 
13
- This is the documentation for our latest release [v2.1.0](https://github.com/omniauth/omniauth/releases/tag/v2.1.0).
17
+ This is the documentation for the in-development branch of OmniAuth.
18
+ You can find the documentation for the latest stable release [here](https://github.com/omniauth/omniauth/tree/v2.1.3)
14
19
 
15
20
  ## An Introduction
16
21
  OmniAuth is a library that standardizes multi-provider authentication for
@@ -97,6 +102,13 @@ environment information on the callback request. It is entirely up to
97
102
  you how you want to implement the particulars of your application's
98
103
  authentication flow.
99
104
 
105
+ ## rack_csrf
106
+
107
+ `omniauth` is not OOTB-compatible with [rack_csrf](https://github.com/baldowl/rack_csrf). In order to do so, the following code needs to be added to the application bootstrapping code:
108
+
109
+ ```ruby
110
+ OmniAuth::AuthenticityTokenProtection.default_options(key: "csrf.token", authenticity_param: "_csrf")
111
+ ```
100
112
 
101
113
  ## Rails (without Devise)
102
114
  To get started, add the following gems
@@ -240,7 +252,7 @@ improve code health, while paying the maintainers of the exact packages you use.
240
252
  [Learn more.](https://tidelift.com/subscription/pkg/rubygems-omniauth?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
241
253
 
242
254
  ## Supported Ruby Versions
243
- OmniAuth is tested under 2.5, 2.6, 2.7, truffleruby, and JRuby.
255
+ OmniAuth is tested under 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, truffleruby, and JRuby.
244
256
 
245
257
  ## Versioning
246
258
  This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
data/SECURITY.md CHANGED
@@ -7,6 +7,7 @@ currently being supported with security updates.
7
7
 
8
8
  | Version | Supported |
9
9
  | ------- | ------------------ |
10
+ | 2.1.x | :white_check_mark: |
10
11
  | 2.0.x | :white_check_mark: |
11
12
  | <= 1.9.1 | :x: |
12
13
 
data/lib/omniauth/form.rb CHANGED
@@ -7,6 +7,7 @@ module OmniAuth
7
7
  def initialize(options = {})
8
8
  options[:title] ||= 'Authentication Info Required'
9
9
  options[:header_info] ||= ''
10
+ options[:method] ||= 'post'
10
11
  self.options = options
11
12
 
12
13
  @html = +'' # unary + string allows it to be mutable if strings are frozen
@@ -75,7 +76,7 @@ module OmniAuth
75
76
  </head>
76
77
  <body>
77
78
  <h1>#{title}</h1>
78
- <form method='post' #{"action='#{options[:url]}' " if options[:url]}noValidate='noValidate'>
79
+ <form method='#{options[:method]}' #{"action='#{options[:url]}' " if options[:url]}noValidate='noValidate'>
79
80
  HTML
80
81
  self
81
82
  end
@@ -35,7 +35,7 @@ module OmniAuth
35
35
  option :uid_field, :email
36
36
 
37
37
  def request_phase
38
- form = OmniAuth::Form.new(:title => 'User Info', :url => callback_path)
38
+ form = OmniAuth::Form.new(:title => 'User Info', :url => callback_path, :method => 'get')
39
39
  options.fields.each do |field|
40
40
  form.text_field field.to_s.capitalize.tr('_', ' '), field.to_s
41
41
  end
@@ -335,7 +335,9 @@ module OmniAuth
335
335
 
336
336
  def mock_callback_call
337
337
  setup_phase
338
- @env['omniauth.origin'] = session.delete('omniauth.origin')
338
+
339
+ origin = session.delete('omniauth.origin')
340
+ @env['omniauth.origin'] ||= origin
339
341
  @env['omniauth.origin'] = nil if env['omniauth.origin'] == ''
340
342
  @env['omniauth.params'] = session.delete('omniauth.params') || {}
341
343
 
@@ -481,7 +483,7 @@ module OmniAuth
481
483
  OmniAuth.config.full_host.call(env)
482
484
  else
483
485
  # in Rack 1.3.x, request.url explodes if scheme is nil
484
- if request.scheme && request.url.match(URI::ABS_URI)
486
+ if request.scheme && URI.parse(request.url).absolute?
485
487
  uri = URI.parse(request.url.gsub(/\?.*$/, ''))
486
488
  uri.path = ''
487
489
  # sometimes the url is actually showing http inside rails because the
@@ -498,6 +500,7 @@ module OmniAuth
498
500
  end
499
501
 
500
502
  def script_name
503
+ return '' if @env.nil?
501
504
  @env['SCRIPT_NAME'] || ''
502
505
  end
503
506
 
@@ -1,3 +1,3 @@
1
1
  module OmniAuth
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.3'.freeze
3
3
  end
data/lib/omniauth.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # TODO: Fixed in https://github.com/rack/rack/pull/1610 for Rack 3
2
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
3
+ require 'delegate'
4
+ end
1
5
  require 'rack'
2
6
  require 'singleton'
3
7
  require 'logger'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-04-13 00:00:00.000000000 Z
13
+ date: 2025-02-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hashie
@@ -93,7 +93,10 @@ extra_rdoc_files: []
93
93
  files:
94
94
  - ".github/FUNDING.yml"
95
95
  - ".github/ISSUE_TEMPLATE.md"
96
+ - ".github/dependabot.yml"
97
+ - ".github/workflows/jruby.yml"
96
98
  - ".github/workflows/main.yml"
99
+ - ".github/workflows/truffle_ruby.yml"
97
100
  - ".gitignore"
98
101
  - ".rspec"
99
102
  - ".rubocop.yml"
@@ -138,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
141
  - !ruby/object:Gem::Version
139
142
  version: 1.3.5
140
143
  requirements: []
141
- rubygems_version: 3.2.32
144
+ rubygems_version: 3.5.11
142
145
  signing_key:
143
146
  specification_version: 4
144
147
  summary: A generalized Rack framework for multiple-provider authentication.