twilio-ruby 5.61.2 → 5.64.0

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +124 -0
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +84 -21
  5. data/CHANGES.md +99 -0
  6. data/Makefile +3 -6
  7. data/README.md +5 -4
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +667 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
  11. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
  12. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +435 -0
  13. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +20 -20
  14. data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
  15. data/lib/twilio-ruby/rest/conversations.rb +9 -0
  16. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
  17. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  18. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  19. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  20. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  21. data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
  22. data/lib/twilio-ruby/rest/insights.rb +14 -0
  23. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
  24. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
  27. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  28. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
  29. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  30. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
  31. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  32. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
  33. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  34. data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
  35. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  36. data/lib/twilio-ruby/rest/verify.rb +2 -2
  37. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
  38. data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
  39. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  40. data/lib/twilio-ruby/rest/video/v1/room.rb +30 -5
  41. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  42. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  43. data/lib/twilio-ruby/rest/voice.rb +8 -0
  44. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
  45. data/lib/twilio-ruby/version.rb +1 -1
  46. data/sonar-project.properties +1 -1
  47. data/twilio-ruby.gemspec +0 -1
  48. metadata +10 -18
  49. data/.github/workflows/deploy.yml +0 -65
  50. data/.github/workflows/test.yml +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0744c60bf47ebe5674a6c2ea371fdda3ae937ef4
4
- data.tar.gz: a8d42def7f349fb8a99c035f59c3436d8f969fe9
3
+ metadata.gz: ac21b282f9cbe5b8fcf0409fa7640ee81595555b
4
+ data.tar.gz: 64f19f3e30a9fa224cab24fa89aa7dea5e2ef66d
5
5
  SHA512:
