Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated ScriptContent to use better groovy setup. - In default groovy script, add all content types as closures, these can be used like ${ENV(var: "BUILD_ID")} in the groovy template
- Loading branch information
Showing
8 changed files
with
165 additions
and
152 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package hudson.plugins.emailext; | ||
|
||
import hudson.model.Hudson; | ||
import jenkins.model.Jenkins; | ||
import org.kohsuke.groovy.sandbox.GroovyValueFilter; | ||
|
||
/** | ||
* Provides a sandbox for groovy scripts that disallows access to the Jenkins | ||
* instance. | ||
*/ | ||
public class ScriptSandbox extends GroovyValueFilter { | ||
@Override | ||
public Object filter(Object o) { | ||
if (o instanceof Jenkins || o instanceof Hudson) { | ||
throw new SecurityException("Use of 'jenkins' is disallowed by security policy"); | ||
} | ||
return o; | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.