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

Pipeline DSL has security exception if pipeline map defined outside of the method scope

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Even if security is disabled you'll get a SecurityException with the following code:

      class A {
        def context
        def p
        def A(ctx) {
          this.ctx = ctx
          this.p = [ "a": {this.a}]
        }
        def a() {
          ctx.echo "hi"
        }
        def b() {
          ctx.node("master") {
            ctx.parallel p
          }
        }
      }
      

      (new A(this)).b()

      However flattening the parallel as

       ctx.parallel ["a": {this.a}]
      

      is OK, as is making a local variable for the parallel mapping.  I believe this behavior changed with the recent update to Jenkins security.

        Attachments

          Activity

          Hide
          philip_abraham Philipp Abraham added a comment -

          This caused our whole abstraction library to stop working.

          I think it was introduced with script-security-plugin 1.75

          Show
          philip_abraham Philipp Abraham added a comment - This caused our whole abstraction library to stop working. I think it was introduced with script-security-plugin 1.75

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kbrowder Kevin Browder
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: