Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test flag to check for CSP warnings #1745

Merged
merged 6 commits into from
Dec 6, 2023
Merged

Conversation

labkey-tchad
Copy link
Member

Rationale

A Tomcat Content Security Policy can be configured to report back to a server. LabKey now supports this reporting and logs warnings to csp-report.log. Tests should be able to check this file for warnings, similar to how we check the server's error log.
The new webtest.cspCheck flag enables this check.

Related Pull Requests

Changes

  • Add test flag to check for CSP warnings

@labkey-tchad labkey-tchad requested review from a team and labkey-danield and removed request for a team December 6, 2023 01:11
Copy link
Contributor

@labkey-danield labkey-danield left a comment

Choose a reason for hiding this comment

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

Did you want to add @labkey-sweta and @labkey-chrisj to review as well?

@@ -1141,6 +1143,8 @@ private void doPostamble()
if (isTestRunningOnTeamCity())
checkActionCoverage();

CspLogUtil.checkNewCspWarnings(getArtifactCollector());
Copy link
Contributor

Choose a reason for hiding this comment

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

Since CspLogUtil.checkNewCspWarnings can throw an assert or an exception shouldn't this line be in a try/catch? Otherwise this is saying that if there was some issue with the csp we cannot/will not check the links or any of the other actions that follow.

Copy link
Member Author

Choose a reason for hiding this comment

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

This matches the behavior for all of the existing checks

@labkey-tchad labkey-tchad merged commit 8551ad4 into develop Dec 6, 2023
2 checks passed
@labkey-tchad labkey-tchad deleted the fb_cspLogChecker branch December 6, 2023 16:45
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.

2 participants