[JENKINS-74883] Remove unsafe eval
call from third-party library
#2589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
See JENKINS-74883.
Problem
Solution
Pull in skeggse/isemail#12, first released in https://github.com/skeggse/isemail/releases/tag/v2.1.2.
Implementation
Override the transitive dependency. The
overrides
feature could be used for this, but it was introduced in NPM version 8, while we are still on NPM 6.14.4. NPM 6.14.4 doesn't natively supportoverrides
, but we can use the npm-force-resolutions package to enforce specific versions for dependencies as recommended here. This PR sets up that package as described in its README, then uses it to override the version ofisemail
to 2.1.2.Testing done
Tested together with #2587, #2588, and
Note that the above does not contain
unsafe-eval
, exposing JENKINS-74883.Confirmed that after the header was added but before this PR, Blue Ocean blew up with the CSP violation described in the Problem section.
Confirmed that after the header was added and after this PR, Blue Ocean loaded successfully and I could browse both Pipeline jobs and Pipeline runs without any errors in the console log. Confirmed that the CSP header was being sent without
unsafe-eval
.Submitter checklist
Reviewer checklist