real_savvy 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/real_savvy/jwt/abstract_token.rb +0 -5
- data/lib/real_savvy/jwt/share_token.rb +12 -0
- data/lib/real_savvy/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: a1952776f35bc650b82d5f3686ebdf1f2d959b68
|
4
|
+
data.tar.gz: 2fe7b245b44ddb8f93620fd3a098b02d76bfa592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e2bbbd513d79ecf979a5ac45f3c3d94ac2f4134eda5aee5d70e6336a4b2d227131f8f87b3b8acff1e6ded6717c69a124682b2408ddc5f7c1b47dc8d551b912a
|
7
|
+
data.tar.gz: f66a2d8060897f3b7cb2ba7b7c7e81b337c6a02250890fc8ff5f96a1d418674e6cc1ad271d30874c3bab2fedb005824410a08fcb1a1ea7dc3b47368eda17c9ba
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
real_savvy (0.0.
|
4
|
+
real_savvy (0.0.9)
|
5
5
|
faraday (>= 0.8.0)
|
6
6
|
faraday_middleware (>= 0.8.0)
|
7
7
|
jwt (>= 1.0.0)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
multipart-post (>= 1.2, < 3)
|
16
16
|
faraday_middleware (0.12.2)
|
17
17
|
faraday (>= 0.7.4, < 1.0)
|
18
|
-
jwt (1.
|
18
|
+
jwt (2.1.0)
|
19
19
|
method_source (0.8.2)
|
20
20
|
multipart-post (2.0.0)
|
21
21
|
pry (0.10.4)
|
@@ -93,11 +93,6 @@ module RealSavvy
|
|
93
93
|
@imposter ? true : false
|
94
94
|
end
|
95
95
|
|
96
|
-
def to_share_token
|
97
|
-
share_token_json = Hash[claims.slice('aud','sub').map{ |key,value| [key, value.to_s.split('/')[-2,2].join('/')] }].to_json
|
98
|
-
Base64.urlsafe_encode64(share_token_json, padding: false)
|
99
|
-
end
|
100
|
-
|
101
96
|
def short_token
|
102
97
|
@token.split('.')[1]
|
103
98
|
end
|
@@ -2,6 +2,18 @@ module RealSavvy
|
|
2
2
|
module JWT
|
3
3
|
class ShareToken < AbstractToken
|
4
4
|
|
5
|
+
def self.from_ids(audience_id:, subject_id:)
|
6
|
+
self.new(
|
7
|
+
::JWT.encode(
|
8
|
+
{aud: audience_id, sub: subject_id}, nil, 'none'
|
9
|
+
)
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_share_token
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
5
17
|
private
|
6
18
|
|
7
19
|
def retrieve_claims
|
data/lib/real_savvy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: real_savvy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Rauh
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-04-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|