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 +4 -4
- data/lib/serverless_hub/authorizer.rb +11 -2
- data/lib/serverless_hub/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a7af672f89f81f34e03ca4c2480105877576fe28c26cbd9ed570424ae30bad5
|
4
|
+
data.tar.gz: d7a20f0463ea2dbd8ef6bcf93a64b2561764e2e1ecca57deb77fecd167c8ed89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
36
|
-
|
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
|
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.
|
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
|
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.
|
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: []
|