6
- metadata.gz: 0b62a9817b86b3f5e03c491072907cf359eff878d21b315f92848e9546a6f1f3664d29c1be464e17444bc15754af6079703f3e46d17f7845d9ed460ae9d8ff44
7
- data.tar.gz: 5612432558411b78da25b0b6e1dfcb4edd51ed710c3562cb9174fe6e93bcdc0cd88e55aa02dc19a361534dcbe3e88a52d3ca64ed6032ac42af2045547e30d70e
6
+ metadata.gz: a1d43a8631f36c4d04a29cb54dff8ff980fcfcc27416f71466aed84144e99fa512e68894b245274f63f8c5b162dad597bcb420e462000e9f45438d842e7cd118
7
+ data.tar.gz: 60dd90cdad8f348cce9185f13d7d78b0fa41e6d9e373a8ababbbf083ca30da0f85f2f00388f9e29f4dbae29c4daca28bb62806b32ae710bca449022c9cfc6253
@@ -0,0 +1,124 @@
1
+ name: Test and Deploy
2
+ on:
3
+ push:
4
+ branches: [ '*' ]
5
+ tags: [ '*' ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ schedule:
9
+ # Run automatically at 8AM PST Monday-Friday
10
+ - cron: '0 15 * * 1-5'
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ test:
15
+ name: Test
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 20
18
+ strategy:
19
+ matrix:
20
+ ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', 'ruby-head', 'jruby-9.2' ]
21
+ steps:
22
+ - name: Checkout twilio-ruby
23
+ uses: actions/checkout@v2
24
+ with:
25
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true
32
+
33
+ # Excludes incompatible versions of ruby
34
+ - name: Set up linter
35
+ run: bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
36
+ if: ${{ matrix.ruby != '2.4' }}
37
+
38
+ - run: bundle install --with development
39
+ - run: bundle exec rake install
40
+
41
+ - name: Run linter
42
+ run: bundle exec rubocop -d --cache true --parallel
43
+ if: ${{ matrix.ruby != '2.4' }}
44
+
45
+ - name: Run Unit Tests
46
+ run: make test
47
+
48
+ - name: Fix code coverage paths
49
+ if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.ruby == '3.0' && !github.event.pull_request.head.repo.fork }}
50
+ working-directory: ./coverage
51
+ run: |
52
+ sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.json
53
+
54
+ - name: SonarCloud Scan
55
+ if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.ruby == '3.0' && !github.event.pull_request.head.repo.fork }}
56
+ uses: SonarSource/sonarcloud-github-action@master
57
+ env:
58
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
59
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
60
+
61
+ deploy:
62
+ name: Deploy
63
+ if: success() && github.ref_type == 'tag'
64
+ needs: [ test ]
65
+ runs-on: ubuntu-latest
66
+ steps:
67
+ - name: Checkout twilio-ruby
68
+ uses: actions/checkout@v2
69
+ with:
70
+ fetch-depth: 0
71
+
72
+ - name: Set up Ruby
73
+ uses: ruby/setup-ruby@v1
74
+ with:
75
+ ruby-version: 2.4
76
+ bundler-cache: true
77
+
78
+ - run: bundle install
79
+
80
+ - name: Login to Docker Hub
81
+ uses: docker/login-action@v1
82
+ with:
83
+ username: ${{ secrets.DOCKER_USERNAME }}
84
+ password: ${{ secrets.DOCKER_AUTH_TOKEN }}
85
+
86
+ # The expression strips off the shortest match from the front of the string to yield just the tag name as the output
87
+ - name: Get tagged version
88
+ run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
89
+
90
+ - name: Create GitHub Release
91
+ uses: sendgrid/dx-automator/actions/release@main
92
+ env:
93
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94
+
95
+ - name: Build and Push image
96
+ run: make docker-build && make docker-push
97
+ - name: Publish to Rubygems
98
+ env:
99
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
100
+ run: |
101
+ mkdir -p $HOME/.gem
102
+ touch $HOME/.gem/credentials
103
+ chmod 0600 $HOME/.gem/credentials
104
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
105
+ gem build *.gemspec
106
+ gem push *.gem
107
+
108
+ notify-on-failure:
109
+ name: Slack notify on failure
110
+ if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
111
+ needs: [ test, deploy ]
112
+ runs-on: ubuntu-latest
113
+ steps:
114
+ - uses: rtCamp/action-slack-notify@v2
115
+ env:
116
+ SLACK_COLOR: failure
117
+ SLACK_ICON_EMOJI: ':github:'
118
+ SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
119
+ SLACK_TITLE: Action Failure - ${{ github.repository }}
120
+ SLACK_USERNAME: GitHub Actions
121
+ SLACK_MSG_AUTHOR: twilio-dx
122
+ SLACK_FOOTER: Posted automatically using GitHub Actions
123
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
124
+ MSG_MINIMAL: true
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.4
4
+ TargetRubyVersion: 2.5
5
5
  Exclude:
6
6
  - 'lib/twilio-ruby/rest/**/*'
7
7
  - 'spec/integration/**/*'
data/.rubocop_todo.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-04-29 14:57:47 -0500 using RuboCop version 0.82.0.
3
+ # on 2022-01-13 21:45:15 UTC using RuboCop version 1.24.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
9
+ # Offense count: 2
10
10
  # Cop supports --auto-correct.
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, Include.
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
12
  # Include: **/*.gemspec
13
13
  Gemspec/OrderedDependencies:
14
14
  Exclude:
@@ -28,13 +28,6 @@ Layout/EmptyLineAfterGuardClause:
28
28
  - 'lib/rack/twilio_webhook_authentication.rb'
29
29
  - 'lib/twilio-ruby/framework/serialize.rb'
30
30
 
31
- # Offense count: 1
32
- # Cop supports --auto-correct.
33
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
34
- Layout/ExtraSpacing:
35
- Exclude:
36
- - 'twilio-ruby.gemspec'
37
-
38
31
  # Offense count: 2
39
32
  # Cop supports --auto-correct.
40
33
  # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
@@ -53,6 +46,24 @@ Layout/SpaceInsideHashLiteralBraces:
53
46
  - 'spec/jwt/access_token_spec.rb'
54
47
  - 'spec/jwt/client_capability_spec.rb'
