actionpack 5.2.1 → 7.0.2.4

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.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +264 -220
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +6 -6
  5. data/lib/abstract_controller/asset_paths.rb +1 -1
  6. data/lib/abstract_controller/base.rb +24 -4
  7. data/lib/abstract_controller/caching/fragments.rb +8 -24
  8. data/lib/abstract_controller/caching.rb +2 -2
  9. data/lib/abstract_controller/callbacks.rb +34 -8
  10. data/lib/abstract_controller/collector.rb +5 -4
  11. data/lib/abstract_controller/error.rb +1 -1
  12. data/lib/abstract_controller/helpers.rb +107 -90
  13. data/lib/abstract_controller/logger.rb +1 -1
  14. data/lib/abstract_controller/railties/routes_helpers.rb +19 -1
  15. data/lib/abstract_controller/rendering.rb +9 -9
  16. data/lib/abstract_controller/translation.rb +12 -5
  17. data/lib/abstract_controller/url_for.rb +4 -6
  18. data/lib/abstract_controller.rb +2 -0
  19. data/lib/action_controller/api.rb +5 -4
  20. data/lib/action_controller/base.rb +6 -9
  21. data/lib/action_controller/caching.rb +1 -3
  22. data/lib/action_controller/log_subscriber.rb +13 -9
  23. data/lib/action_controller/metal/basic_implicit_render.rb +1 -1
  24. data/lib/action_controller/metal/conditional_get.rb +57 -6
  25. data/lib/action_controller/metal/content_security_policy.rb +2 -3
  26. data/lib/action_controller/metal/cookies.rb +4 -2
  27. data/lib/action_controller/metal/data_streaming.rb +9 -18
  28. data/lib/action_controller/metal/default_headers.rb +17 -0
  29. data/lib/action_controller/metal/etag_with_template_digest.rb +4 -6
  30. data/lib/action_controller/metal/exceptions.rb +55 -12
  31. data/lib/action_controller/metal/flash.rb +10 -6
  32. data/lib/action_controller/metal/head.rb +7 -4
  33. data/lib/action_controller/metal/helpers.rb +15 -6
  34. data/lib/action_controller/metal/http_authentication.rb +41 -39
  35. data/lib/action_controller/metal/implicit_render.rb +5 -15
  36. data/lib/action_controller/metal/instrumentation.rb +59 -55
  37. data/lib/action_controller/metal/live.rb +80 -33
  38. data/lib/action_controller/metal/logging.rb +20 -0
  39. data/lib/action_controller/metal/mime_responds.rb +22 -7
  40. data/lib/action_controller/metal/parameter_encoding.rb +35 -4
  41. data/lib/action_controller/metal/params_wrapper.rb +50 -31
  42. data/lib/action_controller/metal/permissions_policy.rb +46 -0
  43. data/lib/action_controller/metal/redirecting.rb +93 -23
  44. data/lib/action_controller/metal/renderers.rb +4 -4
  45. data/lib/action_controller/metal/rendering.rb +14 -9
  46. data/lib/action_controller/metal/request_forgery_protection.rb +160 -58
  47. data/lib/action_controller/metal/rescue.rb +2 -2
  48. data/lib/action_controller/metal/streaming.rb +1 -4
  49. data/lib/action_controller/metal/strong_parameters.rb +236 -88
  50. data/lib/action_controller/metal/testing.rb +9 -2
  51. data/lib/action_controller/metal/url_for.rb +1 -1
  52. data/lib/action_controller/metal.rb +16 -17
  53. data/lib/action_controller/railtie.rb +49 -6
  54. data/lib/action_controller/railties/helpers.rb +1 -1
  55. data/lib/action_controller/renderer.rb +37 -13
  56. data/lib/action_controller/template_assertions.rb +1 -1
  57. data/lib/action_controller/test_case.rb +98 -68
  58. data/lib/action_controller.rb +4 -5
  59. data/lib/action_dispatch/http/cache.rb +45 -32
  60. data/lib/action_dispatch/http/content_disposition.rb +45 -0
  61. data/lib/action_dispatch/http/content_security_policy.rb +69 -56
  62. data/lib/action_dispatch/http/filter_parameters.rb +14 -8
  63. data/lib/action_dispatch/http/filter_redirect.rb +2 -3
  64. data/lib/action_dispatch/http/headers.rb +4 -4
  65. data/lib/action_dispatch/http/mime_negotiation.rb +44 -16
  66. data/lib/action_dispatch/http/mime_type.rb +47 -30
  67. data/lib/action_dispatch/http/parameters.rb +18 -27
  68. data/lib/action_dispatch/http/permissions_policy.rb +173 -0
  69. data/lib/action_dispatch/http/request.rb +49 -35
  70. data/lib/action_dispatch/http/response.rb +34 -26
  71. data/lib/action_dispatch/http/upload.rb +9 -1
  72. data/lib/action_dispatch/http/url.rb +86 -94
  73. data/lib/action_dispatch/journey/formatter.rb +55 -31
  74. data/lib/action_dispatch/journey/gtg/builder.rb +30 -46
  75. data/lib/action_dispatch/journey/gtg/simulator.rb +15 -8
  76. data/lib/action_dispatch/journey/gtg/transition_table.rb +78 -21
  77. data/lib/action_dispatch/journey/nfa/dot.rb +0 -11
  78. data/lib/action_dispatch/journey/nodes/node.rb +83 -16
  79. data/lib/action_dispatch/journey/parser.rb +13 -13
  80. data/lib/action_dispatch/journey/parser.y +1 -1
  81. data/lib/action_dispatch/journey/path/pattern.rb +42 -34
  82. data/lib/action_dispatch/journey/route.rb +14 -31
  83. data/lib/action_dispatch/journey/router/utils.rb +16 -14
  84. data/lib/action_dispatch/journey/router.rb +27 -35
  85. data/lib/action_dispatch/journey/routes.rb +3 -5
  86. data/lib/action_dispatch/journey/scanner.rb +10 -4
  87. data/lib/action_dispatch/journey/visitors.rb +1 -4
  88. data/lib/action_dispatch/journey/visualizer/fsm.js +49 -24
  89. data/lib/action_dispatch/journey/visualizer/index.html.erb +1 -1
  90. data/lib/action_dispatch/journey.rb +0 -2
  91. data/lib/action_dispatch/middleware/actionable_exceptions.rb +45 -0
  92. data/lib/action_dispatch/middleware/callbacks.rb +2 -4
  93. data/lib/action_dispatch/middleware/cookies.rb +136 -113
  94. data/lib/action_dispatch/middleware/debug_exceptions.rb +47 -68
  95. data/lib/action_dispatch/middleware/debug_locks.rb +8 -8
  96. data/lib/action_dispatch/middleware/debug_view.rb +66 -0
  97. data/lib/action_dispatch/middleware/exception_wrapper.rb +79 -30
  98. data/lib/action_dispatch/middleware/executor.rb +4 -1
  99. data/lib/action_dispatch/middleware/flash.rb +10 -12
  100. data/lib/action_dispatch/middleware/host_authorization.rb +159 -0
  101. data/lib/action_dispatch/middleware/public_exceptions.rb +6 -3
  102. data/lib/action_dispatch/middleware/remote_ip.rb +30 -20
  103. data/lib/action_dispatch/middleware/request_id.rb +5 -6
  104. data/lib/action_dispatch/middleware/server_timing.rb +33 -0
  105. data/lib/action_dispatch/middleware/session/abstract_store.rb +16 -3
  106. data/lib/action_dispatch/middleware/session/cache_store.rb +11 -6
  107. data/lib/action_dispatch/middleware/session/cookie_store.rb +24 -19
  108. data/lib/action_dispatch/middleware/show_exceptions.rb +20 -11
  109. data/lib/action_dispatch/middleware/ssl.rb +20 -15
  110. data/lib/action_dispatch/middleware/stack.rb +79 -7
  111. data/lib/action_dispatch/middleware/static.rb +150 -94
  112. data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
  113. data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
  114. data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +22 -0
  115. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +6 -11
  116. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
  117. data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +4 -2
  118. data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +46 -36
  119. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +8 -0
  120. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +7 -0
  121. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +25 -6
  122. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +1 -1
  123. data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +9 -6
  124. data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +4 -1
  125. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +121 -15
  126. data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +19 -0
  127. data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb +3 -0
  128. data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +5 -5
  129. data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +4 -4
  130. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +5 -5
  131. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +4 -4
  132. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +16 -2
  133. data/lib/action_dispatch/railtie.rb +16 -4
  134. data/lib/action_dispatch/request/session.rb +59 -22
  135. data/lib/action_dispatch/request/utils.rb +28 -2
  136. data/lib/action_dispatch/routing/inspector.rb +102 -54
  137. data/lib/action_dispatch/routing/mapper.rb +184 -156
  138. data/lib/action_dispatch/routing/polymorphic_routes.rb +21 -19
  139. data/lib/action_dispatch/routing/redirection.rb +4 -6
  140. data/lib/action_dispatch/routing/route_set.rb +83 -73
  141. data/lib/action_dispatch/routing/routes_proxy.rb +1 -1
  142. data/lib/action_dispatch/routing/url_for.rb +2 -3
  143. data/lib/action_dispatch/routing.rb +23 -22
  144. data/lib/action_dispatch/system_test_case.rb +65 -16
  145. data/lib/action_dispatch/system_testing/browser.rb +43 -16
  146. data/lib/action_dispatch/system_testing/driver.rb +42 -10
  147. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +58 -12
  148. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +3 -10
  149. data/lib/action_dispatch/testing/assertion_response.rb +0 -1
  150. data/lib/action_dispatch/testing/assertions/response.rb +4 -7
  151. data/lib/action_dispatch/testing/assertions/routing.rb +20 -8
  152. data/lib/action_dispatch/testing/assertions.rb +3 -6
  153. data/lib/action_dispatch/testing/integration.rb +61 -30
  154. data/lib/action_dispatch/testing/request_encoder.rb +2 -2
  155. data/lib/action_dispatch/testing/test_process.rb +8 -6
  156. data/lib/action_dispatch/testing/test_request.rb +3 -3
  157. data/lib/action_dispatch/testing/test_response.rb +4 -32
  158. data/lib/action_dispatch.rb +15 -7
  159. data/lib/action_pack/gem_version.rb +4 -4
  160. data/lib/action_pack.rb +1 -1
  161. metadata +44 -25
  162. data/lib/action_controller/metal/force_ssl.rb +0 -99
  163. data/lib/action_dispatch/http/parameter_filter.rb +0 -86
  164. data/lib/action_dispatch/journey/nfa/builder.rb +0 -78
  165. data/lib/action_dispatch/journey/nfa/simulator.rb +0 -49
  166. data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -120
  167. data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 7.0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-07 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.1
19
+ version: 7.0.2.4
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
- version: 5.2.1
26
+ version: 7.0.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.2.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.2.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rack-test
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +67,7 @@ dependencies:
61
67
  version: '1.0'
62
68
  - - ">="
63
69
  - !ruby/object:Gem::Version
64
- version: 1.0.2
70
+ version: 1.2.0
65
71
  type: :runtime
66
72
  prerelease: false
67
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,7 +77,7 @@ dependencies:
71
77
  version: '1.0'
72
78
  - - ">="
73
79
  - !ruby/object:Gem::Version
74
- version: 1.0.2
80
+ version: 1.2.0
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: rails-dom-testing
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -92,28 +98,28 @@ dependencies:
92
98
  requirements:
93
99
  - - '='
94
100
  - !ruby/object:Gem::Version
95
- version: 5.2.1
101
+ version: 7.0.2.4
96
102
  type: :runtime
97
103
  prerelease: false
98
104
  version_requirements: !ruby/object:Gem::Requirement
99
105
  requirements:
100
106
  - - '='
101
107
  - !ruby/object:Gem::Version
102
- version: 5.2.1
108
+ version: 7.0.2.4
103
109
  - !ruby/object:Gem::Dependency
104
110
  name: activemodel
105
111
  requirement: !ruby/object:Gem::Requirement
106
112
  requirements:
107
113
  - - '='
108
114
  - !ruby/object:Gem::Version
109
- version: 5.2.1
115
+ version: 7.0.2.4
110
116
  type: :development
111
117
  prerelease: false
112
118
  version_requirements: !ruby/object:Gem::Requirement
113
119
  requirements:
114
120
  - - '='
115
121
  - !ruby/object:Gem::Version
116
- version: 5.2.1
122
+ version: 7.0.2.4
117
123
  description: Web apps on Rails. Simple, battle-tested conventions for building and
118
124
  testing MVC web applications. Works with any Rack-compatible server.
119
125
  email: david@loudthinking.com
@@ -151,20 +157,22 @@ files:
151
157
  - lib/action_controller/metal/content_security_policy.rb
152
158
  - lib/action_controller/metal/cookies.rb
153
159
  - lib/action_controller/metal/data_streaming.rb
160
+ - lib/action_controller/metal/default_headers.rb
154
161
  - lib/action_controller/metal/etag_with_flash.rb
155
162
  - lib/action_controller/metal/etag_with_template_digest.rb
156
163
  - lib/action_controller/metal/exceptions.rb
157
164
  - lib/action_controller/metal/flash.rb
158
- - lib/action_controller/metal/force_ssl.rb
159
165
  - lib/action_controller/metal/head.rb
160
166
  - lib/action_controller/metal/helpers.rb
161
167
  - lib/action_controller/metal/http_authentication.rb
162
168
  - lib/action_controller/metal/implicit_render.rb
163
169
  - lib/action_controller/metal/instrumentation.rb
164
170
  - lib/action_controller/metal/live.rb
171
+ - lib/action_controller/metal/logging.rb
165
172
  - lib/action_controller/metal/mime_responds.rb
166
173
  - lib/action_controller/metal/parameter_encoding.rb
167
174
  - lib/action_controller/metal/params_wrapper.rb
175
+ - lib/action_controller/metal/permissions_policy.rb
168
176
  - lib/action_controller/metal/redirecting.rb
169
177
  - lib/action_controller/metal/renderers.rb
170
178
  - lib/action_controller/metal/rendering.rb
@@ -181,6 +189,7 @@ files:
181
189
  - lib/action_controller/test_case.rb
182
190
  - lib/action_dispatch.rb
183
191
  - lib/action_dispatch/http/cache.rb
192
+ - lib/action_dispatch/http/content_disposition.rb
184
193
  - lib/action_dispatch/http/content_security_policy.rb
185
194
  - lib/action_dispatch/http/filter_parameters.rb
186
195
  - lib/action_dispatch/http/filter_redirect.rb
@@ -188,8 +197,8 @@ files:
188
197
  - lib/action_dispatch/http/mime_negotiation.rb
189
198
  - lib/action_dispatch/http/mime_type.rb
190
199
  - lib/action_dispatch/http/mime_types.rb
191
- - lib/action_dispatch/http/parameter_filter.rb
192
200
  - lib/action_dispatch/http/parameters.rb
201
+ - lib/action_dispatch/http/permissions_policy.rb
193
202
  - lib/action_dispatch/http/rack_cache.rb
194
203
  - lib/action_dispatch/http/request.rb
195
204
  - lib/action_dispatch/http/response.rb
@@ -200,10 +209,7 @@ files:
200
209
  - lib/action_dispatch/journey/gtg/builder.rb
201
210
  - lib/action_dispatch/journey/gtg/simulator.rb
202
211
  - lib/action_dispatch/journey/gtg/transition_table.rb
203
- - lib/action_dispatch/journey/nfa/builder.rb
204
212
  - lib/action_dispatch/journey/nfa/dot.rb
205
- - lib/action_dispatch/journey/nfa/simulator.rb
206
- - lib/action_dispatch/journey/nfa/transition_table.rb
207
213
  - lib/action_dispatch/journey/nodes/node.rb
208
214
  - lib/action_dispatch/journey/parser.rb
209
215
  - lib/action_dispatch/journey/parser.y
@@ -218,17 +224,21 @@ files:
218
224
  - lib/action_dispatch/journey/visualizer/fsm.css
219
225
  - lib/action_dispatch/journey/visualizer/fsm.js
220
226
  - lib/action_dispatch/journey/visualizer/index.html.erb
227
+ - lib/action_dispatch/middleware/actionable_exceptions.rb
221
228
  - lib/action_dispatch/middleware/callbacks.rb
222
229
  - lib/action_dispatch/middleware/cookies.rb
223
230
  - lib/action_dispatch/middleware/debug_exceptions.rb
224
231
  - lib/action_dispatch/middleware/debug_locks.rb
232
+ - lib/action_dispatch/middleware/debug_view.rb
225
233
  - lib/action_dispatch/middleware/exception_wrapper.rb
226
234
  - lib/action_dispatch/middleware/executor.rb
227
235
  - lib/action_dispatch/middleware/flash.rb
236
+ - lib/action_dispatch/middleware/host_authorization.rb
228
237
  - lib/action_dispatch/middleware/public_exceptions.rb
229
238
  - lib/action_dispatch/middleware/reloader.rb
230
239
  - lib/action_dispatch/middleware/remote_ip.rb
231
240
  - lib/action_dispatch/middleware/request_id.rb
241
+ - lib/action_dispatch/middleware/server_timing.rb
232
242
  - lib/action_dispatch/middleware/session/abstract_store.rb
233
243
  - lib/action_dispatch/middleware/session/cache_store.rb
234
244
  - lib/action_dispatch/middleware/session/cookie_store.rb
@@ -237,17 +247,24 @@ files:
237
247
  - lib/action_dispatch/middleware/ssl.rb
238
248
  - lib/action_dispatch/middleware/stack.rb
239
249
  - lib/action_dispatch/middleware/static.rb
250
+ - lib/action_dispatch/middleware/templates/rescues/_actions.html.erb
251
+ - lib/action_dispatch/middleware/templates/rescues/_actions.text.erb
252
+ - lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb
240
253
  - lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
241
254
  - lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
242
255
  - lib/action_dispatch/middleware/templates/rescues/_source.html.erb
243
256
  - lib/action_dispatch/middleware/templates/rescues/_source.text.erb
244
257
  - lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
245
258
  - lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
259
+ - lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb
260
+ - lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb
246
261
  - lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
247
262
  - lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
248
263
  - lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
249
264
  - lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
250
265
  - lib/action_dispatch/middleware/templates/rescues/layout.erb
266
+ - lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb
267
+ - lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb
251
268
  - lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb
252
269
  - lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb
253
270
  - lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb
@@ -276,7 +293,6 @@ files:
276
293
  - lib/action_dispatch/system_testing/server.rb
277
294
  - lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
278
295
  - lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
279
- - lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
280
296
  - lib/action_dispatch/testing/assertion_response.rb
281
297
  - lib/action_dispatch/testing/assertions.rb
282
298
  - lib/action_dispatch/testing/assertions/response.rb
@@ -289,13 +305,17 @@ files:
289
305
  - lib/action_pack.rb
290
306
  - lib/action_pack/gem_version.rb
291
307
  - lib/action_pack/version.rb
292
- homepage: http://rubyonrails.org
308
+ homepage: https://rubyonrails.org
293
309
  licenses:
294
310
  - MIT
295
311
  metadata:
296
- source_code_uri: https://github.com/rails/rails/tree/v5.2.1/actionpack
297
- changelog_uri: https://github.com/rails/rails/blob/v5.2.1/actionpack/CHANGELOG.md
298
- post_install_message:
312
+ bug_tracker_uri: https://github.com/rails/rails/issues
313
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.2.4/actionpack/CHANGELOG.md
314
+ documentation_uri: https://api.rubyonrails.org/v7.0.2.4/
315
+ mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
316
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.2.4/actionpack
317
+ rubygems_mfa_required: 'true'
318
+ post_install_message:
299
319
  rdoc_options: []
300
320
  require_paths:
301
321
  - lib
@@ -303,7 +323,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
303
323
  requirements:
304
324
  - - ">="
305
325
  - !ruby/object:Gem::Version
306
- version: 2.2.2
326
+ version: 2.7.0
307
327
  required_rubygems_version: !ruby/object:Gem::Requirement
308
328
  requirements:
309
329
  - - ">="
@@ -311,9 +331,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
331
  version: '0'
312
332
  requirements:
313
333
  - none
314
- rubyforge_project:
315
- rubygems_version: 2.7.6
316
- signing_key:
334
+ rubygems_version: 3.1.6
335
+ signing_key:
317
336
  specification_version: 4
318
337
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
319
338
  test_files: []
@@ -1,99 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/core_ext/hash/except"
4
- require "active_support/core_ext/hash/slice"
5
-
6
- module ActionController
7
- # This module provides a method which will redirect the browser to use the secured HTTPS
8
- # protocol. This will ensure that users' sensitive information will be
9
- # transferred safely over the internet. You _should_ always force the browser
10
- # to use HTTPS when you're transferring sensitive information such as
11
- # user authentication, account information, or credit card information.
12
- #
13
- # Note that if you are really concerned about your application security,
14
- # you might consider using +config.force_ssl+ in your config file instead.
15
- # That will ensure all the data is transferred via HTTPS, and will
16
- # prevent the user from getting their session hijacked when accessing the
17
- # site over unsecured HTTP protocol.
18
- module ForceSSL
19
- extend ActiveSupport::Concern
20
- include AbstractController::Callbacks
21
-
22
- ACTION_OPTIONS = [:only, :except, :if, :unless]
23
- URL_OPTIONS = [:protocol, :host, :domain, :subdomain, :port, :path]
24
- REDIRECT_OPTIONS = [:status, :flash, :alert, :notice]
25
-
26
- module ClassMethods
27
- # Force the request to this particular controller or specified actions to be
28
- # through the HTTPS protocol.
29
- #
30
- # If you need to disable this for any reason (e.g. development) then you can use
31
- # an +:if+ or +:unless+ condition.
32
- #
33
- # class AccountsController < ApplicationController
34
- # force_ssl if: :ssl_configured?
35
- #
36
- # def ssl_configured?
37
- # !Rails.env.development?
38
- # end
39
- # end
40
- #
41
- # ==== URL Options
42
- # You can pass any of the following options to affect the redirect URL
43
- # * <tt>host</tt> - Redirect to a different host name
44
- # * <tt>subdomain</tt> - Redirect to a different subdomain
45
- # * <tt>domain</tt> - Redirect to a different domain
46
- # * <tt>port</tt> - Redirect to a non-standard port
47
- # * <tt>path</tt> - Redirect to a different path
48
- #
49
- # ==== Redirect Options
50
- # You can pass any of the following options to affect the redirect status and response
51
- # * <tt>status</tt> - Redirect with a custom status (default is 301 Moved Permanently)
52
- # * <tt>flash</tt> - Set a flash message when redirecting
53
- # * <tt>alert</tt> - Set an alert message when redirecting
54
- # * <tt>notice</tt> - Set a notice message when redirecting
55
- #
56
- # ==== Action Options
57
- # You can pass any of the following options to affect the before_action callback
58
- # * <tt>only</tt> - The callback should be run only for this action
59
- # * <tt>except</tt> - The callback should be run for all actions except this action
60
- # * <tt>if</tt> - A symbol naming an instance method or a proc; the
61
- # callback will be called only when it returns a true value.
62
- # * <tt>unless</tt> - A symbol naming an instance method or a proc; the
63
- # callback will be called only when it returns a false value.
64
- def force_ssl(options = {})
65
- action_options = options.slice(*ACTION_OPTIONS)
66
- redirect_options = options.except(*ACTION_OPTIONS)
67
- before_action(action_options) do
68
- force_ssl_redirect(redirect_options)
69
- end
70
- end
71
- end
72
-
73
- # Redirect the existing request to use the HTTPS protocol.
74
- #
75
- # ==== Parameters
76
- # * <tt>host_or_options</tt> - Either a host name or any of the URL and
77
- # redirect options available to the <tt>force_ssl</tt> method.
78
- def force_ssl_redirect(host_or_options = nil)
79
- unless request.ssl?
80
- options = {
81
- protocol: "https://",
82
- host: request.host,
83
- path: request.fullpath,
84
- status: :moved_permanently
85
- }
86
-
87
- if host_or_options.is_a?(Hash)
88
- options.merge!(host_or_options)
89
- elsif host_or_options
90
- options[:host] = host_or_options
91
- end
92
-
93
- secure_url = ActionDispatch::Http::URL.url_for(options.slice(*URL_OPTIONS))
94
- flash.keep if respond_to?(:flash) && request.respond_to?(:flash)
95
- redirect_to secure_url, options.slice(*REDIRECT_OPTIONS)
96
- end
97
- end
98
- end
99
- end
@@ -1,86 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/core_ext/object/duplicable"
4
-
5
- module ActionDispatch
6
- module Http
7
- class ParameterFilter
8
- FILTERED = "[FILTERED]".freeze # :nodoc:
9
-
10
- def initialize(filters = [])
11
- @filters = filters
12
- end
13
-
14
- def filter(params)
15
- compiled_filter.call(params)
16
- end
17
-
18
- private
19
-
20
- def compiled_filter
21
- @compiled_filter ||= CompiledFilter.compile(@filters)
22
- end
23
-
24
- class CompiledFilter # :nodoc:
25
- def self.compile(filters)
26
- return lambda { |params| params.dup } if filters.empty?
27
-
28
- strings, regexps, blocks = [], [], []
29
-
30
- filters.each do |item|
31
- case item
32
- when Proc
33
- blocks << item
34
- when Regexp
35
- regexps << item
36
- else
37
- strings << Regexp.escape(item.to_s)
38
- end
39
- end
40
-
41
- deep_regexps, regexps = regexps.partition { |r| r.to_s.include?("\\.".freeze) }
42
- deep_strings, strings = strings.partition { |s| s.include?("\\.".freeze) }
43
-
44
- regexps << Regexp.new(strings.join("|".freeze), true) unless strings.empty?
45
- deep_regexps << Regexp.new(deep_strings.join("|".freeze), true) unless deep_strings.empty?
46
-
47
- new regexps, deep_regexps, blocks
48
- end
49
-
50
- attr_reader :regexps, :deep_regexps, :blocks
51
-
52
- def initialize(regexps, deep_regexps, blocks)
53
- @regexps = regexps
54
- @deep_regexps = deep_regexps.any? ? deep_regexps : nil
55
- @blocks = blocks
56
- end
57
-
58
- def call(original_params, parents = [])
59
- filtered_params = original_params.class.new
60
-
61
- original_params.each do |key, value|
62
- parents.push(key) if deep_regexps
63
- if regexps.any? { |r| key =~ r }
64
- value = FILTERED
65
- elsif deep_regexps && (joined = parents.join(".")) && deep_regexps.any? { |r| joined =~ r }
66
- value = FILTERED
67
- elsif value.is_a?(Hash)
68
- value = call(value, parents)
69
- elsif value.is_a?(Array)
70
- value = value.map { |v| v.is_a?(Hash) ? call(v, parents) : v }
71
- elsif blocks.any?
72
- key = key.dup if key.duplicable?
73
- value = value.dup if value.duplicable?
74
- blocks.each { |b| b.call(key, value) }
75
- end
76
- parents.pop if deep_regexps
77
-
78
- filtered_params[key] = value
79
- end
80
-
81
- filtered_params
82
- end
83
- end
84
- end
85
- end
86
- end
@@ -1,78 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "action_dispatch/journey/nfa/transition_table"
4
- require "action_dispatch/journey/gtg/transition_table"
5
-
6
- module ActionDispatch
7
- module Journey # :nodoc:
8
- module NFA # :nodoc:
9
- class Visitor < Visitors::Visitor # :nodoc:
10
- def initialize(tt)
11
- @tt = tt
12
- @i = -1
13
- end
14
-
15
- def visit_CAT(node)
16
- left = visit(node.left)
17
- right = visit(node.right)
18
-
19
- @tt.merge(left.last, right.first)
20
-
21
- [left.first, right.last]
22
- end
23
-
24
- def visit_GROUP(node)
25
- from = @i += 1
26
- left = visit(node.left)
27
- to = @i += 1
28
-
29
- @tt.accepting = to
30
-
31
- @tt[from, left.first] = nil
32
- @tt[left.last, to] = nil
33
- @tt[from, to] = nil
34
-
35
- [from, to]
36
- end
37
-
38
- def visit_OR(node)
39
- from = @i += 1
40
- children = node.children.map { |c| visit(c) }
41
- to = @i += 1
42
-
43
- children.each do |child|
44
- @tt[from, child.first] = nil
45
- @tt[child.last, to] = nil
46
- end
47
-
48
- @tt.accepting = to
49
-
50
- [from, to]
51
- end
52
-
53
- def terminal(node)
54
- from_i = @i += 1 # new state
55
- to_i = @i += 1 # new state
56
-
57
- @tt[from_i, to_i] = node
58
- @tt.accepting = to_i
59
- @tt.add_memo(to_i, node.memo)
60
-
61
- [from_i, to_i]
62
- end
63
- end
64
-
65
- class Builder # :nodoc:
66
- def initialize(ast)
67
- @ast = ast
68
- end
69
-
70
- def transition_table
71
- tt = TransitionTable.new
72
- Visitor.new(tt).accept(@ast)
73
- tt
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "strscan"
4
-
5
- module ActionDispatch
6
- module Journey # :nodoc:
7
- module NFA # :nodoc:
8
- class MatchData # :nodoc:
9
- attr_reader :memos
10
-
11
- def initialize(memos)
12
- @memos = memos
13
- end
14
- end
15
-
16
- class Simulator # :nodoc:
17
- attr_reader :tt
18
-
19
- def initialize(transition_table)
20
- @tt = transition_table
21
- end
22
-
23
- def simulate(string)
24
- input = StringScanner.new(string)
25
- state = tt.eclosure(0)
26
- until input.eos?
27
- sym = input.scan(%r([/.?]|[^/.?]+))
28
-
29
- # FIXME: tt.eclosure is not needed for the GTG
30
- state = tt.eclosure(tt.move(state, sym))
31
- end
32
-
33
- acceptance_states = state.find_all { |s|
34
- tt.accepting?(tt.eclosure(s).sort.last)
35
- }
36
-
37
- return if acceptance_states.empty?
38
-
39
- memos = acceptance_states.flat_map { |x| tt.memo(x) }.compact
40
-
41
- MatchData.new(memos)
42
- end
43
-
44
- alias :=~ :simulate
45
- alias :match :simulate
46
- end
47
- end
48
- end
49
- end
@@ -1,120 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "action_dispatch/journey/nfa/dot"
4
-
5
- module ActionDispatch
6
- module Journey # :nodoc:
7
- module NFA # :nodoc:
8
- class TransitionTable # :nodoc:
9
- include Journey::NFA::Dot
10
-
11
- attr_accessor :accepting
12
- attr_reader :memos
13
-
14
- def initialize
15
- @table = Hash.new { |h, f| h[f] = {} }
16
- @memos = {}
17
- @accepting = nil
18
- @inverted = nil
19
- end
20
-
21
- def accepting?(state)
22
- accepting == state
23
- end
24
-
25
- def accepting_states
26
- [accepting]
27
- end
28
-
29
- def add_memo(idx, memo)
30
- @memos[idx] = memo
31
- end
32
-
33
- def memo(idx)
34
- @memos[idx]
35
- end
36
-
37
- def []=(i, f, s)
38
- @table[f][i] = s
39
- end
40
-
41
- def merge(left, right)
42
- @memos[right] = @memos.delete(left)
43
- @table[right] = @table.delete(left)
44
- end
45
-
46
- def states
47
- (@table.keys + @table.values.flat_map(&:keys)).uniq
48
- end
49
-
50
- # Returns set of NFA states to which there is a transition on ast symbol
51
- # +a+ from some state +s+ in +t+.
52
- def following_states(t, a)
53
- Array(t).flat_map { |s| inverted[s][a] }.uniq
54
- end
55
-
56
- # Returns set of NFA states to which there is a transition on ast symbol
57
- # +a+ from some state +s+ in +t+.
58
- def move(t, a)
59
- Array(t).map { |s|
60
- inverted[s].keys.compact.find_all { |sym|
61
- sym === a
62
- }.map { |sym| inverted[s][sym] }
63
- }.flatten.uniq
64
- end
65
-
66
- def alphabet
67
- inverted.values.flat_map(&:keys).compact.uniq.sort_by(&:to_s)
68
- end
69
-
70
- # Returns a set of NFA states reachable from some NFA state +s+ in set
71
- # +t+ on nil-transitions alone.
72
- def eclosure(t)
73
- stack = Array(t)
74
- seen = {}
75
- children = []
76
-
77
- until stack.empty?
78
- s = stack.pop
79
- next if seen[s]
80
-
81
- seen[s] = true
82
- children << s
83
-
84
- stack.concat(inverted[s][nil])
85
- end
86
-
87
- children.uniq
88
- end
89
-
90
- def transitions
91
- @table.flat_map { |to, hash|
92
- hash.map { |from, sym| [from, sym, to] }
93
- }
94
- end
95
-
96
- private
97
-
98
- def inverted
99
- return @inverted if @inverted
100
-
101
- @inverted = Hash.new { |h, from|
102
- h[from] = Hash.new { |j, s| j[s] = [] }
103
- }
104
-
105
- @table.each { |to, hash|
106
- hash.each { |from, sym|
107
- if sym
108
- sym = Nodes::Symbol === sym ? sym.regexp : sym.left
109
- end
110
-
111
- @inverted[from][sym] << to
112
- }
113
- }
114
-
115
- @inverted
116
- end
117
- end
118
- end
119
- end
120
- end