ably 0.8.9 → 0.8.10
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 +4 -4
- data/CHANGELOG.md +18 -4
- data/README.md +2 -2
- data/lib/ably/rest/client.rb +1 -1
- data/lib/ably/version.rb +1 -1
- data/spec/shared/client_initializer_behaviour.rb +3 -3
- data/spec/unit/models/token_details_spec.rb +28 -0
- 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: ebdb3de0d61032d4177a8fe51975ac1967e7fe9e
|
4
|
+
data.tar.gz: 5cdaef2668a7e4fd9eac0027115bac896c8438f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa4df9755c680ddb24e927bfd82fcce0cb8909bad91b8d91e367a1d14b14ff3accc83dd4c668e4dec0a734be9ef82e56c8eb31f2d20f6b71bec8432ca1082ab
|
7
|
+
data.tar.gz: 8dc667ac95090f550e9606fac468f89f4029979955967da6aba5b31ded8ac7a3d3be24c40b6f2074a519ff8aae52e038bb5d983c5cc11b2122ccadd43267482f
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v0.8.
|
3
|
+
## [v0.8.9](https://github.com/ably/ably-ruby/tree/v0.8.9) (2016-04-01)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.
|
5
|
+
[Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.9...v0.8.10)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- API keys have hyphens
|
10
|
+
|
11
|
+
## [v0.8.9](https://github.com/ably/ably-ruby/tree/v0.8.9) (2016-03-01)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.8...v0.8.9)
|
6
14
|
|
7
15
|
**Fixed bugs:**
|
8
16
|
|
@@ -14,14 +22,20 @@
|
|
14
22
|
|
15
23
|
- New Crypto Spec [\#80](https://github.com/ably/ably-ruby/issues/80)
|
16
24
|
|
17
|
-
- Support :key in ClientOptions and deprecate :api\_key [\#73](https://github.com/ably/ably-ruby/issues/73)
|
18
|
-
|
19
25
|
**Merged pull requests:**
|
20
26
|
|
21
27
|
- Various fixes for open issues [\#82](https://github.com/ably/ably-ruby/pull/82) ([mattheworiordan](https://github.com/mattheworiordan))
|
22
28
|
|
23
29
|
- Encryption spec update [\#81](https://github.com/ably/ably-ruby/pull/81) ([mattheworiordan](https://github.com/mattheworiordan))
|
24
30
|
|
31
|
+
## [v0.8.8](https://github.com/ably/ably-ruby/tree/v0.8.8) (2016-01-26)
|
32
|
+
|
33
|
+
[Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.7...v0.8.8)
|
34
|
+
|
35
|
+
**Closed issues:**
|
36
|
+
|
37
|
+
- Support :key in ClientOptions and deprecate :api\_key [\#73](https://github.com/ably/ably-ruby/issues/73)
|
38
|
+
|
25
39
|
## [v0.8.7](https://github.com/ably/ably-ruby/tree/v0.8.7) (2015-12-31)
|
26
40
|
|
27
41
|
[Full Changelog](https://github.com/ably/ably-ruby/compare/v0.8.6...v0.8.7)
|
data/README.md
CHANGED
@@ -227,10 +227,10 @@ secret_key = Ably::Util::Crypto.generate_random_key
|
|
227
227
|
channel = client.channels.get('test', cipher: { key: secret_key })
|
228
228
|
channel.publish nil, "sensitive data" # data will be encrypted before publish
|
229
229
|
messages_page = channel.history
|
230
|
-
messages_page.first.data #=> "sensitive data"
|
230
|
+
messages_page.items.first.data #=> "sensitive data"
|
231
231
|
```
|
232
232
|
|
233
|
-
### Generate Token
|
233
|
+
### Generate a Token
|
234
234
|
|
235
235
|
Tokens are issued by Ably and are readily usable by any client to connect to Ably:
|
236
236
|
|
data/lib/ably/rest/client.rb
CHANGED
@@ -120,7 +120,7 @@ module Ably
|
|
120
120
|
|
121
121
|
options = options.clone
|
122
122
|
if options.kind_of?(String)
|
123
|
-
options = if options.match(/^[\w]{2,}\.[\w]{2,}:[\w]{2,}$/)
|
123
|
+
options = if options.match(/^[\w-]{2,}\.[\w-]{2,}:[\w-]{2,}$/)
|
124
124
|
{ key: options }
|
125
125
|
else
|
126
126
|
{ token: options }
|
data/lib/ably/version.rb
CHANGED
@@ -106,18 +106,18 @@ shared_examples 'a client initializer' do
|
|
106
106
|
allow_any_instance_of(subject.class).to receive(:auto_connect).and_return(false)
|
107
107
|
end
|
108
108
|
|
109
|
-
let(:client_options) { '
|
109
|
+
let(:client_options) { 'App.k3y:sec-r3t' }
|
110
110
|
|
111
111
|
it 'sets the key' do
|
112
112
|
expect(subject.auth.key).to eql(client_options)
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'sets the key_name' do
|
116
|
-
expect(subject.auth.key_name).to eql('
|
116
|
+
expect(subject.auth.key_name).to eql('App.k3y')
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'sets the key_secret' do
|
120
|
-
expect(subject.auth.key_secret).to eql('
|
120
|
+
expect(subject.auth.key_secret).to eql('sec-r3t')
|
121
121
|
end
|
122
122
|
|
123
123
|
it 'uses basic auth' do
|
@@ -118,4 +118,32 @@ describe Ably::Models::TokenDetails do
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
121
|
+
|
122
|
+
context 'to_json' do
|
123
|
+
let(:token_json_parsed) { JSON.parse(Ably::Models::TokenDetails(token_attributes).to_json) }
|
124
|
+
|
125
|
+
context 'with all attributes and values' do
|
126
|
+
let(:token_attributes) do
|
127
|
+
{ token: random_str, capability: random_str, keyName: random_str, issued: Time.now.to_i, expires: Time.now.to_i + 10, clientId: random_str }
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'returns all attributes' do
|
131
|
+
token_attributes.each do |key, val|
|
132
|
+
expect(token_json_parsed[key.to_s]).to eql(val)
|
133
|
+
end
|
134
|
+
expect(token_attributes.keys.length).to eql(token_json_parsed.keys.length)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
context 'with only a token string' do
|
139
|
+
let(:token_attributes) do
|
140
|
+
{ token: random_str }
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'returns populated attributes' do
|
144
|
+
expect(token_json_parsed['token']).to eql(token_attributes[:token])
|
145
|
+
expect(token_json_parsed.keys.length).to eql(1)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
121
149
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ably
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lewis Marshall
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|