pusher-platform 0.2.0 → 0.3.1
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/app.rb +1 -9
- data/lib/pusher-platform/authenticator.rb +3 -3
- 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: 9c2d621a6b9915f71967e78ca6ad32130fc88049
|
4
|
+
data.tar.gz: de6d68d17c1df236de5b3cf67f6f3659334e8a27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c8dd63f3a5cc649125cd8cab1cca0e3262b003cfcd5ccdc441f027483384cb1838d4fbb2ba219ca67fc6d7523989f1ee0ed292a431a0868d25b86f937fa0dfb
|
7
|
+
data.tar.gz: c3dcf874cfe172b2f27983fc6249d6abf5e68d88007623b1b070540bf9ad929da2afb2a0a7987dac22584787959b9419dc3cb3714e8b010178741b20df8d6a49
|
data/lib/pusher-platform/app.rb
CHANGED
@@ -33,14 +33,6 @@ module Pusher
|
|
33
33
|
@client.request(options)
|
34
34
|
end
|
35
35
|
|
36
|
-
def config_request(options)
|
37
|
-
options = scope_request_options("config/apps", options)
|
38
|
-
if options[:jwt].nil?
|
39
|
-
options = options.merge({ jwt: generate_superuser_jwt() })
|
40
|
-
end
|
41
|
-
@client.request(options)
|
42
|
-
end
|
43
|
-
|
44
36
|
def authenticate(request, options)
|
45
37
|
@authenticator.authenticate(request, options)
|
46
38
|
end
|
@@ -58,7 +50,7 @@ module Pusher
|
|
58
50
|
now = Time.now.utc.to_i
|
59
51
|
claims = {
|
60
52
|
app: @app_id,
|
61
|
-
iss: @app_key_id,
|
53
|
+
iss: "api_keys/#{@app_key_id}",
|
62
54
|
su: true,
|
63
55
|
iat: now - 30, # some leeway for the server
|
64
56
|
exp: now + 60*5, # 5 minutes should be enough for a single request
|
@@ -42,7 +42,7 @@ module Pusher
|
|
42
42
|
def authenticate_with_refresh_token(old_refresh_jwt, options)
|
43
43
|
old_refresh_token = begin
|
44
44
|
JWT.decode(old_refresh_jwt, @app_key_secret, true, {
|
45
|
-
iss: @app_key_id,
|
45
|
+
iss: "api_keys/#{@app_key_id}",
|
46
46
|
verify_iss: true,
|
47
47
|
leeway: 30,
|
48
48
|
}).first
|
@@ -103,7 +103,7 @@ module Pusher
|
|
103
103
|
|
104
104
|
claims = {
|
105
105
|
app: @app_id,
|
106
|
-
iss: @app_key_id,
|
106
|
+
iss: "api_keys/#{@app_key_id}",
|
107
107
|
iat: now - TOKEN_LEEWAY,
|
108
108
|
exp: now + TOKEN_EXPIRY + TOKEN_LEEWAY,
|
109
109
|
sub: options[:user_id],
|
@@ -117,7 +117,7 @@ module Pusher
|
|
117
117
|
|
118
118
|
claims = {
|
119
119
|
app: @app_id,
|
120
|
-
iss: @app_key_id,
|
120
|
+
iss: "api_keys/#{@app_key_id}",
|
121
121
|
iat: now - TOKEN_LEEWAY,
|
122
122
|
refresh: true,
|
123
123
|
sub: options[:user_id],
|
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.3.1
|
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
|
+
date: 2017-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|