Search in sources :

Example 46 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class View method init.

//  ZAP: Removed method changeDisplayOption(int)
public void init() {
    OptionsParam options = Model.getSingleton().getOptionsParam();
    mainFrame = new MainFrame(options, getRequestPanel(), getResponsePanel());
    mainFrame.getWorkbench().addPanel(View.getSingleton().getSiteTreePanel(), WorkbenchPanel.PanelType.SELECT);
    // Install default editor and renderer for TextMessageLocationHighlight
    MessageLocationHighlightRenderersEditors.getInstance().addEditor(TextMessageLocationHighlight.class, new TextMessageLocationHighlightEditor());
    MessageLocationHighlightRenderersEditors.getInstance().addRenderer(TextMessageLocationHighlight.class, new TextMessageLocationHighlightRenderer());
    String statusString;
    for (Status status : AddOn.Status.values()) {
        //Try/catch in case AddOn.Status gets out of sync with cfu.status i18n entries
        try {
            statusString = Constant.messages.getString("cfu.status." + status.toString());
        } catch (MissingResourceException mre) {
            statusString = status.toString();
            String errString = "Caught " + mre.getClass().getName() + " " + mre.getMessage() + " when looking for i18n string: cfu.status." + statusString;
            if (Constant.isDevBuild()) {
                logger.error(errString);
            } else {
                logger.warn(errString);
            }
        }
        statusMap.put(status, new StatusUI(status, statusString));
    }
}
Also used : Status(org.zaproxy.zap.control.AddOn.Status) TextMessageLocationHighlightRenderer(org.zaproxy.zap.view.messagelocation.TextMessageLocationHighlightRenderer) StatusUI(org.zaproxy.zap.view.StatusUI) OptionsParam(org.parosproxy.paros.model.OptionsParam) MissingResourceException(java.util.MissingResourceException) TextMessageLocationHighlightEditor(org.zaproxy.zap.view.messagelocation.TextMessageLocationHighlightEditor)

Example 47 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsSpiderPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam options = (OptionsParam) obj;
    SpiderParam param = options.getParamSet(SpiderParam.class);
    getSliderMaxDepth().setValue(param.getMaxDepth());
    getSliderThreads().setValue(param.getThreadCount());
    getDurationNumberSpinner().setValue(param.getMaxDuration());
    getMaxChildrenNumberSpinner().setValue(param.getMaxChildren());
    getDomainsAlwaysInScopeTableModel().setDomainsAlwaysInScope(param.getDomainsAlwaysInScope());
    getDomainsAlwaysInScopePanel().setRemoveWithoutConfirmation(param.isConfirmRemoveDomainAlwaysInScope());
    getChkProcessForm().setSelected(param.isProcessForm());
    getChkSendRefererHeader().setSelected(param.isSendRefererHeader());
    getChkPostForm().setSelected(param.isPostForm());
    getChkParseComments().setSelected(param.isParseComments());
    getChkParseRobotsTxt().setSelected(param.isParseRobotsTxt());
    getChkParseSitemapXml().setSelected(param.isParseSitemapXml());
    getChkParseSVNEntries().setSelected(param.isParseSVNEntries());
    getChkParseGit().setSelected(param.isParseGit());
    getComboHandleParameters().setSelectedItem(param.getHandleParameters());
    getHandleODataSpecificParameters().setSelected(param.isHandleODataParametersVisited());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) SpiderParam(org.zaproxy.zap.spider.SpiderParam)

Example 48 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsDatabasePanel method initParam.

@Override
public void initParam(Object obj) {
    final OptionsParam options = (OptionsParam) obj;
    final DatabaseParam param = options.getDatabaseParam();
    checkBoxCompactDatabase.setSelected(param.isCompactDatabase());
    spinnerRequestBodySize.setValue(param.getRequestBodySize());
    spinnerResponseBodySize.setValue(param.getResponseBodySize());
    checkBoxNewSessionPrompt.setSelected(param.isNewSessionPrompt());
    comboNewSessionOption.setSelectedIndex(param.getNewSessionOption());
    checkBoxRecoveryLog.setSelected(param.isRecoveryLogEnabled());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 49 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsLocalProxyPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam optionsParam = (OptionsParam) obj;
    ProxyParam proxyParam = optionsParam.getProxyParam();
    // set Local Proxy parameters
    // ZAP: in the Options dialog we can show the real value of the field
    // and null means that the listener should be bound to all interfaces
    txtProxyIp.setText(proxyParam.getRawProxyIP());
    txtProxyIp.discardAllEdits();
    // ZAP: Do not allow invalid port numbers
    spinnerProxyPort.setValue(proxyParam.getProxyPort());
    chkRemoveUnsupportedEncodings.setSelected(proxyParam.isRemoveUnsupportedEncodings());
    chkAlwaysDecodeGzip.setSelected(proxyParam.isAlwaysDecodeGzip());
    // set reverse proxy param
    txtReverseProxyIp.setText(proxyParam.getReverseProxyIp());
    txtReverseProxyIp.discardAllEdits();
    // ZAP: Do not allow invalid port numbers
    spinnerReverseProxyHttpPort.setValue(proxyParam.getReverseProxyHttpPort());
    spinnerReverseProxyHttpsPort.setValue(proxyParam.getReverseProxyHttpsPort());
    chkReverseProxy.setSelected(proxyParam.isUseReverseProxy());
    setReverseProxyEnabled(proxyParam.isUseReverseProxy());
    securityProtocolsPanel.setSecurityProtocolsEnabled(proxyParam.getSecurityProtocolsEnabled());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) ProxyParam(org.parosproxy.paros.core.proxy.ProxyParam)

Example 50 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsConnectionPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam optionsParam = (OptionsParam) obj;
    ConnectionParam connectionParam = optionsParam.getConnectionParam();
    this.txtTimeoutInSecs.setText(Integer.toString(connectionParam.getTimeoutInSecs()));
    txtTimeoutInSecs.discardAllEdits();
    checkBoxSingleCookieRequestHeader.setSelected(connectionParam.isSingleCookieRequestHeader());
    getProxyExcludedDomainsTableModel().setExcludedDomains(connectionParam.getProxyExcludedDomains());
    getProxyExcludedDomainsPanel().setRemoveWithoutConfirmation(!connectionParam.isConfirmRemoveProxyExcludedDomain());
    chkUseProxyChain.setSelected(connectionParam.isUseProxyChain());
    // set Proxy Chain parameters
    txtProxyChainName.setText(connectionParam.getProxyChainName());
    txtProxyChainName.discardAllEdits();
    // ZAP: Do not allow invalid port numbers
    spinnerProxyChainPort.setValue(connectionParam.getProxyChainPort());
    chkProxyChainAuth.setSelected(connectionParam.isUseProxyChainAuth());
    txtProxyChainRealm.setText(connectionParam.getProxyChainRealm());
    txtProxyChainRealm.discardAllEdits();
    txtProxyChainUserName.setText(connectionParam.getProxyChainUserName());
    txtProxyChainUserName.discardAllEdits();
    chkProxyChainPrompt.setSelected(connectionParam.isProxyChainPrompt());
    //Default don't show (everytime)
    chkShowPassword.setSelected(false);
    //Default mask (everytime)
    txtProxyChainPassword.setEchoChar('*');
    setProxyChainEnabled(connectionParam.isUseProxyChain());
    if (!connectionParam.isProxyChainPrompt()) {
        txtProxyChainPassword.setText(connectionParam.getProxyChainPassword());
    }
    dnsTtlSuccessfulQueriesNumberSpinner.setValue(connectionParam.getDnsTtlSuccessfulQueries());
    securityProtocolsPanel.setSecurityProtocolsEnabled(connectionParam.getSecurityProtocolsEnabled());
    defaultUserAgent.setText(connectionParam.getDefaultUserAgent());
    setUaFromString();
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) ConnectionParam(org.parosproxy.paros.network.ConnectionParam)

Aggregations

OptionsParam (org.parosproxy.paros.model.OptionsParam)56 ScannerParam (org.parosproxy.paros.core.scanner.ScannerParam)4 ConnectionParam (org.parosproxy.paros.network.ConnectionParam)4 File (java.io.File)3 ViewLocale (org.zaproxy.zap.view.ViewLocale)3 ProxyParam (org.parosproxy.paros.core.proxy.ProxyParam)2 Extension (org.parosproxy.paros.extension.Extension)2 SpiderParam (org.zaproxy.zap.spider.SpiderParam)2 HeadlessException (java.awt.HeadlessException)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 MissingResourceException (java.util.MissingResourceException)1 JButton (javax.swing.JButton)1 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 JXErrorPane (org.jdesktop.swingx.JXErrorPane)1 ErrorInfo (org.jdesktop.swingx.error.ErrorInfo)1