opentok 4.8.1 → 4.9.0

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
  SHA256:
3
- metadata.gz: c5299537135033f2ae95169f0a47017542fc51ac3bcf24e469219d3f00db5cda
4
- data.tar.gz: 655c9293034b05b48f39f5f15809d0550f4774c5a097fb49bcf2aa46611e2c44
3
+ metadata.gz: bf1e7d0f61794792bf98909f86601643c30df2cb2343297dcca0e8df7397d93a
4
+ data.tar.gz: 2c336b28cd586be0f082770b8854fd7f222d4c7047ba060a2fe300c31bf2417f
5
5
  SHA512:
6
- metadata.gz: 8b83473744134b0754c092d2a98e6d28af5a80c6ee373c48c8569af75cf84fc0106321c6a7b8e72ec253379bc4a4e431069a3c62fdcf45f7fba172ebf61e700f
7
- data.tar.gz: b6946da6f229d0030fde0a09a9e969c7906f7da54151ed1f749b6af9bcd0ea0e1787521a73a98c23cebbaa60df4b8e79bddd39acd2d8367b721909488f65bc26
6
+ metadata.gz: 2730c26df934c6fb413f177db04bdc048ea58285bf2dbd640d90873a9f2670f31264141f08280cf393860eb8b11f7b525f2ef61e5d450d5c15d0fe0437addc5d
7
+ data.tar.gz: 3c6570e28e20be4c471ca6313fe1f6da293927637d78594288da2043fcde7b4a810113df5038c2aa8f836c30e8045c47fe6dd48ee3123dfad1df4db67058839e
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.9.0
2
+
3
+ * Adds the `publisheronly` role for client token creation. See [#272](https://github.com/opentok/OpenTok-Ruby-SDK/pull/272)
4
+
1
5
  # 4.8.1
2
6
 
3
7
  * Fixes a bug with the `Archives#create` method. See [#269](https://github.com/opentok/OpenTok-Ruby-SDK/pull/269) and [#270](https://github.com/opentok/OpenTok-Ruby-SDK/pull/270)
data/README.md CHANGED
@@ -20,6 +20,16 @@ The OpenTok Ruby SDK provides methods for:
20
20
  * Working with OpenTok [Experience Composers](https://tokbox.com/developer/guides/experience-composer)
21
21
  * Working with OpenTok [Audio Connector](https://tokbox.com/developer/guides/audio-connector)
22
22
 
23
+ ## Note!
24
+
25
+ This library is designed to work with the Tokbox/OpenTok platform, part of the Vonage Video API. If you are looking to use the Vonage Video API and using the Vonage Customer Dashboard, you will want to install the [Vonage Server SDK for Ruby](https://github.com/Vonage/vonage-ruby-sdk), which includes support for the Vonage Video API.
26
+
27
+ Not sure which exact platform you are using? Take a look at [this guide](https://api.support.vonage.com/hc/en-us/articles/10817774782492).
28
+
29
+ If you are using the Tokbox platform, do not worry! The Tokbox platform is not going away, and this library will continue to be updated. While we encourage customers to check out the new Unified platform, there is no rush to switch. Both platforms run the exact same infrastructure and capabilities, with the main difference is a unified billing interface and easier access to [Vonage’s other CPaaS APIs](https://www.vonage.com/communications-apis/).
30
+
31
+ If you are new to the Vonage Video API, head on over to the [Vonage Customer Dashboard](https://dashboard.vonage.com) to sign up for a developer account and check out the [Vonage Server SDK for Ruby](https://github.com/Vonage/vonage-ruby-sdk).
32
+
23
33
  ## Installation
24
34
 
25
35
  ### Bundler (recommended):
@@ -2,7 +2,7 @@ module OpenTok
2
2
  require "set"
3
3
  API_URL = "https://api.opentok.com"
4
4
  TOKEN_SENTINEL = "T1=="
5
- ROLES = { subscriber: "subscriber", publisher: "publisher", moderator: "moderator" }
5
+ ROLES = { subscriber: "subscriber", publisher: "publisher", moderator: "moderator", publisheronly: "publisheronly" }
6
6
  ARCHIVE_MODES = ::Set.new([:manual, :always])
7
7
  AUTH_EXPIRE = 300
8
8
  end
@@ -1,4 +1,4 @@
1
1
  module OpenTok
2
2
  # @private
3
- VERSION = '4.8.1'
3
+ VERSION = '4.9.0'
4
4
  end
@@ -50,7 +50,29 @@ shared_examples "opentok generates tokens" do
50
50
  expect(expiring_token).to carry_valid_token_signature api_secret
51
51
  end
52
52
 
53
- it "generates tokens with a role" do
53
+ it "generates tokens with a publisher role" do
54
+ role = :publisher
55
+ role_token = opentok.generate_token session_id, :role => role
56
+ expect(role_token).to be_an_instance_of String
57
+ expect(role_token).to carry_token_data :session_id => session_id
58
+ expect(role_token).to carry_token_data :api_key => api_key
59
+ expect(role_token).to carry_token_data :role => role
60
+ expect(role_token).to carry_token_data [:nonce, :create_time]
61
+ expect(role_token).to carry_valid_token_signature api_secret
62
+ end
63
+
64
+ it "generates tokens with a subscriber role" do
65
+ role = :subscriber
66
+ role_token = opentok.generate_token session_id, :role => role
67
+ expect(role_token).to be_an_instance_of String
68
+ expect(role_token).to carry_token_data :session_id => session_id
69
+ expect(role_token).to carry_token_data :api_key => api_key
70
+ expect(role_token).to carry_token_data :role => role
71
+ expect(role_token).to carry_token_data [:nonce, :create_time]
72
+ expect(role_token).to carry_valid_token_signature api_secret
73
+ end
74
+
75
+ it "generates tokens with a moderator role" do
54
76
  role = :moderator
55
77
  role_token = opentok.generate_token session_id, :role => role
56
78
  expect(role_token).to be_an_instance_of String
@@ -61,6 +83,17 @@ shared_examples "opentok generates tokens" do
61
83
  expect(role_token).to carry_valid_token_signature api_secret
62
84
  end
63
85
 
86
+ it "generates tokens with a publisheronly role" do
87
+ role = :publisheronly
88
+ role_token = opentok.generate_token session_id, :role => role
89
+ expect(role_token).to be_an_instance_of String
90
+ expect(role_token).to carry_token_data :session_id => session_id
91
+ expect(role_token).to carry_token_data :api_key => api_key
92
+ expect(role_token).to carry_token_data :role => role
93
+ expect(role_token).to carry_token_data [:nonce, :create_time]
94
+ expect(role_token).to carry_valid_token_signature api_secret
95
+ end
96
+
64
97
  it "generates tokens with data" do
65
98
  data = "name=Johnny"
66
99
  data_bearing_token = opentok.generate_token session_id, :data => data
@@ -97,6 +130,11 @@ shared_examples "opentok generates tokens" do
97
130
  expect(layout_class_bearing_token).to carry_valid_token_signature api_secret
98
131
  end
99
132
 
133
+ context "when the role is invalid" do
134
+ it "raises an error" do
135
+ expect { opentok.generate_token session_id, :role => :invalid_role }.to raise_error
136
+ end
137
+ end
100
138
 
101
139
  # TODO a context about using a bad session_id
102
140
  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: 4.8.1
4
+ version: 4.9.0
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: 2024-01-03 00:00:00.000000000 Z
15
+ date: 2024-04-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubygems_version: 3.5.3
358
+ rubygems_version: 3.5.4
359
359
  signing_key:
360
360
  specification_version: 4
361
361
  summary: Ruby gem for the OpenTok API