twilio-ruby 4.12.1 → 4.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +9 -2
- data/lib/twilio-ruby/util/access_token.rb +18 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/util/access_token_spec.rb +23 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7218785a4a8f89282d46a51699076d4fc7e5a3
|
4
|
+
data.tar.gz: e7e159586b45af05889de6c68d92442f29cabff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01719027a188f42cfc14c6ed04b326eaaf7099bd6ac80a56072d06c5ffc60219b98c3a1df7848fc326129332042aff183823a871b922f69102fa6ed73e73df4a
|
7
|
+
data.tar.gz: 391720c612c6f76393cbbe82e30938311251df72c551db2b9679a6b483450c351043126a5b92247a8b5c90f5465bb58c4c2a5384d2a10558a7e30cda37aeb397
|
data/CHANGES.md
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
-
Version 4.
|
4
|
+
Version 4.13.0
|
5
|
+
--------------
|
6
|
+
|
7
|
+
Released September 19, 2016:
|
8
|
+
|
9
|
+
- Add VideoGrant.
|
10
|
+
|
11
|
+
Version 4.12.1
|
5
12
|
--------------
|
6
13
|
|
7
14
|
Released September 1, 2016:
|
8
15
|
|
9
|
-
- Add
|
16
|
+
- Add VoiceGrant.
|
10
17
|
|
11
18
|
Version 4.11.1
|
12
19
|
-------------
|
@@ -135,6 +135,24 @@ module Twilio
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
class VideoGrant
|
139
|
+
attr_accessor :configuration_profile_sid
|
140
|
+
|
141
|
+
def key
|
142
|
+
'video'
|
143
|
+
end
|
144
|
+
|
145
|
+
def payload
|
146
|
+
payload = {}
|
147
|
+
|
148
|
+
if configuration_profile_sid
|
149
|
+
payload[:configuration_profile_sid] = configuration_profile_sid
|
150
|
+
end
|
151
|
+
|
152
|
+
payload
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
138
156
|
end
|
139
157
|
end
|
140
158
|
end
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -20,7 +20,7 @@ describe Twilio::Util::AccessToken do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'should generate a nbf' do
|
23
|
-
now = Time.now.to_i
|
23
|
+
now = Time.now.to_i - 1
|
24
24
|
scat = Twilio::Util::AccessToken.new 'AC123', 'SK123','secret'
|
25
25
|
scat.identity = 'abc'
|
26
26
|
scat.nbf = now
|
@@ -136,4 +136,26 @@ describe Twilio::Util::AccessToken do
|
|
136
136
|
expect(payload['grants']['voice']['outgoing']['params']['foo']).to eq('bar')
|
137
137
|
end
|
138
138
|
|
139
|
+
it 'should add video grant' do
|
140
|
+
scat = Twilio::Util::AccessToken.new 'AC123', 'SK123','secret'
|
141
|
+
vg = Twilio::Util::AccessToken::VideoGrant.new
|
142
|
+
vg.configuration_profile_sid = 'CP123'
|
143
|
+
|
144
|
+
scat.add_grant(vg)
|
145
|
+
|
146
|
+
token = scat.to_s
|
147
|
+
expect(token).not_to be_nil
|
148
|
+
payload, header = JWT.decode token, 'secret'
|
149
|
+
|
150
|
+
expect(payload['iss']).to eq('SK123')
|
151
|
+
expect(payload['sub']).to eq('AC123')
|
152
|
+
expect(payload['exp']).not_to be_nil
|
153
|
+
expect(payload['exp']).to be >= Time.now.to_i
|
154
|
+
expect(payload['jti']).not_to be_nil
|
155
|
+
expect(payload['jti']).to start_with payload['iss']
|
156
|
+
expect(payload['grants']).not_to be_nil
|
157
|
+
expect(payload['grants'].count).to eq(1)
|
158
|
+
expect(payload['grants']['video']).not_to be_nil
|
159
|
+
expect(payload['grants']['video']['configuration_profile_sid']).to eq('CP123')
|
160
|
+
end
|
139
161
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Benton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jwt
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.5'
|
69
69
|
description: A simple library for communicating with the Twilio REST API, building
|
@@ -76,8 +76,8 @@ extra_rdoc_files:
|
|
76
76
|
- README.md
|
77
77
|
- LICENSE.md
|
78
78
|
files:
|
79
|
-
-
|
80
|
-
-
|
79
|
+
- .gitignore
|
80
|
+
- .travis.yml
|
81
81
|
- AUTHORS.md
|
82
82
|
- CHANGES.md
|
83
83
|
- Gemfile
|
@@ -286,27 +286,27 @@ licenses:
|
|
286
286
|
metadata: {}
|
287
287
|
post_install_message:
|
288
288
|
rdoc_options:
|
289
|
-
-
|
290
|
-
-
|
291
|
-
-
|
289
|
+
- --line-numbers
|
290
|
+
- --inline-source
|
291
|
+
- --title
|
292
292
|
- twilio-ruby
|
293
|
-
-
|
293
|
+
- --main
|
294
294
|
- README.md
|
295
295
|
require_paths:
|
296
296
|
- lib
|
297
297
|
required_ruby_version: !ruby/object:Gem::Requirement
|
298
298
|
requirements:
|
299
|
-
- -
|
299
|
+
- - '>='
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: 1.9.3
|
302
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
303
|
requirements:
|
304
|
-
- -
|
304
|
+
- - '>='
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
307
|
requirements: []
|
308
308
|
rubyforge_project:
|
309
|
-
rubygems_version: 2.
|
309
|
+
rubygems_version: 2.0.14.1
|
310
310
|
signing_key:
|
311
311
|
specification_version: 4
|
312
312
|
summary: A simple library for communicating with the Twilio REST API, building TwiML,
|