Skip to content

[JENKINS-74585] [eggplant-runner] Extract inline script blocks and event handlers in io/jenkins/plugins/eggplant/EggplantRunnerBuilder/config.jelly #81

@jenkins-infra-bot

Description

@jenkins-infra-bot

Problems

== Inline Script Block
Line: 22
----
<script>
    function showPassword() {
document.querySelectorAll('*').forEach(function(node) {
    if(node.id==="clientSecret"){
if(node.type ==="password"){
    node.type = "text";
}
else
{
    node.type = "password";
}
    };
    if(node.id==="ckBox"){
if (document.getElementById("clientSecret").type === "password"){
    node.checked = false;
}
else{
    node.checked = true;
}
    }
});
    }
</script>
----

== Inline Script Block
Line: 45
----
<script>
    function doNotShowPassword(){
document.querySelectorAll('*').forEach(function(node) {
    if(node.id==="clientSecret"){
node.type = "password";
    }
});
    }
</script>
----

== Inline Event Handler
Line: 19
----
<input type="checkbox" onclick="showPassword()" id="ckBox"/>
----

== Inline Event Handler
Line: 20
----
<iframe onload="doNotShowPassword()" style="display:none" />
----

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: [eggplant-runner] Extract inline script blocks and event handlers in io/jenkins/plugins/eggplant/EggplantRunnerBuilder/config.jelly
  • status: Open
  • priority: Minor
  • component(s): _unsorted
  • label(s): CSP
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-08
Raw content of original issue

Problems

== Inline Script Block
Line: 22
----
<script>
            function showPassword() {
                document.querySelectorAll('*').forEach(function(node) {
                    if(node.id==="clientSecret"){
                        if(node.type ==="password"){
                            node.type = "text";
                        }
                        else
                        {
                            node.type = "password";
                        }
                    };
                    if(node.id==="ckBox"){
                        if (document.getElementById("clientSecret").type === "password"){
                            node.checked = false;
                        }
                        else{
                            node.checked = true;
                        }
                    }
                });
            }
        </script>
----

== Inline Script Block
Line: 45
----
<script>
            function doNotShowPassword(){
                document.querySelectorAll('*').forEach(function(node) {
                    if(node.id==="clientSecret"){
                        node.type = "password";
                    }
                });
            }
        </script>
----

== Inline Event Handler
Line: 19
----
<input type="checkbox" onclick="showPassword()" id="ckBox"/>
----

== Inline Event Handler
Line: 20
----
<iframe onload="doNotShowPassword()" style="display:none" />
----

Solutions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions