Search in sources :

Example 6 with ExtensionLoader

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

the class ExtensionManualRequestEditor method removeManualSendEditor.

public void removeManualSendEditor(Class<? extends Message> messageType) {
    // remove from list
    ManualRequestEditorDialog dialogue = dialogues.remove(messageType);
    if (dialogue != null) {
        // remove from GUI
        dialogue.clear();
        dialogue.dispose();
        if (getView() != null) {
            // unload menu items
            ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
            extLoader.removeToolsMenuItem(dialogue.getMenuItem());
        }
    }
}
Also used : ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader)

Example 7 with ExtensionLoader

use of org.parosproxy.paros.extension.ExtensionLoader 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)

Example 8 with ExtensionLoader

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

the class ExtensionParams method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    extensionHook.addApiImplementor(new ParamsAPI(this));
    extensionHook.addSessionListener(this);
    extensionHook.addSiteMapListener(this);
    if (getView() != null) {
        @SuppressWarnings("unused") ExtensionHookView pv = extensionHook.getHookView();
        extensionHook.getHookView().addStatusPanel(getParamsPanel());
        final ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
        if (extLoader.isExtensionEnabled(ExtensionSearch.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuParamSearch());
        }
        if (extLoader.isExtensionEnabled(ExtensionAntiCSRF.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddAntiCSRF());
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveAntiCSRF());
        }
        if (extLoader.isExtensionEnabled(ExtensionHttpSessions.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddSession());
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveSession());
        }
        ExtensionHelp.enableHelpKey(getParamsPanel(), "ui.tabs.params");
    }
    ExtensionPassiveScan extensionPassiveScan = (ExtensionPassiveScan) Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.NAME);
    if (extensionPassiveScan != null) {
        paramScanner = new ParamScanner(this);
        extensionPassiveScan.addPassiveScanner(new ParamScanner(this));
    }
}
Also used : ExtensionPassiveScan(org.zaproxy.zap.extension.pscan.ExtensionPassiveScan) ExtensionHookView(org.parosproxy.paros.extension.ExtensionHookView) ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader)

Aggregations

ExtensionLoader (org.parosproxy.paros.extension.ExtensionLoader)8 Extension (org.parosproxy.paros.extension.Extension)2 File (java.io.File)1 Before (org.junit.Before)1 Control (org.parosproxy.paros.control.Control)1 ExtensionHookView (org.parosproxy.paros.extension.ExtensionHookView)1 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)1 XmlReporterExtension (org.zaproxy.zap.extension.XmlReporterExtension)1 ExtensionAlert (org.zaproxy.zap.extension.alert.ExtensionAlert)1 ExtensionPassiveScan (org.zaproxy.zap.extension.pscan.ExtensionPassiveScan)1 I18N (org.zaproxy.zap.utils.I18N)1