omniauth-google-id-token 1.1.0 → 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: 4b756f006ad3cc0cf614b043370928fd7847e757c5466e5f649828251dba82c8
4
- data.tar.gz: 1faaa945a752d1b9d9cecc7db14bf0eba54383c494134a44e48ed52ae2dde598
3
+ metadata.gz: 2b9cb7b7839da58f2239f9224c664972d865e66956088790db7275548664ce76
4
+ data.tar.gz: 8ad8ad7214c796bc2836e79b0b3e58f9ab98eb50e20b2fbaaa188be7e07d015a
5
5
  SHA512:
6
- metadata.gz: a03ae591d4d6bfde18fe0649912364a1f80c54a98659f5e0bfd6c317dc9ef1017d9bc0e3e268ac4251e2cedce2e8598645cfa726ad9480100cc11603b0f68c66
7
- data.tar.gz: 755bfe3610a24e8c31a4fa8ce20ade00eff3ef192d8345652574d21868922675dec7625484beaca2d66f7d22cd0d92c80fbfdb557aca3465f74ad164a9150065
6
+ metadata.gz: 50ed1f84e0399305cbb0e4903e92fce1a83e8c2e238f3490accc1a427e86517348537f94ccacd46db2ff92fbe41b80123b3736dfcd5f825cccbe8771236b726b
7
+ data.tar.gz: 9329c75e85089d0d5935e7713e073a540bc36bed65b971ad26114ad3463ea7057d6c86373bfcf5b2174d89bfd95e3ce5dd6e45cbfe1ccaf60aac94e064598853
data/Gemfile CHANGED
@@ -4,7 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test, :development do
7
- gem 'googleauth'
8
7
  gem 'jwt' # For testing
9
8
  gem 'multi_json' # For testing
10
9
  gem 'omniauth'
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GoogleIdToken
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.1.3'.freeze
4
4
  end
5
5
  end
@@ -39,13 +39,13 @@ module OmniAuth
39
39
  params
40
40
  end
41
41
 
42
- def decoded # rubocop:disable Metrics/MethodLength
43
- unless @decoded
44
- begin
45
- @decoded = validator.verify_oidc(request.params['id_token'], aud: options.client_id)
46
- rescue StandardError => e
47
- raise ClaimInvalid, e.message
48
- end
42
+ def decoded # rubocop:disable Metrics/AbcSize
43
+ raise ClaimInvalid, 'Token not found!' unless request.params.key?('id_token')
44
+
45
+ begin
46
+ @decoded = ::Google::Auth::IDTokens.verify_oidc(request.params['id_token'], aud: options.client_id)
47
+ rescue StandardError => e
48
+ raise ClaimInvalid, e.message
49
49
  end
50
50
 
51
51
  (options.required_claims || []).each do |field|
@@ -76,10 +76,6 @@ module OmniAuth
76
76
 
77
77
  private
78
78
 
79
- def validator
80
- ::Google::Auth::IDTokens::Verifier
81
- end
82
-
83
79
  def uid_lookup
84
80
  @uid_lookup ||= options.uid_claim.new(request)
85
81
  end
@@ -33,7 +33,8 @@ describe OmniAuth::Strategies::GoogleIdToken do # rubocop:disable Metrics/BlockL
33
33
  {
34
34
  aud_claim: payload[:aud],
35
35
  azp_claim: payload[:azp],
36
- client_id: client_id
36
+ client_id: client_id,
37
+ provider_ignores_state: true
37
38
  }
38
39
  ]
39
40
  end
@@ -72,7 +73,7 @@ describe OmniAuth::Strategies::GoogleIdToken do # rubocop:disable Metrics/BlockL
72
73
 
73
74
  context 'callback phase' do
74
75
  it 'should decode the response' do
75
- allow(::Google::Auth::IDTokens::Verifier).to receive(:verify_oidc)
76
+ allow(::Google::Auth::IDTokens).to receive(:verify_oidc)
76
77
  .with(id_token, aud: client_id)
77
78
  .and_return(payload)
78
79
 
@@ -82,7 +83,7 @@ describe OmniAuth::Strategies::GoogleIdToken do # rubocop:disable Metrics/BlockL
82
83
 
83
84
  it 'should not work without required fields' do
84
85
  payload.delete('email')
85
- allow(::Google::Auth::IDTokens::Verifier).to receive(:verify_oidc)
86
+ allow(::Google::Auth::IDTokens).to receive(:verify_oidc)
86
87
  .with(id_token, aud: client_id)
87
88
  .and_return(payload)
88
89
 
@@ -91,7 +92,7 @@ describe OmniAuth::Strategies::GoogleIdToken do # rubocop:disable Metrics/BlockL
91
92
  end
92
93
 
93
94
  it 'should assign the uid' do
94
- allow(::Google::Auth::IDTokens::Verifier).to receive(:verify_oidc)
95
+ allow(::Google::Auth::IDTokens).to receive(:verify_oidc)
95
96
  .with(id_token, aud: client_id)
96
97
  .and_return(payload)
97
98
  post "#{api_url}/callback", id_token: id_token
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-google-id-token
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Morris