pusher-platform 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pusher-platform/authenticator.rb +5 -7
- 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: bdffd489f757406cff5d4919ae39738c7e9f86a8
|
4
|
+
data.tar.gz: b15393a6ff63d326e4ca39d354e046635db89490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ec68b234270eea843e46a968e9d2fbc4877b01b1d53153a6f23152f0d439fb5162be3b66848e2439be89a5d8bd1eec9cd03bcf453d3fd8e317f64bbbae02138
|
7
|
+
data.tar.gz: d1d3a2cacdaeb9e2f40e00042e4e8fe8840d4b87c3ab8730b1dc1b336315595c4bfe9266cbbd51c98956eae619573c88a8f000350b896b20b4cd3309b2965a58
|
@@ -2,7 +2,6 @@ require 'jwt'
|
|
2
2
|
require 'rack'
|
3
3
|
|
4
4
|
module Pusher
|
5
|
-
TOKEN_LEEWAY = 30
|
6
5
|
TOKEN_EXPIRY = 24*60*60
|
7
6
|
|
8
7
|
class Authenticator
|
@@ -37,10 +36,10 @@ module Pusher
|
|
37
36
|
now = Time.now.utc.to_i
|
38
37
|
|
39
38
|
claims = {
|
40
|
-
|
39
|
+
instance: @instance_id,
|
41
40
|
iss: "api_keys/#{@key_id}",
|
42
|
-
iat: now
|
43
|
-
exp: now + TOKEN_EXPIRY
|
41
|
+
iat: now,
|
42
|
+
exp: now + TOKEN_EXPIRY
|
44
43
|
}
|
45
44
|
|
46
45
|
claims.merge!({ sub: options[:user_id] }) unless options[:user_id].nil?
|
@@ -63,7 +62,6 @@ module Pusher
|
|
63
62
|
JWT.decode(old_refresh_jwt, @key_secret, true, {
|
64
63
|
iss: "api_keys/#{@key_id}",
|
65
64
|
verify_iss: true,
|
66
|
-
leeway: 30,
|
67
65
|
}).first
|
68
66
|
rescue => e
|
69
67
|
error_description = if e.is_a?(JWT::InvalidIssuerError)
|
@@ -121,9 +119,9 @@ module Pusher
|
|
121
119
|
now = Time.now.utc.to_i
|
122
120
|
|
123
121
|
claims = {
|
124
|
-
|
122
|
+
instance: @instance_id,
|
125
123
|
iss: "api_keys/#{@key_id}",
|
126
|
-
iat: now
|
124
|
+
iat: now,
|
127
125
|
refresh: true,
|
128
126
|
sub: options[:user_id],
|
129
127
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pusher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|