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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 652be299d2ea9f3028126a7e3f0d8be72ba69735
4
- data.tar.gz: 9308a23ee4e072d315562f2ad6e470212907276d
3
+ metadata.gz: a1952776f35bc650b82d5f3686ebdf1f2d959b68
4
+ data.tar.gz: 2fe7b245b44ddb8f93620fd3a098b02d76bfa592
5
5
  SHA512:
6
- metadata.gz: 0f9033d41e6e25da94b3a5fd2643077367760278e2a9c2b827a01b89013f81f9b8716ecf0878048ed0f73b23b3d59c60bf354ffbf3bfe20ae2b72fd7b4c77ca3
7
- data.tar.gz: 05f024c4368bd03e42f478ba94fcc51afbce7f2ccf71eebb34135bb684f9a699cdcd986d13e4c3ed2f05054154fe7b6e52740027dcebf126b4ae0d9f71eaac41
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.7)
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.5.6)
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
@@ -1,3 +1,3 @@
1
1
  module RealSavvy
2
- VERSION = [0,0,8]
2
+ VERSION = [0,0,9]
3
3
  end
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.8
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-03-30 00:00:00.000000000 Z
13
+ date: 2018-04-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday