pusher-platform 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63984ba20221658d47ae460cee603acfbe67c078
4
- data.tar.gz: 4aa031d194b01cfbda401e82885395149f4a0e47
3
+ metadata.gz: bdffd489f757406cff5d4919ae39738c7e9f86a8
4
+ data.tar.gz: b15393a6ff63d326e4ca39d354e046635db89490
5
5
  SHA512:
6
- metadata.gz: 35d023ae46b9585beff39fa91b8fe19994ad65f1bd07ecd3885e633bd039ad5b1171cea2c99e0ad9a98e3c7586f878ab03e00892b2b4241ba143f9a9057b1bb7
7
- data.tar.gz: 5dbb406726b120cac32bc862d46dcd20b8e427a6f27976805e50320afd05198feef72c5aa7dcb27751fc9ed9028e4c25c1dd7572d430dcbfbf96b6277b4897d6
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
- app: @instance_id,
39
+ instance: @instance_id,
41
40
  iss: "api_keys/#{@key_id}",
42
- iat: now - TOKEN_LEEWAY,
43
- exp: now + TOKEN_EXPIRY - TOKEN_LEEWAY # TODO: Change to + TOKEN_LEEWAY soon, but for now max exp is 86400
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
- app: @instance_id,
122
+ instance: @instance_id,
125
123
  iss: "api_keys/#{@key_id}",
126
- iat: now - TOKEN_LEEWAY,
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.5.1
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: 2017-11-03 00:00:00.000000000 Z
11
+ date: 2018-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon