actionpack 7.0.0.alpha2 → 7.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +139 -0
  3. data/lib/abstract_controller/callbacks.rb +15 -2
  4. data/lib/abstract_controller/translation.rb +4 -1
  5. data/lib/action_controller/log_subscriber.rb +1 -2
  6. data/lib/action_controller/metal/helpers.rb +1 -1
  7. data/lib/action_controller/metal/http_authentication.rb +2 -1
  8. data/lib/action_controller/metal/instrumentation.rb +2 -0
  9. data/lib/action_controller/metal/params_wrapper.rb +13 -4
  10. data/lib/action_controller/metal/redirecting.rb +58 -22
  11. data/lib/action_controller/metal/request_forgery_protection.rb +30 -34
  12. data/lib/action_controller/metal/strong_parameters.rb +60 -19
  13. data/lib/action_controller/railtie.rb +16 -10
  14. data/lib/action_controller/test_case.rb +13 -2
  15. data/lib/action_controller.rb +0 -1
  16. data/lib/action_dispatch/http/response.rb +0 -12
  17. data/lib/action_dispatch/http/url.rb +2 -9
  18. data/lib/action_dispatch/journey/nodes/node.rb +2 -2
  19. data/lib/action_dispatch/journey/route.rb +1 -1
  20. data/lib/action_dispatch/middleware/cookies.rb +1 -1
  21. data/lib/action_dispatch/middleware/executor.rb +3 -0
  22. data/lib/action_dispatch/middleware/host_authorization.rb +41 -21
  23. data/lib/action_dispatch/middleware/server_timing.rb +33 -0
  24. data/lib/action_dispatch/middleware/show_exceptions.rb +10 -0
  25. data/lib/action_dispatch/middleware/static.rb +0 -1
  26. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +1 -0
  27. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +2 -0
  28. data/lib/action_dispatch/routing/inspector.rb +1 -1
  29. data/lib/action_dispatch/routing/mapper.rb +10 -6
  30. data/lib/action_dispatch/routing/route_set.rb +5 -0
  31. data/lib/action_dispatch/system_test_case.rb +7 -1
  32. data/lib/action_dispatch/system_testing/browser.rb +2 -12
  33. data/lib/action_dispatch/system_testing/driver.rb +13 -9
  34. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -8
  35. data/lib/action_dispatch/testing/test_process.rb +1 -27
  36. data/lib/action_dispatch.rb +1 -0
  37. data/lib/action_pack/gem_version.rb +1 -1
  38. metadata +14 -13
  39. data/lib/action_controller/metal/query_tags.rb +0 -16
@@ -3,13 +3,16 @@
3
3
  module ActionDispatch
4
4
  module SystemTesting
5
5
  class Driver # :nodoc:
6
- def initialize(name, **options, &capabilities)
7
- @name = name
6
+ attr_reader :name
7
+
8
+ def initialize(driver_type, **options, &capabilities)
9
+ @driver_type = driver_type
8
10
  @screen_size = options[:screen_size]
9
11
  @options = options[:options] || {}
12
+ @name = @options.delete(:name) || driver_type
10
13
  @capabilities = capabilities
11
14
 
12
- if [:poltergeist, :webkit].include?(name)
15
+ if [:poltergeist, :webkit].include?(driver_type)
13
16
  ActiveSupport::Deprecation.warn <<~MSG.squish
14
17
  Poltergeist and capybara-webkit are not maintained already.
15
18
  Driver registration of :poltergeist or :webkit is deprecated and will be removed in Rails 7.1.
@@ -17,7 +20,8 @@ module ActionDispatch
17
20
  MSG
18
21
  end
19
22
 
20
- if name == :selenium
23
+ if driver_type == :selenium
24
+ gem "selenium-webdriver", ">= 4.0.0"
21
25
  require "selenium/webdriver"
22
26
  @browser = Browser.new(options[:using])
23
27
  @browser.preload
@@ -34,14 +38,14 @@ module ActionDispatch
34
38
 
35
39
  private
36
40
  def registerable?
37
- [:selenium, :poltergeist, :webkit, :cuprite, :rack_test].include?(@name)
41
+ [:selenium, :poltergeist, :webkit, :cuprite, :rack_test].include?(@driver_type)
38
42
  end
39
43
 
40
44
  def register
41
45
  @browser&.configure(&@capabilities)
42
46
 
43
- Capybara.register_driver @name do |app|
44
- case @name
47
+ Capybara.register_driver name do |app|
48
+ case @driver_type
45
49
  when :selenium then register_selenium(app)
46
50
  when :poltergeist then register_poltergeist(app)
47
51
  when :webkit then register_webkit(app)
@@ -52,7 +56,7 @@ module ActionDispatch
52
56
  end
53
57
 
54
58
  def browser_options
55
- @options.merge(options: @browser.options).compact
59
+ @options.merge(capabilities: @browser.options).compact
56
60
  end
57
61
 
58
62
  def register_selenium(app)
@@ -80,7 +84,7 @@ module ActionDispatch
80
84
  end
81
85
 
82
86
  def setup
83
- Capybara.current_driver = @name
87
+ Capybara.current_driver = name
84
88
  end
85
89
  end
86
90
  end
@@ -4,14 +4,6 @@ module ActionDispatch
4
4
  module SystemTesting
5
5
  module TestHelpers
6
6
  module SetupAndTeardown # :nodoc:
7
- def host!(host)
8
- ActiveSupport::Deprecation.warn \
9
- "ActionDispatch::SystemTestCase#host! is deprecated with no replacement. " \
10
- "Set Capybara.app_host directly or rely on Capybara's default host."
11
-
12
- Capybara.app_host = host
13
- end
14
-
15
7
  def before_teardown
16
8
  take_failed_screenshot
17
9
  ensure
@@ -17,33 +17,7 @@ module ActionDispatch
17
17
  #
18
18
  # post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png', :binary) }
19
19
  def fixture_file_upload(path, mime_type = nil, binary = false)
20
- if self.class.respond_to?(:fixture_path) && self.class.fixture_path &&
21
- !File.exist?(path)
22
- original_path = path
23
- path = Pathname.new(self.class.fixture_path).join(path)
24
-
25
- if !self.class.file_fixture_path
26
- ActiveSupport::Deprecation.warn(<<~EOM)
27
- Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
28
- In Rails 7.0, the path needs to be relative to `file_fixture_path` which you
29
- haven't set yet. Set `file_fixture_path` to discard this warning.
30
- EOM
31
- elsif path.exist?
32
- non_deprecated_path = Pathname(File.absolute_path(path)).relative_path_from(Pathname(File.absolute_path(self.class.file_fixture_path)))
33
-
34
- if Pathname(original_path) != non_deprecated_path
35
- ActiveSupport::Deprecation.warn(<<~EOM)
36
- Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
37
- In Rails 7.0, the path needs to be relative to `file_fixture_path`.
38
-
39
- Please modify the call from
40
- `fixture_file_upload("#{original_path}")` to `fixture_file_upload("#{non_deprecated_path}")`.
41
- EOM
42
- end
43
- else
44
- path = file_fixture(original_path)
45
- end
46
- elsif self.class.file_fixture_path && !File.exist?(path)
20
+ if self.class.file_fixture_path && !File.exist?(path)
47
21
  path = file_fixture(path)
48
22
  end
49
23
 
@@ -67,6 +67,7 @@ module ActionDispatch
67
67
  autoload :PublicExceptions
68
68
  autoload :Reloader
69
69
  autoload :RemoteIp
70
+ autoload :ServerTiming
70
71
  autoload :ShowExceptions
71
72
  autoload :SSL
72
73
  autoload :Static
@@ -10,7 +10,7 @@ module ActionPack
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = "alpha2"
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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: 7.0.0.alpha2
4
+ version: 7.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2021-12-06 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: 7.0.0.alpha2
19
+ version: 7.0.0.rc1
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: 7.0.0.alpha2
26
+ version: 7.0.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -98,28 +98,28 @@ dependencies:
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: 7.0.0.alpha2
101
+ version: 7.0.0.rc1
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - '='
107
107
  - !ruby/object:Gem::Version
108
- version: 7.0.0.alpha2
108
+ version: 7.0.0.rc1
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: activemodel
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - '='
114
114
  - !ruby/object:Gem::Version
115
- version: 7.0.0.alpha2
115
+ version: 7.0.0.rc1
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - '='
121
121
  - !ruby/object:Gem::Version
122
- version: 7.0.0.alpha2
122
+ version: 7.0.0.rc1
123
123
  description: Web apps on Rails. Simple, battle-tested conventions for building and
124
124
  testing MVC web applications. Works with any Rack-compatible server.
125
125
  email: david@loudthinking.com
@@ -173,7 +173,6 @@ files:
173
173
  - lib/action_controller/metal/parameter_encoding.rb
174
174
  - lib/action_controller/metal/params_wrapper.rb
175
175
  - lib/action_controller/metal/permissions_policy.rb
176
- - lib/action_controller/metal/query_tags.rb
177
176
  - lib/action_controller/metal/redirecting.rb
178
177
  - lib/action_controller/metal/renderers.rb
179
178
  - lib/action_controller/metal/rendering.rb
@@ -239,6 +238,7 @@ files:
239
238
  - lib/action_dispatch/middleware/reloader.rb
240
239
  - lib/action_dispatch/middleware/remote_ip.rb
241
240
  - lib/action_dispatch/middleware/request_id.rb
241
+ - lib/action_dispatch/middleware/server_timing.rb
242
242
  - lib/action_dispatch/middleware/session/abstract_store.rb
243
243
  - lib/action_dispatch/middleware/session/cache_store.rb
244
244
  - lib/action_dispatch/middleware/session/cookie_store.rb
@@ -310,10 +310,11 @@ licenses:
310
310
  - MIT
311
311
  metadata:
312
312
  bug_tracker_uri: https://github.com/rails/rails/issues
313
- changelog_uri: https://github.com/rails/rails/blob/v7.0.0.alpha2/actionpack/CHANGELOG.md
314
- documentation_uri: https://api.rubyonrails.org/v7.0.0.alpha2/
313
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc1/actionpack/CHANGELOG.md
314
+ documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
315
315
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
316
- source_code_uri: https://github.com/rails/rails/tree/v7.0.0.alpha2/actionpack
316
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc1/actionpack
317
+ rubygems_mfa_required: 'true'
317
318
  post_install_message:
318
319
  rdoc_options: []
319
320
  require_paths:
@@ -330,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
331
  version: 1.3.1
331
332
  requirements:
332
333
  - none
333
- rubygems_version: 3.1.6
334
+ rubygems_version: 3.2.22
334
335
  signing_key:
335
336
  specification_version: 4
336
337
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActionController
4
- module QueryTags # :nodoc:
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- around_action :expose_controller_to_query_logs
9
- end
10
-
11
- private
12
- def expose_controller_to_query_logs(&block)
13
- ActiveRecord::QueryLogs.set_context(controller: self, &block)
14
- end
15
- end
16
- end