Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust for script security #229

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import hudson.FilePath;
import hudson.Util;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor.FormException;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -20,7 +22,7 @@ public class GroovyScriptExecutor {
private final Logger log;
private final SecureGroovyScript secureGroovyScript;

public GroovyScriptExecutor(Script script, List<String> arguments, AbstractBuild<?, ?> build, Logger log) {
public GroovyScriptExecutor(Script script, List<String> arguments, AbstractBuild<?, ?> build, Logger log) throws FormException {
this.arguments = new ArrayList<>(arguments);
this.build = build;
this.log = log;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jenkinsci.plugins.postbuildscript.service;

import hudson.model.AbstractBuild;
import hudson.model.Descriptor.FormException;

import java.util.List;
import org.jenkinsci.plugins.postbuildscript.logging.Logger;
import org.jenkinsci.plugins.postbuildscript.model.Script;
Expand All @@ -16,7 +18,7 @@ public GroovyScriptExecutorFactory(AbstractBuild<?, ?> build, Logger logger) {
this.logger = logger;
}

public GroovyScriptExecutor create(Script script, List<String> arguments) {
public GroovyScriptExecutor create(Script script, List<String> arguments) throws FormException {
return new GroovyScriptExecutor(script, arguments, build, logger);
}
}
Loading