serverless_hub 1.0.10 → 1.1.1

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: 78ee8fadac31eb6ac0e2d65983c5d4d7015944e1e9724f1da6356e513ed2690b
4
- data.tar.gz: e2c0101b13d8c00c66b693a3d38c4affcff4c91b9ccf096c5c34aa7660838a64
3
+ metadata.gz: 2a7af672f89f81f34e03ca4c2480105877576fe28c26cbd9ed570424ae30bad5
4
+ data.tar.gz: d7a20f0463ea2dbd8ef6bcf93a64b2561764e2e1ecca57deb77fecd167c8ed89
5
5
  SHA512:
6
- metadata.gz: e108fa06f80f719987d240e1b8b564953479ff3d263b9fdb1375963776e2b6934afa0c852941004792a91a92c303ce31bd426abdfff42197e9713dde5896ade2
7
- data.tar.gz: c23eec2c4b070cdde215258ec101836a72657224df4c5fb8b8ae34d32e750e6251812e49152a9f45c78a30ccddac969bf2b2648de4d5f87518a747424ac701ca
6
+ metadata.gz: 7a34b33d2d5cbcce0e4280d450fca6c4248f0d19dd070f481e176ffdfa765160c105ec56f00269ac265a3a7cef2a05a60e912066ccab6da051d4813da10a80c0
7
+ data.tar.gz: 1e94a90697c94a6a822f1a0243ce7d52224aa4bc569cc187df7530721ba8d0a9ab2ca1f046bb23212e8b84235ee6ee90fec5ab79d3c409547bcb7525e9653c5e
@@ -32,8 +32,17 @@ module ServerlessHub
32
32
  private
33
33
 
34
34
  def decoded_token(token)
35
- token = token.split(" ").last
36
- JWT.decode token, jwk_set.first.to_key, true, { algorithm: "RS256" } rescue ""
35
+ token = token.strip
36
+ if token.include? ' '
37
+ token = token.split(" ").last
38
+ end
39
+ decoded = JWT.decode token, jwk_set.first.to_key, false, { algorithm: "RS256" }
40
+ key_id = decoded[1]['kid']
41
+ key = jwk_set.find { |key_obj| key_obj['kid'] == key_id }
42
+ if key == nil
43
+ return ""
44
+ end
45
+ JWT.decode token, key.to_key, true, { algorithm: "RS256" } rescue ""
37
46
  end
38
47
 
39
48
  def jwk_set
@@ -1,3 +1,3 @@
1
1
  module ServerlessHub
2
- VERSION = "1.0.10"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverless_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-07 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,7 +151,7 @@ metadata:
151
151
  homepage_uri: https://goolge.com.au
152
152
  source_code_uri: https://goolge.com.au
153
153
  changelog_uri: https://goolge.com.au
154
- post_install_message:
154
+ post_install_message:
155
155
  rdoc_options: []
156
156
  require_paths:
157
157
  - lib
@@ -166,8 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubygems_version: 3.0.3
170
- signing_key:
169
+ rubygems_version: 3.0.8
170
+ signing_key:
171
171
  specification_version: 4
172
172
  summary: Write a short summary, because RubyGems requires one.
173
173
  test_files: []