Skip to content

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Jun 30, 2025

Rationale

Two enhancements to address strict CSP limitations:

  1. Ability to override object-src: 'none' ; directive, providing allowed hosts. https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=53226
  2. Inject nonce attributes and values into R report HTML outputs that have <script> tags. https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=53211

Related Pull Requests

Tasks

{
if (exists(file))
return PageFlowUtil.getFileContentsAsString(file);
return PageFlowUtil.addScriptNonces(PageFlowUtil.getFileContentsAsString(file));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine. I'm curious about all the R caching scenarios, but I think this happens "late".

*/
public static String addScriptNonces(String html)
{
Document doc = JSoupUtil.convertHtmlToDocument(StringUtils.trimToEmpty(html), false, new LinkedList<>());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course this will do various transformations to the code if it is not well-formed. I guess I'm alright with that.

@labkey-adam labkey-adam changed the base branch from develop to release25.7-SNAPSHOT July 3, 2025 15:40
@labkey-adam labkey-adam merged commit be8ecbb into release25.7-SNAPSHOT Jul 8, 2025
10 checks passed
@labkey-adam labkey-adam deleted the fb_csp_issues branch July 8, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants