omniauth-google-oauth2 1.1.2 → 1.1.3

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
  SHA256:
3
- metadata.gz: adbd87cbf3dc07abbc3f14d2923a655b78cae9701432c0f0866e959eeb946606
4
- data.tar.gz: f4b975b570dd5b96032402766be88e8537f419ea361564275b2e84b97bd2cdb9
3
+ metadata.gz: 7eb54f22683d8785746e4da71576b5f84cf2f654961879dc10c2585b61ac27e6
4
+ data.tar.gz: 32dd7cb7faaece80dd26f9675f2cd46fc20d39531a2230d24709296fa53cf1bc
5
5
  SHA512:
6
- metadata.gz: 0445f4e07feba58d9b850dcf6d0a45e256a9e6557de6f5a248b0ac8e42004446eb9bc31cfa3dd3f61cb0baab276b3d85b17f302863f81f0560c4532f58a05115
7
- data.tar.gz: 4a7c65a13c017c7da47d8a82e86615e51af46c32d20dcf25d4fcc6451b81299a63c291b78b3b956ddc4c015d97e2d2c855efa6647ad29f7cda25171746231e4a
6
+ metadata.gz: aebca15a4956422c94af941328c51007a4bf0d461fe109586ae90b4dddcfdc0acd8cc7a6abade1589986866040962be3457ab3ab4c27ebfbe3a390d15e1f0a38
7
+ data.tar.gz: 8d2a97f39e08ee8f8ccb00e6b9d7bdb6d9d96d26097ad36ca7486ba9f41a2671fa77c3b19628c83aa475a939c01331539df468d1280bc990927fc0e5475a3fe7
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ Metrics/BlockLength:
6
6
  ExcludedMethods: ['describe', 'context', 'shared_examples']
7
7
  Metrics/CyclomaticComplexity:
8
8
  Enabled: false
9
- Metrics/LineLength:
9
+ Layout/LineLength:
10
10
  Enabled: false
11
11
  Metrics/MethodLength:
12
12
  Enabled: false
@@ -18,3 +18,13 @@ Style/MutableConstant:
18
18
  Enabled: false
19
19
  Gemspec/RequiredRubyVersion:
20
20
  Enabled: false
21
+ Lint/RaiseException:
22
+ Enabled: false
23
+ Lint/StructNewOverride:
24
+ Enabled: false
25
+ Style/HashEachMethods:
26
+ Enabled: false
27
+ Style/HashTransformKeys:
28
+ Enabled: false
29
+ Style/HashTransformValues:
30
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## 1.1.3 - 2024-08-29
5
+
6
+ ### Added
7
+ - Updated to use POST instead of GET for tokeninfo endpoint.
8
+
9
+ ### Deprecated
10
+ - Nothing.
11
+
12
+ ### Removed
13
+ - Nothing.
14
+
15
+ ### Fixed
16
+ - Documentation typos.
17
+ - Rubocop configuration updates.
18
+
4
19
  ## 1.1.2 - 2024-03-28
5
20
 
6
21
  ### Added
data/README.md CHANGED
@@ -40,7 +40,7 @@ You can now access the OmniAuth Google OAuth2 URL: `/auth/google_oauth2`
40
40
 
41
41
  For more examples please check out `examples/omni_auth.rb`
42
42
 
43
- [Using Devise? Skip the above and jump down to the Devise section!](#devise) After setting up the provider via Devise, you can reference the confdiurations below.
43
+ [Using Devise? Skip the above and jump down to the Devise section!](#devise) After setting up the provider via Devise, you can reference the configurations below.
44
44
 
45
45
  NOTE: While developing your application, if you change the scope in the initializer you will need to restart your app server. Remember that either the 'email' or 'profile' scope is required!
46
46
 
@@ -205,6 +205,8 @@ end
205
205
  and bind to or create the user
206
206
 
207
207
  ```ruby
208
+ # app/models/user.rb
209
+
208
210
  def self.from_omniauth(access_token)
209
211
  data = access_token.info
210
212
  user = User.where(email: data['email']).first
@@ -233,7 +235,7 @@ For your views you can login using:
233
235
  <%= link_to "Sign in with Google", user_omniauth_authorize_path(:google_oauth2) %>
234
236
  ```
235
237
 
236
- An overview is available at https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
238
+ An overview is available at https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
237
239
 
238
240
  ### One-time Code Flow (Hybrid Authentication)
239
241
 
data/examples/Gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- gem 'omniauth-google-oauth2', '~> 1.1.2'
5
+ gem 'omniauth-google-oauth2', '~> 1.1.3'
6
6
  gem 'rubocop'
7
7
  gem 'sinatra', '~> 1.4'
8
8
  gem 'webrick'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module GoogleOauth2
5
- VERSION = '1.1.2'
5
+ VERSION = '1.1.3'
6
6
  end
7
7
  end
@@ -231,7 +231,7 @@ module OmniAuth
231
231
  return nil unless access_token
232
232
 
233
233
  @token_info ||= Hash.new do |h, k|
234
- h[k] = client.request(:get, 'https://www.googleapis.com/oauth2/v3/tokeninfo', params: { access_token: access_token }).parsed
234
+ h[k] = client.request(:post, 'https://www.googleapis.com/oauth2/v3/tokeninfo', body: { access_token: access_token }).parsed
235
235
  end
236
236
 
237
237
  @token_info[access_token]
@@ -384,7 +384,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
384
384
  subject.options.client_options[:connection_build] = proc do |builder|
385
385
  builder.request :url_encoded
386
386
  builder.adapter :test do |stub|
387
- stub.get('/oauth2/v3/tokeninfo?access_token=valid_access_token') do
387
+ stub.post('/oauth2/v3/tokeninfo', 'access_token=valid_access_token') do
388
388
  [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
389
389
  aud: '000000000000.apps.googleusercontent.com',
390
390
  sub: '123456789',
@@ -781,7 +781,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
781
781
  subject.options.client_options[:connection_build] = proc do |builder|
782
782
  builder.request :url_encoded
783
783
  builder.adapter :test do |stub|
784
- stub.get('/oauth2/v3/tokeninfo?access_token=valid_access_token') do
784
+ stub.post('/oauth2/v3/tokeninfo', 'access_token=valid_access_token') do
785
785
  [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
786
786
  aud: '000000000000.apps.googleusercontent.com',
787
787
  sub: '123456789',
@@ -792,7 +792,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
792
792
  expires_in: 436
793
793
  )]
794
794
  end
795
- stub.get('/oauth2/v3/tokeninfo?access_token=invalid_access_token') do
795
+ stub.post('/oauth2/v3/tokeninfo', 'access_token=invalid_access_token') do
796
796
  [400, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(error_description: 'Invalid Value')]
797
797
  end
798
798
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-google-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Ellithorpe
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-03-29 00:00:00.000000000 Z
12
+ date: 2024-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jwt