Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70529

[ldap] Un-inlining ldap/validate.jelly for CSP compatibility

      Level easy
      Skills a bit of JavaScript, a bit of Jelly

      Culprit:
      (1) - validation/validate.jelly#L58
      (2) - validation/validate.jelly#L71
      (3) - validation/validate.jelly#L83-L99

      Reproduction steps:

      • Install LDAP or clone https://github.com/jenkinsci/ldap-plugin and then mvn hpi:run
      • Go to Manage Jenkins > Configure Global Security
      • In the "Security Realm" section, select "LDAP"
      • Click on "Test LDAP settings" (1)
      • Click on "Test" (2)

      Screenshot attached about where the feature is displayed.

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

      Testing notes

      • Ensure to reproduce the feature before any change
      • Ensure that you reproduce the feature after you have made the change

        1. 1.png
          1.png
          42 kB
        2. 2.png
          2.png
          19 kB
        3. 3.png
          3.png
          59 kB

          [JENKINS-70529] [ldap] Un-inlining ldap/validate.jelly for CSP compatibility

          mani added a comment -

          Please assign this issue to me.

          mani added a comment - Please assign this issue to me.

          Arhant added a comment -

          Hi Mani, I saw your PR which has been merged. I have assigned this it on your name.

          Arhant added a comment - Hi Mani, I saw your PR which has been merged. I have assigned this it on your name.

          mani added a comment -

          Thank you arhant , I completed setup of dev environment for this issue, I will try to complete my changes as soon as possible and let you know if I need any help.

           

           

          mani added a comment - Thank you arhant  , I completed setup of dev environment for this issue, I will try to complete my changes as soon as possible and let you know if I need any help.    

          mani added a comment -

          Hi , I need some help on un-inling the onclick button in line#58, I have used the  adjunct to refer the js code but the button function requires 4 parameter, I am not sure how to pass them to the js file.

          please let me know if I am on right track.

          Any help is much appreciated.

            <st:adjunct includes="validation.validate.validate"/. -----Validate.jelly
          
            button_validation.onclick = function ldapValidateButton(checkUrl, formFilter, button, id) ----validate.js

           

          mani added a comment - Hi , I need some help on un-inling the onclick button in line#58, I have used the  adjunct to refer the js code but the button function requires 4 parameter, I am not sure how to pass them to the js file. please let me know if I am on right track. Any help is much appreciated.   <st:adjunct includes= "validation.validate.validate" /. -----Validate.jelly button_validation.onclick = function ldapValidateButton(checkUrl, formFilter, button, id) ----validate.js  

          Kris Stern added a comment -

          Hi,

          I am interested in working on this issue if it is still open for Hacktoberfest 2023, but would like to check if anyone is still working on it. 

          Kris Stern added a comment - Hi, I am interested in working on this issue if it is still open for Hacktoberfest 2023, but would like to check if anyone is still working on it. 

          Neetigya added a comment -

          Hi, I think this issue coincides with https://issues.jenkins.io/browse/JENKINS-72117. I will mention this issue as well in my PR https://github.com/jenkinsci/ldap-plugin/pull/257 .

          Neetigya added a comment - Hi, I think this issue coincides with https://issues.jenkins.io/browse/JENKINS-72117 . I will mention this issue as well in my PR https://github.com/jenkinsci/ldap-plugin/pull/257 .

          Thanks we will review it soonish

          Kevin Guerroudj added a comment - Thanks we will review it soonish

          Zbynek Konecny added a comment - Released in https://github.com/jenkinsci/ldap-plugin/releases/tag/711.vb_d1a_491714dc

            neetigyapod Neetigya
            kevingrdj Kevin Guerroudj
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: