twilio-ruby 4.11.1 → 4.12.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46a1a8030cd31061b6398f4408c2ae09a1610d74
4
- data.tar.gz: 441498bb90469f95575e1eb617cc14c7c69d6a86
3
+ metadata.gz: 9291a8f4dc70b794d8283de8570ef748ee625e74
4
+ data.tar.gz: 2c58fb91308924fe85dd255492ce139d916c875c
5
5
  SHA512:
6
- metadata.gz: fdbefd7bc8c73f621289949e663366496993887717bc351264f29d3ccfb8ef5020634b21da81ffb0fff2d7f3296e99b9fb1c4939c1c249b0d41c7a6e3b14455e
7
- data.tar.gz: 7820a04bc088cb43702a8efb6d5d1180e756f85087fffad5bda205887ca0d0b455ba273a0f88a42b98227dc89d856995d7198e79e1b0a0e69198b4e6c0c34f02
6
+ metadata.gz: 9630046dbd44aab682d5f008803048151d82bf7daeb0736cf35ec80f62e7310c9c4b0f2eddcc3961c1a3e1692265e5e5a45eba362cd84c395025c56eeae65718
7
+ data.tar.gz: 02e88f75a6cc3bf6a14930f82a3b5715ca20466bbaaceffcb34c3020031d17a5e45aeb92aa06f36f324c7a6ed7e4a57dca7772ab8d85946a8002048c532ee4eb
data/CHANGES.md CHANGED
@@ -1,6 +1,13 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ Version 4.12.0
5
+ --------------
6
+
7
+ Released September 1, 2016:
8
+
9
+ - Add voice grant.
10
+
4
11
  Version 4.11.1
5
12
  -------------
6
13
 
@@ -0,0 +1,25 @@
1
+ *Note: These issues are for bugs and feature requests for the helper libraries. If you need help or support, please email help@twilio.com and one of our experts will assist you!*
2
+
3
+
4
+ **Version:**
5
+ **API Subdomain (api/taskrouter/ip_messaging):**
6
+
7
+ ### Code Snippet
8
+ ```ruby
9
+ # paste code here
10
+ ```
11
+
12
+ ### Exception / Log
13
+ ```
14
+ <place exception / log here>
15
+ ```
16
+
17
+ ### Steps to Reproduce
18
+ 1.
19
+ 2.
20
+ 3.
21
+
22
+
23
+ ### Feature Request
24
+ _If this is a feature request, make sure you search Issues for an existing request before creating a new one!_
25
+
@@ -26,7 +26,6 @@ module Twilio
26
26
  now = Time.now.to_i - 1
27
27
  headers = {
28
28
  'cty' => 'twilio-fpa;v=1',
29
- 'typ' => 'JWT'
30
29
  }
31
30
 
32
31
  grants = {}
@@ -101,6 +100,41 @@ module Twilio
101
100
 
102
101
  end
103
102
 
103
+ class VoiceGrant
104
+ attr_accessor :outgoing_application_sid,
105
+ :outgoing_application_params,
106
+ :push_credential_sid,
107
+ :endpoint_id
108
+
109
+ def key
110
+ 'voice'
111
+ end
112
+
113
+ def payload
114
+ payload = {}
115
+
116
+ if outgoing_application_sid
117
+ outgoing = {}
118
+ outgoing[:application_sid] = outgoing_application_sid
119
+ if outgoing_application_params
120
+ outgoing[:params] = outgoing_application_params
121
+ end
122
+
123
+ payload[:outgoing] = outgoing
124
+ end
125
+
126
+ if push_credential_sid
127
+ payload[:push_credential_sid] = push_credential_sid
128
+ end
129
+
130
+ if endpoint_id
131
+ payload[:endpoint_id] = endpoint_id
132
+ end
133
+
134
+ payload
135
+ end
136
+ end
137
+
104
138
  end
105
139
  end
106
140
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '4.11.1'
2
+ VERSION = '4.12.1'
3
3
  end
@@ -111,4 +111,29 @@ describe Twilio::Util::AccessToken do
111
111
  expect(payload['grants']['ip_messaging']).not_to be_nil
112
112
  end
113
113
 
114
+ it 'should add programmable voice grant' do
115
+ scat = Twilio::Util::AccessToken.new 'AC123', 'SK123','secret'
116
+ pvg = Twilio::Util::AccessToken::VoiceGrant.new
117
+ pvg.outgoing_application_sid = 'AP123'
118
+ pvg.outgoing_application_params = { :foo => 'bar' }
119
+
120
+ scat.add_grant(pvg)
121
+
122
+ token = scat.to_s
123
+ expect(token).not_to be_nil
124
+ payload, header = JWT.decode token, 'secret'
125
+
126
+ expect(payload['iss']).to eq('SK123')
127
+ expect(payload['sub']).to eq('AC123')
128
+ expect(payload['exp']).not_to be_nil
129
+ expect(payload['exp']).to be >= Time.now.to_i
130
+ expect(payload['jti']).not_to be_nil
131
+ expect(payload['jti']).to start_with payload['iss']
132
+ expect(payload['grants']).not_to be_nil
133
+ expect(payload['grants'].count).to eq(1)
134
+ expect(payload['grants']['voice']).not_to be_nil
135
+ expect(payload['grants']['voice']['outgoing']['application_sid']).to eq('AP123')
136
+ expect(payload['grants']['voice']['outgoing']['params']['foo']).to eq('bar')
137
+ end
138
+
114
139
  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.11.1
4
+ version: 4.12.1
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-02-12 00:00:00.000000000 Z
11
+ date: 2016-09-01 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
- - .gitignore
80
- - .travis.yml
79
+ - ".gitignore"
80
+ - ".travis.yml"
81
81
  - AUTHORS.md
82
82
  - CHANGES.md
83
83
  - Gemfile
@@ -130,6 +130,7 @@ files:
130
130
  - examples/examples.rb
131
131
  - examples/print-call-log.rb
132
132
  - examples/taskrouter.examples.rb
133
+ - issue_template.md
133
134
  - lib/rack/twilio_webhook_authentication.rb
134
135
  - lib/twilio-ruby.rb
135
136
  - lib/twilio-ruby/rest/accounts.rb
@@ -285,27 +286,27 @@ licenses:
285
286
  metadata: {}
286
287
  post_install_message:
287
288
  rdoc_options:
288
- - --line-numbers
289
- - --inline-source
290
- - --title
289
+ - "--line-numbers"
290
+ - "--inline-source"
291
+ - "--title"
291
292
  - twilio-ruby
292
- - --main
293
+ - "--main"
293
294
  - README.md
294
295
  require_paths:
295
296
  - lib
296
297
  required_ruby_version: !ruby/object:Gem::Requirement
297
298
  requirements:
298
- - - '>='
299
+ - - ">="
299
300
  - !ruby/object:Gem::Version
300
301
  version: 1.9.3
301
302
  required_rubygems_version: !ruby/object:Gem::Requirement
302
303
  requirements:
303
- - - '>='
304
+ - - ">="
304
305
  - !ruby/object:Gem::Version
305
306
  version: '0'
306
307
  requirements: []
307
308
  rubyforge_project:
308
- rubygems_version: 2.0.14
309
+ rubygems_version: 2.5.1
309
310
  signing_key:
310
311
  specification_version: 4
311
312
  summary: A simple library for communicating with the Twilio REST API, building TwiML,