mvpaas 0.1.0 → 0.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/mvpaas/auth.rb +4 -2
- data/lib/mvpaas/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9e494045d3518b66b6f0232a21b03c0e126d8c7
|
4
|
+
data.tar.gz: 35808ffef78a1a3aa1fa4dd559e2910fda8c0ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf44a3556d8d22194480a29acd9c7c0986673598bb98d221b099a1350bc80ad40a5d1cc052bedc047a3fd5515f6af08c71696c813f90bfbe6a36163e1467bdb
|
7
|
+
data.tar.gz: e90efd29651f1c8d15185851d71bbae1c8dca14ca4b4b1b8e9f80ce3cba5dea0b856696c1960c1e15b157b3c415538b211aff45a8783e23e1acd36dc27624689
|
data/lib/mvpaas/auth.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'jwt'
|
2
2
|
require 'openssl'
|
3
|
+
require 'base64'
|
3
4
|
|
4
5
|
module MVPaaS
|
5
6
|
module Auth
|
6
7
|
|
7
8
|
module_function
|
8
9
|
|
9
|
-
def decode(token, secret)
|
10
|
-
|
10
|
+
def decode(token, secret = nil)
|
11
|
+
decoded_secret = Base64.urlsafe_decode64(secret || ENV['MVPAAS_SECRET'])
|
12
|
+
rsa_key = OpenSSL::PKey::RSA.new(decoded_secret,'').public_key
|
11
13
|
decoded_jwt = JWT.decode(token, rsa_key, true, algorithm: 'RS256')[0]
|
12
14
|
{
|
13
15
|
id: decoded_jwt['sub'],
|
data/lib/mvpaas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mvpaas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Montgomery
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|