v2: Adapt to core CSP API (JENKINS-76263)#63
Merged
daniel-beck merged 23 commits intojenkinsci:mainfrom Nov 26, 2025
Merged
Conversation
14 tasks
Closed
- Move `ValueSpecifier` into its own top-level class - Add `AllowNavigationRule`, similar to `AllowFetchRule`, but limits `ValueSpecifierDescriptor` to those that matter. - Bugfix: Only apply `ByDomain` if it's valid also for non-admins
Member
Author
|
Note: This is currently pending final review and testing and will be released ASAP. Anyone who wants to use the plugin in Jenkins 2.539 can download an "incremental" PR build from https://repo.jenkins-ci.org/artifactory/incrementals/io/jenkins/plugins/csp/ |
Kevin-CB
approved these changes
Nov 26, 2025
Kevin-CB
left a comment
There was a problem hiding this comment.
I tested the plugin locally, tried different custom rules, everything seems to works properly.
src/main/java/io/jenkins/plugins/csp/ContentSecurityPolicyManagementLink.java
Outdated
Show resolved
Hide resolved
src/test/java/io/jenkins/plugins/csp/CustomRoleAdvancedConfigurationTest.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adapts CSP plugin to jenkinsci/jenkins#11269. It is basically an entire rewrite of the plugin. With the core change, there's no reason for the v1 implementation to continue to exist.
Instead of setting the header etc., it now builds on top of the infrastructure provided by core:
Receiver(core API), the plugin now provides a UI (same UI as before), rather than the bare minimumLogger-based implementation in core.Contributor(core API), the plugin now allows configuring individual rule changes (as anAdvancedConfigurationimplementation), rather than needing admins to edit the entire expression. Changes toCspBuilderare managed fromContentSecurityPolicyContributoras entrypoint.AdvancedConfigurationthat allows dropping reports from anonymous users for the reports UI.Open tasks:
2.TODOcore version number placeholders in documentation