55
48
 
49
+ # Offense count: 3
50
+ # Configuration parameters: AllowedMethods.
51
+ # AllowedMethods: enums
52
+ Lint/ConstantDefinitionInBlock:
53
+ Exclude:
54
+ - 'spec/jwt/client_capability_spec.rb'
55
+ - 'spec/rest/client_spec.rb'
56
+
57
+ # Offense count: 1
58
+ Lint/MissingSuper:
59
+ Exclude:
60
+ - 'lib/twilio-ruby/framework/rest/error.rb'
61
+
62
+ # Offense count: 1
63
+ Lint/SelfAssignment:
64
+ Exclude:
65
+ - 'lib/twilio-ruby/framework/rest/version.rb'
66
+
56
67
  # Offense count: 1
57
68
  # Cop supports --auto-correct.
58
69
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
@@ -70,6 +81,7 @@ Lint/UnusedMethodArgument:
70
81
  - 'spec/holodeck/holodeck.rb'
71
82
 
72
83
  # Offense count: 1
84
+ # Cop supports --auto-correct.
73
85
  # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
74
86
  Lint/UselessAccessModifier:
75
87
  Exclude:
@@ -80,8 +92,14 @@ Lint/UselessAssignment:
80
92
  Exclude:
81
93
  - 'spec/rack/twilio_webhook_authentication_spec.rb'
82
94
 
95
+ # Offense count: 6
96
+ # Configuration parameters: Max, CountKeywordArgs.
97
+ Metrics/ParameterLists:
98
+ MaxOptionalParameters: 6
99
+
83
100
  # Offense count: 1
84
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
101
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
102
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
85
103
  # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
86
104
  Naming/FileName:
87
105
  Exclude:
@@ -89,20 +107,28 @@ Naming/FileName:
89
107
 
90
108
  # Offense count: 2
91
109
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
92
- # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
110
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
93
111
  Naming/MethodParameterName:
94
112
  Exclude:
95
113
  - 'lib/twilio-ruby/security/request_validator.rb'
96
114
 
97
115
  # Offense count: 19
98
- # Configuration parameters: EnforcedStyle.
116
+ # Configuration parameters: EnforcedStyle, AllowedIdentifiers.
99
117
  # SupportedStyles: snake_case, camelCase
100
118
  Naming/VariableName:
101
119
  Exclude:
102
120
  - 'spec/jwt/client_capability_spec.rb'
103
121
  - 'spec/jwt/task_router_spec.rb'
104
122
 
105
- # Offense count: 39
123
+ # Offense count: 3
124
+ # Cop supports --auto-correct.
125
+ Style/CaseLikeIf:
126
+ Exclude:
127
+ - 'lib/twilio-ruby/framework/serialize.rb'
128
+ - 'lib/twilio-ruby/jwt/task_router.rb'
129
+
130
+ # Offense count: 40
131
+ # Configuration parameters: AllowedConstants.
106
132
  Style/Documentation:
107
133
  Enabled: false
108
134
 
@@ -119,28 +145,36 @@ Style/ExpandPathArguments:
119
145
  - 'spec/spec_helper.rb'
120
146
  - 'twilio-ruby.gemspec'
121
147
 
122
- # Offense count: 23
148
+ # Offense count: 24
123
149
  # Cop supports --auto-correct.
124
150
  # Configuration parameters: EnforcedStyle.
125
151
  # SupportedStyles: always, always_true, never
126
152
  Style/FrozenStringLiteralComment:
127
153
  Enabled: false
128
154
 
155
+ # Offense count: 1
156
+ # Cop supports --auto-correct.
157
+ Style/GlobalStdStream:
158
+ Exclude:
159
+ - 'spec/rest/client_spec.rb'
160
+
129
161
  # Offense count: 3
130
162
  # Configuration parameters: MinBodyLength.
131
163
  Style/GuardClause:
132
164
  Exclude:
133
165
  - 'lib/twilio-ruby/framework/rest/page.rb'
