Search in sources :

Example 16 with Extension

use of org.parosproxy.paros.extension.Extension in project zaproxy by zaproxy.

the class AddOnInstaller method install.

/**
     * Installs all the (dynamically installable) components ({@code Extension}s, {@code Plugin}s, {@code PassiveScanner}s and
     * files) of the given {@code addOn}.
     * <p>
     * It's also responsible to notify the installed extensions when the installation has finished by calling the method
     * {@code Extension#postInstall()}.
     * <p>
     * The components are installed in the following order:
     * <ol>
     * <li>Files;</li>
     * <li>Extensions;</li>
     * <li>Active scanners;</li>
     * <li>Passive scanners.</li>
     * </ol>
     * The files are installed first as they might be required by extensions and scanners.
     * 
     * @param addOnClassLoader the class loader of the given {@code addOn}
     * @param addOn the add-on that will be installed
     * @see Extension
     * @see PassiveScanner
     * @see org.parosproxy.paros.core.scanner.Plugin
     * @see Extension#postInstall()
     */
public static void install(AddOnClassLoader addOnClassLoader, AddOn addOn) {
    installAddOnFiles(addOnClassLoader, addOn, true);
    List<Extension> listExts = installAddOnExtensions(addOn);
    installAddOnActiveScanRules(addOn, addOnClassLoader);
    installAddOnPassiveScanRules(addOn, addOnClassLoader);
    // postInstall actions
    for (Extension ext : listExts) {
        try {
            ext.postInstall();
        } catch (Exception e) {
            logger.error("Post install method failed for add-on " + addOn.getId() + " extension " + ext.getName());
        }
    }
}
Also used : Extension(org.parosproxy.paros.extension.Extension) IOException(java.io.IOException)

Example 17 with Extension

use of org.parosproxy.paros.extension.Extension in project zaproxy by zaproxy.

the class ReportLastScan method getExtensionsXML.

public StringBuilder getExtensionsXML(SiteNode site) {
    StringBuilder extensionXml = new StringBuilder();
    ExtensionLoader loader = Control.getSingleton().getExtensionLoader();
    int extensionCount = loader.getExtensionCount();
    for (int i = 0; i < extensionCount; i++) {
        Extension extension = loader.getExtension(i);
        if (extension instanceof XmlReporterExtension) {
            extensionXml.append(((XmlReporterExtension) extension).getXml(site));
        }
    }
    return extensionXml;
}
Also used : XmlReporterExtension(org.zaproxy.zap.extension.XmlReporterExtension) Extension(org.parosproxy.paros.extension.Extension) XmlReporterExtension(org.zaproxy.zap.extension.XmlReporterExtension) ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader)

Aggregations

Extension (org.parosproxy.paros.extension.Extension)17 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)3 AddOn (org.zaproxy.zap.control.AddOn)3 ExtensionLoader (org.parosproxy.paros.extension.ExtensionLoader)2 OptionsParam (org.parosproxy.paros.model.OptionsParam)2 AddOnRunRequirements (org.zaproxy.zap.control.AddOn.AddOnRunRequirements)2 ExtensionRunRequirements (org.zaproxy.zap.control.AddOn.ExtensionRunRequirements)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 HashMap (java.util.HashMap)1 JTable (javax.swing.JTable)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 XmlReporterExtension (org.zaproxy.zap.extension.XmlReporterExtension)1 ExtensionParam (org.zaproxy.zap.extension.ext.ExtensionParam)1