Package com.rapid7.jenkinspider
Class PostBuildScan.DescriptorImp
- java.lang.Object
-
- hudson.model.Descriptor<T>
-
- hudson.tasks.BuildStepDescriptor<Publisher>
-
- com.rapid7.jenkinspider.PostBuildScan.DescriptorImp
-
- Enclosing class:
- PostBuildScan
@Extension public static final class PostBuildScan.DescriptorImp extends BuildStepDescriptor<Publisher>
Descriptor for
PostBuildScan
. Used as a singleton. The class is marked as public so that it can be accessed from views.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description DescriptorImp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationModel
buildAuthenticationModel()
boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
FormValidation
doCheckAppSpiderEntUrl(String value)
Performs on-the-fly validation of the form field 'name'.ListBoxModel
doFillClientNameItems(Item item)
Method for populating the dropdown menu with all the available scan configsListBoxModel
doFillConfigNameItems(String clientName, Item item)
Method for populating the dropdown menu with all the available scan configsListBoxModel
doFillScanConfigEngineGroupNameItems(Item item)
Method for populating the dropdown menu with all the available scan engine groupsFormValidation
doTestCredentials(boolean allowSelfSignedCertificate, String appSpiderEntUrl, String username, Secret password)
calls the login endpoint with the provided credentials reporting success/failure back to the user via form validationFormValidation
doValidateNewScanConfig(String scanConfigName, String scanConfigUrl)
boolean
getAppSpiderAllowSelfSignedCertificate()
String
getAppSpiderClientId()
String
getAppSpiderClientName()
String
getAppSpiderEntUrl()
Secret
getAppSpiderPassword()
String
getAppSpiderUsername()
String
getDisplayName()
String[]
getScanConfigEngines()
String[]
getScanConfigNames()
boolean
isApplicable(Class<? extends AbstractProject> aClass)
boolean
isAppSpiderEnableMultiClientOrSysAdmin()
void
setAppSpiderAllowSelfSignedCertificate(boolean appSpiderAllowSelfSignedCertificate)
void
setAppSpiderClientId(String appSpiderClientId)
void
setAppSpiderClientName(String appSpiderClientName)
void
setAppSpiderEnableMultiClientOrSysAdmin(boolean appSpiderAllowMultiClientOrSysAdmin)
void
setAppSpiderEntUrl(String appSpiderEntUrl)
void
setAppSpiderPassword(Secret appSpiderPassword)
void
setAppSpiderUsername(String appSpiderUsername)
-
Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
doCheckAppSpiderEntUrl
public FormValidation doCheckAppSpiderEntUrl(@QueryParameter String value)
Performs on-the-fly validation of the form field 'name'.- Parameters:
value
- This parameter receives the value that the user has typed.- Returns:
- Indicates the outcome of the validation. This is sent to the browser.
Note that returning
FormValidation.error(String)
does not prevent the form from being saved. It just means that a message will be displayed to the user.
-
isApplicable
public boolean isApplicable(Class<? extends AbstractProject> aClass)
- Specified by:
isApplicable
in classBuildStepDescriptor<Publisher>
-
getDisplayName
@NonNull public String getDisplayName()
- Overrides:
getDisplayName
in classDescriptor<Publisher>
- Returns:
- Display Name of the plugin
-
getAppSpiderEntUrl
public String getAppSpiderEntUrl()
-
setAppSpiderEntUrl
public void setAppSpiderEntUrl(String appSpiderEntUrl)
-
getAppSpiderUsername
public String getAppSpiderUsername()
-
setAppSpiderUsername
public void setAppSpiderUsername(String appSpiderUsername)
-
getAppSpiderPassword
public Secret getAppSpiderPassword()
-
setAppSpiderPassword
public void setAppSpiderPassword(Secret appSpiderPassword)
-
getAppSpiderAllowSelfSignedCertificate
public boolean getAppSpiderAllowSelfSignedCertificate()
-
setAppSpiderAllowSelfSignedCertificate
public void setAppSpiderAllowSelfSignedCertificate(boolean appSpiderAllowSelfSignedCertificate)
-
isAppSpiderEnableMultiClientOrSysAdmin
public boolean isAppSpiderEnableMultiClientOrSysAdmin()
-
setAppSpiderEnableMultiClientOrSysAdmin
public void setAppSpiderEnableMultiClientOrSysAdmin(boolean appSpiderAllowMultiClientOrSysAdmin)
-
getScanConfigNames
public String[] getScanConfigNames()
-
getScanConfigEngines
public String[] getScanConfigEngines()
-
getAppSpiderClientId
public String getAppSpiderClientId()
-
setAppSpiderClientId
public void setAppSpiderClientId(String appSpiderClientId)
-
getAppSpiderClientName
public String getAppSpiderClientName()
-
setAppSpiderClientName
public void setAppSpiderClientName(String appSpiderClientName)
-
buildAuthenticationModel
public AuthenticationModel buildAuthenticationModel()
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) throws Descriptor.FormException
- Overrides:
configure
in classDescriptor<Publisher>
- Throws:
Descriptor.FormException
-
doFillClientNameItems
public ListBoxModel doFillClientNameItems(@AncestorInPath Item item) throws InterruptedException
Method for populating the dropdown menu with all the available scan configs- Returns:
- ListBoxModel containing the scan config names
- Throws:
InterruptedException
-
doFillConfigNameItems
public ListBoxModel doFillConfigNameItems(@QueryParameter String clientName, @AncestorInPath Item item)
Method for populating the dropdown menu with all the available scan configs- Returns:
- ListBoxModel containing the scan config names
-
doFillScanConfigEngineGroupNameItems
public ListBoxModel doFillScanConfigEngineGroupNameItems(@AncestorInPath Item item)
Method for populating the dropdown menu with all the available scan engine groups- Returns:
- ListBoxModel containing engine details
-
doTestCredentials
@POST public FormValidation doTestCredentials(@QueryParameter("appSpiderAllowSelfSignedCertificate") boolean allowSelfSignedCertificate, @QueryParameter("appSpiderEntUrl") String appSpiderEntUrl, @QueryParameter("appSpiderUsername") String username, @QueryParameter("appSpiderPassword") Secret password)
calls the login endpoint with the provided credentials reporting success/failure back to the user via form validation- Parameters:
allowSelfSignedCertificate
- If true certificate errors will be ignored, only meaningful if URL is using httpsappSpiderEntUrl
- Full URL path including protocol to the appspider rest api endpointusername
- Username used for authenticationpassword
- Password used for authentication- Returns:
- FormValidation result of the credentials test
-
doValidateNewScanConfig
public FormValidation doValidateNewScanConfig(@QueryParameter("scanConfigName") String scanConfigName, @QueryParameter("scanConfigUrl") String scanConfigUrl)
-
-