134
166
 
135
- # Offense count: 1
167
+ # Offense count: 2
136
168
  # Cop supports --auto-correct.
137
- # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
169
+ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
138
170
  # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
171
+ # SupportedShorthandSyntax: always, never
139
172
  Style/HashSyntax:
140
173
  Exclude:
174
+ - 'Gemfile'
141
175
  - 'spec/jwt/access_token_spec.rb'
142
176
 
143
- # Offense count: 12
177
+ # Offense count: 13
144
178
  # Cop supports --auto-correct.
145
179
  Style/IfUnlessModifier:
146
180
  Exclude:
@@ -150,6 +184,20 @@ Style/IfUnlessModifier:
150
184
  - 'lib/twilio-ruby/jwt/client_capability.rb'
151
185
  - 'lib/twilio-ruby/jwt/jwt.rb'
152
186
 
187
+ # Offense count: 3
188
+ # Cop supports --auto-correct.
189
+ Style/RedundantAssignment:
190
+ Exclude:
191
+ - 'lib/twilio-ruby/jwt/access_token.rb'
192
+ - 'lib/twilio-ruby/jwt/client_capability.rb'
193
+ - 'lib/twilio-ruby/jwt/task_router.rb'
194
+
195
+ # Offense count: 2
196
+ # Cop supports --auto-correct.
197
+ Style/RedundantFileExtensionInRequire:
198
+ Exclude:
199
+ - 'spec/spec_helper.rb'
200
+
153
201
  # Offense count: 4
154
202
  # Cop supports --auto-correct.
155
203
  Style/RedundantFreeze:
@@ -173,15 +221,30 @@ Style/RegexpLiteral:
173
221
  - 'lib/twilio-ruby/framework/rest/version.rb'
174
222
  - 'spec/rack/twilio_webhook_authentication_spec.rb'
175
223
 
176
- # Offense count: 5
224
+ # Offense count: 12
225
+ # Cop supports --auto-correct.
226
+ # Configuration parameters: Mode.
227
+ Style/StringConcatenation:
228
+ Exclude:
229
+ - 'examples/print_call_log.rb'
230
+ - 'lib/twilio-ruby/framework/request.rb'
231
+ - 'lib/twilio-ruby/framework/rest/error.rb'
232
+ - 'lib/twilio-ruby/framework/serialize.rb'
233
+ - 'lib/twilio-ruby/http/http_client.rb'
234
+ - 'lib/twilio-ruby/jwt/client_capability.rb'
235
+ - 'spec/framework/request_spec.rb'
236
+ - 'spec/spec_helper.rb'
237
+
238
+ # Offense count: 7
177
239
  # Cop supports --auto-correct.
178
240
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
179
241
  # SupportedStyles: single_quotes, double_quotes
180
242
  Style/StringLiterals:
181
243
  Exclude:
244
+ - 'Gemfile'
182
245
  - 'spec/framework/serialize_spec.rb'
183
246
 
184
- # Offense count: 14
247
+ # Offense count: 15
185
248
  # Cop supports --auto-correct.
186
249
  # Configuration parameters: AllowNamedUnderscoreVariables.
187
250
  Style/TrailingUnderscoreVariable:
@@ -190,7 +253,7 @@ Style/TrailingUnderscoreVariable:
190
253
  - 'spec/jwt/client_capability_spec.rb'
191
254
  - 'spec/jwt/task_router_spec.rb'
192
255
 
193
- # Offense count: 15
256
+ # Offense count: 16
194
257
  # Cop supports --auto-correct.
195
258
  # Configuration parameters: MinSize, WordRegex.
196
259
  # SupportedStyles: percent, brackets
data/CHANGES.md CHANGED
@@ -1,6 +1,105 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2022-02-09] Version 5.64.0
5
+ ---------------------------
6
+ **Library - Chore**
7
+ - [PR #594](https://github.com/twilio/twilio-ruby/pull/594): upgrade supported language versions. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
8
+
9
+ **Api**
10
+ - Add `stream` resource
11
+
12
+ **Conversations**
13
+ - Fixed DELETE request to accept "sid_like" params in Address Configuration resources **(breaking change)**
14
+ - Expose Address Configuration resource for `sms` and `whatsapp`
15
+
16
+ **Fax**
17
+ - Removed deprecated Programmable Fax Create and Update methods **(breaking change)**
18
+
19
+ **Insights**
20
+ - Rename `call_state` to `call_status` and remove `whisper` in conference participant summary **(breaking change)**
21
+
22
+ **Numbers**
23
+ - Expose valid_until filters as part of provisionally-approved compliance feature on the List Bundles resource
24
+
25
+ **Supersim**
26
+ - Fix typo in Fleet resource docs
27
+ - Updated documentation for the Fleet resource indicating that fields related to commands have been deprecated and to use sms_command fields instead.
28
+ - Add support for setting and reading `ip_commands_url` and `ip_commands_method` on Fleets resource for helper libraries
29
+ - Changed `sim` property in requests to create an SMS Command made to the /SmsCommands to accept SIM UniqueNames in addition to SIDs
30
+
31
+ **Verify**
32
+ - Update list attempts API to include new filters and response fields.
33
+
34
+
35
+ [2022-01-26] Version 5.63.1
36
+ ---------------------------
37
+ **Library - Fix**
38
+ - [PR #590](https://github.com/twilio/twilio-ruby/pull/590): Validate signatures in Rack middleware for non-form-data payloads. Thanks to [@gabrielg](https://github.com/gabrielg)!
39
+
40
+ **Library - Chore**
41
+ - [PR #589](https://github.com/twilio/twilio-ruby/pull/589): Add sonarcloud analysis. Thanks to [@BrimmingDev](https://github.com/BrimmingDev)!
42
+ - [PR #588](https://github.com/twilio/twilio-ruby/pull/588): support for rubocop linting on ruby-head. Thanks to [@Hunga1](https://github.com/Hunga1)!
43
+
44
+ **Insights**
45
+ - Added new endpoint to fetch Conference Participant Summary
46
+ - Added new endpoint to fetch Conference Summary
47
+
48
+ **Messaging**
49
+ - Add government_entity parameter to brand apis
50
+
51
+ **Verify**
52
+ - Add Access Token fetch endpoint to retrieve a previously created token.
53
+ - Add Access Token payload to the Access Token creation endpoint, including a unique Sid, so it's addressable while it's TTL is valid.
54
+
55
+
56
+ [2022-01-12] Version 5.63.0
57
+ ---------------------------
58
+ **Library - Feature**
59
+ - [PR #586](https://github.com/twilio/twilio-ruby/pull/586): add GitHub release step during deploy. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
60
+
61
+ **Library - Chore**
62
+ - [PR #584](https://github.com/twilio/twilio-ruby/pull/584): run yard in bundle context. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
63
+ - [PR #583](https://github.com/twilio/twilio-ruby/pull/583): remove githook dependency from make install. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
64
+
65
+ **Api**
66
+ - Make fixed time scheduling parameters public **(breaking change)**
67
+
68
+ **Messaging**
69
+ - Add update brand registration API
70
+
71
+ **Numbers**
72
+ - Add API endpoint for List Bundle Copies resource
73
+
74
+ **Video**
75
+ - Enable external storage for all customers
76
+
77
+
78
+ [2021-12-15] Version 5.62.0
79
+ ---------------------------
80
+ **Library - Feature**
81
+ - [PR #581](https://github.com/twilio/twilio-ruby/pull/581): run tests before deploying. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
82
+
83
+ **Api**
84
+ - Add optional boolean send_as_mms parameter to the create action of Message resource **(breaking change)**
85
+ - Change team ownership for `call` delete
86
+
87
+ **Conversations**
88
+ - Change wording for `Service Webhook Configuration` resource fields
89
+
90
+ **Insights**
91
+ - Added new APIs for updating and getting voice insights flags by accountSid.
92
+
93
+ **Media**
94
+ - Add max_duration param to MediaProcessor
95
+
96
+ **Video**
97
+ - Add `EmptyRoomTimeout` and `UnusedRoomTimeout` properties to a room; add corresponding parameters to room creation
98
+
99
+ **Voice**
100
+ - Add endpoint to delete archived Calls
101
+
102
+
4
103
  [2021-12-01] Version 5.61.2
5
104
  ---------------------------
6
105
  **Library - Chore**
data/Makefile CHANGED
@@ -3,17 +3,14 @@
3
3
  githooks:
4
4
  ln -sf ../../githooks/pre-commit .git/hooks/pre-commit
5
5
 
6
- install: githooks
6
+ install:
7
7
  bundle install --with development; bundle exec rake install
8
8
 
9
- test: lint
9
+ test:
10
10
  bundle exec rake spec
11
11
 
12
- lint:
13
- bundle exec rubocop -d --cache true --parallel
14
-
15
12
  docs:
16
- yard doc --output-dir ./doc
13
+ bundle exec yard doc --output-dir ./doc
17
14
 
18
15
  authors:
19
16
  echo "Authors\n=======\n\nA huge thanks to all of our contributors:\n\n" > AUTHORS.md
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # twilio-ruby
2
2
 
3
- [![Tests](https://github.com/twilio/twilio-ruby/actions/workflows/test.yml/badge.svg)][github-actions]
3
+ [![Tests](https://github.com/twilio/twilio-ruby/actions/workflows/test-and-deploy.yml/badge.svg)][github-actions]
4
4
  [![Gem Version](https://img.shields.io/gem/v/twilio-ruby.svg)](https://rubygems.org/gems/twilio-ruby)
5
5
  [![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest&message=Learn%20to%20contribute%21&color=F22F46&labelColor=1f243c&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAAZGRkcHBwjIyMoKCgAAABgYGBoaGiAgICMjIyzs7PJycnMzMzNzc3UoBfd3d3m5ubqrhfrMEDu7u739/f4vSb/3AD///9tbdyEAAAABXRSTlMAAAAAAMJrBrEAAAKoSURBVHgB7ZrRcuI6EESdyxXGYoNFvMD//+l2bSszRgyUYpFAsXOeiJGmj4NkuWx1Qeh+Ekl9DgEXOBwOx+Px5xyQhDykfgq4wG63MxxaR4ddIkg6Ul3g84vCIcjPBA5gmUMeXESrlukuoK33+33uID8TWeLAdOWsKpJYzwVMB7bOzYSGOciyUlXSn0/ABXTosJ1M1SbypZ4O4MbZuIDMU02PMbauhhHMHXbmebmALIiEbbbbbUrpF1gwE9kFfRNAJaP+FQEXCCTGyJ4ngDrjOFo3jEL5JdqjF/pueR4cCeCGgAtwmuRS6gDwaRiGvu+DMFwSBLTE3+jF8JyuV1okPZ+AC4hDFhCHyHQjdjPHUKFDlHSJkHQXMB3KpSwXNGJPcwwTdZiXlRN0gSp0zpWxNtM0beYE0nRH6QIbO7rawwXaBYz0j78gxjokDuv12gVeUuBD0MDi0OQCLvDaAho4juP1Q/jkAncXqIcCfd+7gAu4QLMACCLxpRsSuQh0igu0C9Svhi7weAGZg50L3IE3cai4IfkNZAC8dfdhsUD3CgKBVC9JE5ABAFzg4QL/taYPAAWrHdYcgfLaIgAXWJ7OV38n1LEF8tt2TH29E+QAoDoO5Ve/LtCQDmKM9kPbvCEBApK+IXzbcSJ0cIGF6e8gpcRhUDogWZ8JnaWjPXc/fNnBBUKRngiHgTUSivSzDRDgHZQOLvBQgf8rRt+VdBUUhwkU6VpJ+xcOwQUqZr+mR0kvBUgv6cB4+37hQAkXqE8PwGisGhJtN4xAHMzrsgvI7rccXqSvKh6jltGlrOHA3Xk1At3LC4QiPdX9/0ndHpGVvTjR4bZA1ypAKgVcwE5vx74ulwIugDt8e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)
6
6
 
@@ -25,6 +25,7 @@ This library supports the following Ruby implementations:
25
25
  * Ruby 2.6
26
26
  * Ruby 2.7
27
27
  * Ruby 3.0
28
+ * Ruby 3.1
28
29
 
29
30
  ### Migrating from 4.x
30
31
 
@@ -35,13 +36,13 @@ This library supports the following Ruby implementations:
35
36
  To install using [Bundler][bundler] grab the latest stable version:
36
37
 
37
38
  ```ruby
38
- gem 'twilio-ruby', '~> 5.61.2'
39
+ gem 'twilio-ruby', '~> 5.64.0'
39
40
  ```
40
41
 
41
42
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
42
43
 
43
44
  ```bash
44
- gem install twilio-ruby -v 5.61.2
45
+ gem install twilio-ruby -v 5.64.0
45
46
  ```
46
47
 
47
48
  To build and install the development branch yourself from the latest source:
@@ -257,7 +258,7 @@ If you've instead found a bug in the library or would like new features added, g
257
258
  [bundler]: https://bundler.io
258
259
  [rubygems]: https://rubygems.org
259
260
  [gem]: https://rubygems.org/gems/twilio
260
- [github-actions]: https://github.com/twilio/twilio-ruby/actions/workflows/test.yml
261
+ [github-actions]: https://github.com/twilio/twilio-ruby/actions/workflows/test-and-deploy.yml
261
262
  [upgrade]: https://github.com/twilio/twilio-ruby/wiki/Ruby-Version-5.x-Upgrade-Guide
262
263
  [issues]: https://github.com/twilio/twilio-ruby/issues
263
264
  [faraday]: https://github.com/lostisland/faraday
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rack/media_type'
4
+
3
5
  module Rack
4
6
  # Middleware that authenticates webhooks from Twilio using the request
5
7
  # validator.
@@ -19,6 +21,10 @@ module Rack
19
21
  # doesn't validate then the middleware responds immediately with a 403 status.
20
22
 
21
23
  class TwilioWebhookAuthentication
24
+ # Rack's FORM_DATA_MEDIA_TYPES can be modified to taste, so we're slightly
25
+ # more conservative in what we consider form data.
26
+ FORM_URLENCODED_MEDIA_TYPE = Rack::MediaType.type('application/x-www-form-urlencoded')
27
+
22
28
  def initialize(app, auth_token, *paths, &auth_token_lookup)
23
29
  @app = app
24
30
  @auth_token = auth_token
@@ -30,7 +36,7 @@ module Rack
30
36
  return @app.call(env) unless env['PATH_INFO'].match(@path_regex)
31
37
  request = Rack::Request.new(env)
32
38
  original_url = request.url
33
- params = request.post? ? request.POST : {}
39
+ params = extract_params!(request)
34
40
  auth_token = @auth_token || get_auth_token(params['AccountSid'])
35
41
  validator = Twilio::Security::RequestValidator.new(auth_token)
36
42
  signature = env['HTTP_X_TWILIO_SIGNATURE'] || ''
@@ -44,5 +50,23 @@ module Rack
44
50
  ]
45
51
  end
46
52
  end
53
+
54
+ # Extract the params from the the request that we can use to determine the
55
+ # signature. This _may_ modify the passed in request since it may read/rewind
56
+ # the body.
57
+ def extract_params!(request)
58
+ return {} unless request.post?
59
+
60
+ if request.media_type == FORM_URLENCODED_MEDIA_TYPE
61
+ request.POST
62
+ else
63
+ request.body.rewind
64
+ body = request.body.read
65
+ request.body.rewind
66
+ body
67
+ end
68
+ end
69
+
70
+ private :extract_params!
47
71
  end
48
72
  end