pusher-client 0.5.0 → 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/CHANGELOG.md +6 -0
- data/lib/pusher-client/socket.rb +10 -9
- data/lib/pusher-client/version.rb +1 -1
- data/pusher-client.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf04dc511a185b1a37118fb7aa892d5f7582ae51
|
4
|
+
data.tar.gz: 39c0e1be1d0b4452804727e9f33237ea398bbd67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28001be9d6969ed7a86bcfbed7507e3f292cd518a5230acf3203cc8573e140af69315b53ba20adcf686c008bf48e133e73e8350bbabb75044d1787edc5dfaaf
|
7
|
+
data.tar.gz: f96d506e8b24e69b922233ed3a85f660bbbfcf2b5e962ca5e633f088339dc712e528a5ba6ba05512d687fc743520a7674b8c68962061d74c7b33a5941b2a329e
|
data/CHANGELOG.md
CHANGED
data/lib/pusher-client/socket.rb
CHANGED
@@ -23,7 +23,8 @@ module PusherClient
|
|
23
23
|
@connected = false
|
24
24
|
@encrypted = options[:encrypted] || false
|
25
25
|
@logger = options[:logger] || PusherClient.logger
|
26
|
-
|
26
|
+
# :private_auth_method is deprecated
|
27
|
+
@auth_method = options[:auth_method] || options[:private_auth_method]
|
27
28
|
@cert_file = options[:cert_file]
|
28
29
|
@ws_host = options[:ws_host] || HOST
|
29
30
|
@ws_port = options[:ws_port] || WS_PORT
|
@@ -157,19 +158,19 @@ module PusherClient
|
|
157
158
|
end
|
158
159
|
|
159
160
|
def get_private_auth(channel)
|
160
|
-
if @
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
return @private_auth_method.call(@socket_id, channel)
|
166
|
-
end
|
161
|
+
return @auth_method.call(@socket_id, channel) if @auth_method
|
162
|
+
|
163
|
+
string_to_sign = @socket_id + ':' + channel.name
|
164
|
+
signature = hmac(@secret, string_to_sign)
|
165
|
+
"#{@key}:#{signature}"
|
167
166
|
end
|
168
167
|
|
169
168
|
def get_presence_auth(channel)
|
169
|
+
return @auth_method.call(@socket_id, channel) if @auth_method
|
170
|
+
|
170
171
|
string_to_sign = @socket_id + ':' + channel.name + ':' + channel.user_data
|
171
172
|
signature = hmac(@secret, string_to_sign)
|
172
|
-
|
173
|
+
"#{@key}:#{signature}"
|
173
174
|
end
|
174
175
|
|
175
176
|
|
data/pusher-client.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
s.licenses = ['MIT']
|
23
23
|
|
24
|
-
s.add_runtime_dependency 'websocket', '~> 1.
|
24
|
+
s.add_runtime_dependency 'websocket', '~> 1.0'
|
25
25
|
s.add_runtime_dependency 'json'
|
26
26
|
|
27
27
|
s.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-client
|
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
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: websocket
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: '1.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: '1.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|