opentok 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dffed69e7386516ebc1f8d614cb08d0446796b8b
4
- data.tar.gz: 273669ac8cfd0b3f6115e555ef4e94628d208261
3
+ metadata.gz: 5cee4e37d52a813e5b61449188d03d0a679ab00a
4
+ data.tar.gz: bcfd00abc717c38236c0358375616c1947d35698
5
5
  SHA512:
6
- metadata.gz: 8bac951b35a12efa2458bb9e0678fb1bf5dd2a71be575796a94b9c65d60cc9b57d460c38bedf1295152db81d1c3789fd5557b0da05ba9c0d9daf53dc0af6d5f5
7
- data.tar.gz: d03cae5de75bb2aa2934c7cc735fbba4a8ed23acf59222d2689efd921a3707c876e95376b744b974ea22384e91cd0584a7fc1f478e4379a193264f06efd27da2
6
+ metadata.gz: 85739d5bb678e7af843692b30ace91d862552a8b749031bd35991415a9b0cf806d0daf79a381e03558baec66ff10071e012400294595df31fa88692a04c7e2f7
7
+ data.tar.gz: a85cdc9408a6df9babe9507ba71c001eae8c7a37de6a41211a0e96473b3ee0da1df25cce92e4aa292f914e6a3a37aed90f22bfdaab16847f5606df29b148b6b7
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.0
6
+ - 2.2.0
6
7
  - rbx-2
7
8
  notifications:
8
9
  slack:
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
@@ -9,4 +9,9 @@ YARD::Rake::YardocTask.new do |t|
9
9
  # t.options = ['--any', '--extra', '--opts'] # optional
10
10
  end
11
11
 
12
+ desc "Open an irb session preloaded with this library"
13
+ task :console do
14
+ sh "irb -rubygems -I lib -r opentok.rb"
15
+ end
16
+
12
17
  task :default => :spec
@@ -31,7 +31,7 @@ module OpenTok
31
31
  end
32
32
 
33
33
  def start_archive(session_id, opts)
34
- body = { "sessionId" => session_id, "action" => "start" }
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 started."
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 "digest/hmac"
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 => Digest::HMAC.hexdigest(data_string, api_secret, Digest::SHA1)
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)
@@ -1,4 +1,4 @@
1
1
  module OpenTok
2
2
  # @private
3
- VERSION = '2.2.3'
3
+ VERSION = '2.2.4'
4
4
  end
@@ -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","action":"start","name":""}'
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","action":"start","name":"ARCHIVE
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
@@ -1,7 +1,7 @@
1
1
  require "rspec/matchers"
2
2
 
3
3
  require "base64"
4
- require "digest/hmac"
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 == Digest::HMAC.hexdigest(data_string, api_secret, Digest::SHA1)
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.3
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: 2014-09-23 00:00:00.000000000 Z
15
+ date: 2015-02-17 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler