FIX: new relic CSP [SCI-8118][SCI-8119] (#5430)

Switch to newRelic manual browser agent using a nonce [SCI-8118][SCI-8119]
This commit is contained in:
Soufiane 2023-05-18 14:20:20 +02:00 committed by GitHub
parent 2adb908dc0
commit 351ba06840
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 1 deletions

View file

@ -22,3 +22,5 @@ function pageNumbers() {
}
});
}
$('#reports-footer-header-template').on('load', pageNumbers);

View file

@ -13,6 +13,9 @@
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag 'application', media: 'all' %>
<% if ::NewRelic::Agent.instance.started? %>
<%= ::NewRelic::Agent.browser_timing_header("nonce") %>
<% end %>
<%= javascript_include_tag 'jquery_bundle' %>
<%= javascript_include_tag 'application' %>
<%= javascript_include_tag 'application_pack' %>

View file

@ -4,7 +4,8 @@
<meta charset='utf-8' />
<%= javascript_include_tag wicked_pdf_asset_base64("reports/template_helpers") %>
</head>
<body onload="pageNumbers()">
<body id="reports-footer-header-template">
<%= javascript_include_tag 'reports/template_helpers', nonce: true %>
<%= yield %>
</body>
</html>

View file

@ -122,6 +122,7 @@ Rails.application.config.assets.precompile += %w(results/result_texts/new.js)
Rails.application.config.assets.precompile += %w(results/result_texts/edit.js)
Rails.application.config.assets.precompile += %w(shared/file_preview.js)
Rails.application.config.assets.precompile += %w(users/shared/linkedin_sign_in_links.js)
Rails.application.config.assets.precompile += %w(reports/template_helpers.js)
# Libraries needed for Handsontable formulas
Rails.application.config.assets.precompile += %w(jquery.js)

View file

@ -22,6 +22,10 @@ common: &default_settings
# Logging level for log/newrelic_agent.log
log_level: info
# Disable automatic browser agent
browser_monitoring:
auto_instrument: false
# Environment-specific settings are in this section.
# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment.