jenkinsci / jenkinsci/release-plugin

[JENKINS-74151] [release] Extract inline script block and event handler in hudson/plugins/release/pipeline/ReleaseStep/config.jelly

Open
#147 1 comment 0 reactions 0 assignees View on GitHub
component:release-plugin imported-jira-issue jira-type:task priority:minor resolution:unresolved
Dominant language
Java
Stars
24
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Problems

```
== Inline Script Block
Line: 34
----

function loadParams() {
const div = document.getElementById('params');
const parametersTextBox = document.getElementById('${jobFieldId}')

const url = '${descriptor.descriptorUrl}/parameters?job=' + encodeURIComponent(parametersTextBox.value) + '&context=' + encodeURIComponent('${descriptor.context}')
fetch(url)
.then(rsp => {
if (rsp.ok) {
rsp.text().then(responseText => {
div.innerHTML = responseText;
Behaviour.applySubtree(div);
})
} else {
div.innerHTML = "<b>ERROR</b>: Failed to load parameter definitions: " + rsp.statusText;
}
})
}

----

== Inline Event Handler
Line: 30
----

----

```

Solutions

https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks

https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

---
Originally reported by basil, imported from: [release] Extract inline script block and event handler in hudson/plugins/release/pipeline/ReleaseStep/config.jelly


  • assignee: shlomo_dahan
  • status: In Review
  • priority: Minor
  • component(s): release-plugin
  • label(s): CSP
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251223-222157

Raw content of original issue

Problems


== Inline Script Block

Line: 34
----
<script>
function loadParams() {
const div = document.getElementById('params');
const parametersTextBox = document.getElementById('${jobFieldId}')

const url = '${descriptor.descriptorUrl}/parameters?job=' + encodeURIComponent(parametersTextBox.value) + '&amp;context=' + encodeURIComponent('${descriptor.context}')
fetch(url)
.then(rsp => {
if (rsp.ok) {
rsp.text().then(responseText => {
div.innerHTML = responseText;
Behaviour.applySubtree(div);
})
} else {
div.innerHTML = "<b>ERROR</b>: Failed to load parameter definitions: " + rsp.statusText;
}
})
}
</script>
----

== Inline Event Handler
Line: 30
----
<f:textbox onblur="loadParams()" id="${jobFieldId}"/>
----


Solutions

https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.