Skip to content

Commit

Permalink
Attempt to fix cross repo tests
Browse files Browse the repository at this point in the history
* Partial inserts cause test failures in ui-classic, content, and amazon provider
* Need to investigate the X-XSS-Protection change before using default of disabling it
* Allow deprecations to be found and fixed
  • Loading branch information
jrafanie committed Sep 6, 2024
1 parent 30b8e77 commit 1d788ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ class Application < Rails::Application
# https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92
config.load_defaults 7.0

# TODO: this is the only change we had from defaults in 7.0. See secure_headers.rb. It's 0 in defaults.
config.action_dispatch.default_headers["X-XSS-Protection"] = "1; mode=block"

# TODO: Find and fixed any deprecated behavior. Opt in later.
config.active_support.remove_deprecated_time_with_zone_name = false
config.active_support.disable_to_s_conversion = false

# TODO: If disabled, causes cross repo test failures in content, ui-classic and amazon provider
config.active_record.partial_inserts = true

# Disable this setting as it causes MiqRegion.seed to fail validation on belongs_to maintenance zone.
# TODO: We should fix this so we don't need to carry this override.
config.active_record.belongs_to_required_by_default = false
Expand Down
4 changes: 4 additions & 0 deletions config/initializers/secure_headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
config.x_content_type_options = "nosniff"
# X-XSS-Protection
# X-Permitted-Cross-Domain-Policies

#FYI, this was deprecated and disabled in rails 7. Using content security policy is the desired behavior going forward:
# https://github.com/rails/rails/commit/1f4714c3f798df227222f531141880b8e1b4170a
# https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L227
config.x_xss_protection = "1; mode=block"
config.referrer_policy = "no-referrer-when-downgrade"
# Content-Security-Policy
Expand Down

0 comments on commit 1d788ba

Please sign in to comment.