@Extension public class ScriptApproval extends Object implements hudson.model.RootAction, hudson.model.Saveable
| Modifier and Type | Class and Description |
|---|---|
static class |
ScriptApproval.ApprovedWhitelist |
static class |
ScriptApproval.PendingScript |
static class |
ScriptApproval.PendingSignature |
static class |
ScriptApproval.PendingThing |
| Constructor and Description |
|---|
ScriptApproval() |
| Modifier and Type | Method and Description |
|---|---|
RejectedAccessException |
accessRejected(RejectedAccessException x,
ApprovalContext context)
To be called when a sandbox rejects access for a script not using manual approval.
|
String[][] |
aclApproveSignature(String signature) |
void |
approveScript(String hash) |
String[][] |
approveSignature(String signature) |
hudson.util.FormValidation |
checking(String script,
Language language)
To be used from form validation, in a
doCheckFieldName method. |
void |
clearApprovedScripts() |
String[][] |
clearApprovedSignatures() |
String |
configuring(String script,
Language language,
ApprovalContext context)
Used when someone is configuring a script.
|
void |
denyScript(String hash) |
void |
denySignature(String signature) |
static ScriptApproval |
get()
Gets the singleton instance.
|
String[] |
getAclApprovedSignatures() |
String[] |
getApprovedSignatures() |
String |
getDisplayName() |
String |
getIconFileName() |
Set<ScriptApproval.PendingScript> |
getPendingScripts() |
Set<ScriptApproval.PendingSignature> |
getPendingSignatures() |
String |
getUrlName() |
String |
preapprove(String script,
Language language)
Unconditionally approve a script.
|
void |
preapproveAll()
Unconditionally approves all pending scripts.
|
void |
save() |
String |
using(String script,
Language language)
Called when a script is about to be used (evaluated).
|
public static ScriptApproval get()
public String configuring(@Nonnull String script, @Nonnull Language language, @Nonnull ApprovalContext context)
DataBoundConstructor.
It should also be called from a readResolve method (which may then simply return this),
so that administrators can for example POST to config.xml and have their scripts be considered approved.
If the script has already been approved, this does nothing.
Otherwise, if this user has the Jenkins.RUN_SCRIPTS permission (and is not ACL.SYSTEM), it is added to the approved list.
Otherwise, it is added to the pending list.
script - the text of a possibly novel scriptlanguage - the language in which it is writtencontext - any additional information about how where or by whom this is being configuredscript, for conveniencepublic String using(@Nonnull String script, @Nonnull Language language) throws UnapprovedUsageException
script - a possibly unapproved scriptlanguage - the language in which it is writtenscript, for convenienceUnapprovedUsageException - in case it has not yet been approvedpublic hudson.util.FormValidation checking(@Nonnull
String script,
@Nonnull
Language language)
doCheckFieldName method.script - a possibly unapproved scriptlanguage - the language in which it is writtenJenkins.RUN_SCRIPTS, else FormValidation.ok()public String preapprove(@Nonnull String script, @Nonnull Language language)
script - the text of a possibly novel scriptlanguage - the language in which it is writtenscript, for conveniencepublic void preapproveAll()
@LocalData.public RejectedAccessException accessRejected(@Nonnull RejectedAccessException x, @Nonnull ApprovalContext context)
x - an exception with the detailscontext - any additional information about where or by whom this script was runx, for convenience in rethrowing@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String[] getApprovedSignatures()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String[] getAclApprovedSignatures()
public String getIconFileName()
getIconFileName in interface hudson.model.Actionpublic String getDisplayName()
getDisplayName in interface hudson.model.ActiongetDisplayName in interface hudson.model.ModelObjectpublic String getUrlName()
getUrlName in interface hudson.model.Actionpublic void save()
throws IOException
save in interface hudson.model.SaveableIOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<ScriptApproval.PendingScript> getPendingScripts()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public void approveScript(String hash) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public void denyScript(String hash) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class)
@JavaScriptMethod
public void clearApprovedScripts()
throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<ScriptApproval.PendingSignature> getPendingSignatures()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public String[][] approveSignature(String signature) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public String[][] aclApproveSignature(String signature) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public void denySignature(String signature) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public String[][] clearApprovedSignatures() throws IOException
IOExceptionCopyright © 2004-2014. All Rights Reserved.