@Symbol(value="scriptApproval") @Extension public class ScriptApproval extends GlobalConfiguration implements RootAction
| Modifier and Type | Class and Description |
|---|---|
static class |
ScriptApproval.ApprovedClasspathEntry
Approved classpath entry.
|
static class |
ScriptApproval.ApprovedWhitelist |
static class |
ScriptApproval.PendingClasspathEntry
A classpath entry requiring approval by an administrator.
|
static class |
ScriptApproval.PendingScript |
static class |
ScriptApproval.PendingSignature |
static class |
ScriptApproval.PendingThing |
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfExtensionPoint.LegacyInstancesAreScopedToHudsonclazz| Constructor and Description |
|---|
ScriptApproval() |
all, configure, getDescriptor, getGlobalConfigPageaddHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDisplayNameprotected XmlFile getConfigFile()
getConfigFile in class Descriptor<GlobalConfiguration>public GlobalConfigurationCategory getCategory()
getCategory in class Descriptor<GlobalConfiguration>@Nonnull 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), or Jenkins is running without security, 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 convenienceIllegalStateException - Jenkins instance is not readypublic 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 void configuring(@Nonnull ClasspathEntry entry, @Nonnull ApprovalContext context)
configuring(String, Language, ApprovalContext).entry - entry to be configuredcontext - any additional informationIllegalStateException - Jenkins instance is not readypublic FormValidation checking(@Nonnull ClasspathEntry entry)
checking(String, Language) but for classpath entries.
(This is automatic if use ClasspathEntry as a configuration element.)entry - the classpath entry to verifyIllegalStateException - Jenkins instance is not readypublic void using(@Nonnull ClasspathEntry entry) throws IOException, UnapprovedClasspathException
entry - a classpath entryIOException - when failed to the entry is inaccessibleUnapprovedClasspathException - when the entry is not approvedpublic 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.@Deprecated public RejectedAccessException accessRejected(@Nonnull RejectedAccessException x, @Nonnull ApprovalContext context)
GroovySandbox.enter().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 static void maybeRegister(@Nonnull RejectedAccessException x)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void pushRegistrationCallback(Consumer<RejectedAccessException> callback)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void popRegistrationCallback()
@DataBoundSetter public void setApprovedSignatures(String[] signatures) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String[] getApprovedSignatures()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String[] getDangerousApprovedSignatures()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String[] getAclApprovedSignatures()
public String getIconFileName()
getIconFileName in interface Actionpublic String getUrlName()
getUrlName in interface Action@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
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public String[][] clearDangerousApprovedSignatures() throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<ScriptApproval.ApprovedClasspathEntry> getApprovedClasspathEntries()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<ScriptApproval.PendingClasspathEntry> getPendingClasspathEntries()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public net.sf.json.JSON getClasspathRenderInfo()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public net.sf.json.JSON approveClasspathEntry(String hash) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public net.sf.json.JSON denyClasspathEntry(String hash) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @JavaScriptMethod public net.sf.json.JSON denyApprovedClasspathEntry(String hash) throws IOException
IOException@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class)
@JavaScriptMethod
public net.sf.json.JSON clearApprovedClasspathEntries()
throws IOException
IOExceptionCopyright © 2016–2019. All rights reserved.