opentok 2.2.3 → 2.2.4
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/.travis.yml +1 -0
- data/DEVELOPING.md +2 -0
- data/Rakefile +5 -0
- data/lib/opentok/client.rb +3 -4
- data/lib/opentok/token_generator.rb +3 -3
- data/lib/opentok/version.rb +1 -1
- data/spec/cassettes/OpenTok_Archives/should_create_archives.yml +1 -1
- data/spec/cassettes/OpenTok_Archives/should_create_named_archives.yml +1 -2
- data/spec/cassettes/OpenTok_Archives/should_stop_archives.yml +1 -4
- data/spec/matchers/token.rb +3 -2
- 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: 5cee4e37d52a813e5b61449188d03d0a679ab00a
|
4
|
+
data.tar.gz: bcfd00abc717c38236c0358375616c1947d35698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85739d5bb678e7af843692b30ace91d862552a8b749031bd35991415a9b0cf806d0daf79a381e03558baec66ff10071e012400294595df31fa88692a04c7e2f7
|
7
|
+
data.tar.gz: a85cdc9408a6df9babe9507ba71c001eae8c7a37de6a41211a0e96473b3ee0da1df25cce92e4aa292f914e6a3a37aed90f22bfdaab16847f5606df29b148b6b7
|
data/.travis.yml
CHANGED
data/DEVELOPING.md
CHANGED
@@ -50,6 +50,8 @@ In order to create a release, the following should be completed in order.
|
|
50
50
|
1. Change the version number for future development by adding ".alpha.1", then make another commit with the message
|
51
51
|
"Beginning development on next version".
|
52
52
|
1. Push the changes to the main repository (`git push origin master`).
|
53
|
+
1. Add a description to the [GitHub Releases](https://github.com/opentok/opentok-ruby-sdk/releases) page
|
54
|
+
with any notable changes. Upload the built gem as an attachment.
|
53
55
|
|
54
56
|
## Workflow
|
55
57
|
|
data/Rakefile
CHANGED
data/lib/opentok/client.rb
CHANGED
@@ -31,7 +31,7 @@ module OpenTok
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def start_archive(session_id, opts)
|
34
|
-
body = { "sessionId" => session_id
|
34
|
+
body = { "sessionId" => session_id }
|
35
35
|
body["name"] = opts[:name] unless opts[:name].nil?
|
36
36
|
response = self.class.post("/v2/partner/#{@api_key}/archive", {
|
37
37
|
:body => body.to_json,
|
@@ -85,8 +85,7 @@ module OpenTok
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def stop_archive(archive_id)
|
88
|
-
response = self.class.post("/v2/partner/#{@api_key}/archive/#{archive_id}", {
|
89
|
-
:body => { "action" => "stop" }.to_json,
|
88
|
+
response = self.class.post("/v2/partner/#{@api_key}/archive/#{archive_id}/stop", {
|
90
89
|
:headers => { "Content-Type" => "application/json" }
|
91
90
|
})
|
92
91
|
case response.code
|
@@ -101,7 +100,7 @@ module OpenTok
|
|
101
100
|
when 409
|
102
101
|
raise OpenTokArchiveError, "The archive could not be stopped. The archive is not currently recording."
|
103
102
|
else
|
104
|
-
raise OpenTokArchiveError, "The archive could not be
|
103
|
+
raise OpenTokArchiveError, "The archive could not be stopped."
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
@@ -3,7 +3,7 @@ require "opentok/session"
|
|
3
3
|
|
4
4
|
require "base64"
|
5
5
|
require "addressable/uri"
|
6
|
-
require "
|
6
|
+
require "openssl"
|
7
7
|
require "active_support/time"
|
8
8
|
|
9
9
|
module OpenTok
|
@@ -81,11 +81,11 @@ module OpenTok
|
|
81
81
|
end
|
82
82
|
data_params[:connection_data] = data
|
83
83
|
end
|
84
|
-
|
84
|
+
digest = OpenSSL::Digest.new('sha1')
|
85
85
|
data_string = Addressable::URI.form_encode data_params
|
86
86
|
meta_string = Addressable::URI.form_encode({
|
87
87
|
:partner_id => api_key,
|
88
|
-
:sig =>
|
88
|
+
:sig => OpenSSL::HMAC.hexdigest(digest, api_secret, data_string)
|
89
89
|
})
|
90
90
|
|
91
91
|
TOKEN_SENTINEL + Base64.strict_encode64(meta_string + ":" + data_string)
|
data/lib/opentok/version.rb
CHANGED
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://api.opentok.com/v2/partner/123456/archive
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"sessionId":"SESSIONID","
|
8
|
+
string: '{"sessionId":"SESSIONID","name":""}'
|
9
9
|
headers:
|
10
10
|
X-Tb-Partner-Auth:
|
11
11
|
- 123456:1234567890abcdef1234567890abcdef1234567890
|
@@ -5,8 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://api.opentok.com/v2/partner/123456/archive
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"sessionId":"SESSIONID","
|
9
|
-
NAME"}'
|
8
|
+
string: '{"sessionId":"SESSIONID","name":"ARCHIVE NAME"}'
|
10
9
|
headers:
|
11
10
|
X-Tb-Partner-Auth:
|
12
11
|
- 123456:1234567890abcdef1234567890abcdef1234567890
|
@@ -2,10 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.opentok.com/v2/partner/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: '{"action":"stop"}'
|
5
|
+
uri: https://api.opentok.com/v2/partner/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/stop
|
9
6
|
headers:
|
10
7
|
X-Tb-Partner-Auth:
|
11
8
|
- 123456:1234567890abcdef1234567890abcdef1234567890
|
data/spec/matchers/token.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "rspec/matchers"
|
2
2
|
|
3
3
|
require "base64"
|
4
|
-
require "
|
4
|
+
require "openssl"
|
5
5
|
require "addressable/uri"
|
6
6
|
|
7
7
|
RSpec::Matchers.define :carry_token_data do |input_data|
|
@@ -40,9 +40,10 @@ RSpec::Matchers.define :carry_valid_token_signature do |api_secret|
|
|
40
40
|
match do |token|
|
41
41
|
decoded_token = Base64.decode64(token[4..token.length])
|
42
42
|
metadata, data_string = decoded_token.split(':')
|
43
|
+
digest = OpenSSL::Digest.new('sha1')
|
43
44
|
# form_unencode returns an array of arrays, annoying so hardcoded lookup
|
44
45
|
# expected format: [["partner_id", "..."], ["sig", "..."]]
|
45
46
|
signature = Addressable::URI.form_unencode(metadata)[1][1]
|
46
|
-
signature ==
|
47
|
+
signature == OpenSSL::HMAC.hexdigest(digest, api_secret, data_string)
|
47
48
|
end
|
48
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stijn Mathysen
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|