Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryamanaka2003-11-25 00:43:13 -0500
committeryamanaka2003-11-25 00:43:13 -0500
commita13eca5b62d9655718c4fe4029f6aa78351729f3 (patch)
treef87fe7cf831012b285ee8903b08013ff275e1f2e
parente893fe69ed514ec801d7147a68af2d4ddb0c5e61 (diff)
downloadeclipse.platform.team-a13eca5b62d9655718c4fe4029f6aa78351729f3.tar.gz
eclipse.platform.team-a13eca5b62d9655718c4fe4029f6aa78351729f3.tar.xz
eclipse.platform.team-a13eca5b62d9655718c4fe4029f6aa78351729f3.zip
username/password authentication for proxy.
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/ccvs/ssh2/CVSSSH2PreferencePage.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/ccvs/ssh2/CVSSSH2PreferencePage.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/ccvs/ssh2/CVSSSH2PreferencePage.java
index 24b947ce3..fbacad087 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/ccvs/ssh2/CVSSSH2PreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/ccvs/ssh2/CVSSSH2PreferencePage.java
@@ -37,6 +37,9 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
public static String KEY_PROXY_TYPE="CVSSSH2PreferencePage.PROXY_TYPE";
public static String KEY_PROXY_HOST="CVSSSH2PreferencePage.PROXY_HOST";
public static String KEY_PROXY_PORT="CVSSSH2PreferencePage.PROXY_PORT";
+ public static String KEY_PROXY_AUTH="CVSSSH2PreferencePage.PROXY_AUTH";
+ public static String KEY_PROXY_USER="CVSSSH2PreferencePage.PROXY_USER";
+ public static String KEY_PROXY_PASS="CVSSSH2PreferencePage.PROXY_PASS";
public static String KEY_SSH2HOME="CVSSSH2PreferencePage.SSH2HOME";
static String SOCKS5="SOCKS5";
@@ -49,11 +52,17 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
private Label proxyTypeLabel;
private Label proxyHostLabel;
private Label proxyPortLabel;
+ private Label proxyUserLabel;
+ private Label proxyPassLabel;
private Combo proxyTypeCombo;
private Text proxyHostText;
private Text proxyPortText;
+ private Text proxyUserText;
+ private Text proxyPassText;
private Button enableProxy;
+ private Button enableAuth;
private boolean useProxy;
+ private boolean useAuth;
public CVSSSH2PreferencePage() {
super(GRID);
@@ -82,6 +91,13 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
proxyPortText.setEnabled(enable);
proxyHostLabel.setEnabled(enable);
proxyHostText.setEnabled(enable);
+
+ enableAuth.setEnabled(enable);
+ enable&=enableAuth.getSelection();
+ proxyUserLabel.setEnabled(enable);
+ proxyUserText.setEnabled(enable);
+ proxyPassLabel.setEnabled(enable);
+ proxyPassText.setEnabled(enable);
}
public void init(IWorkbench workbench) {
@@ -96,6 +112,9 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
setDefault(store, KEY_SSH2HOME, JSchSession.default_ssh_home);
setDefault(store, KEY_PROXY_TYPE, HTTP);
setDefault(store, KEY_PROXY_PORT, HTTP_DEFAULT_PORT);
+ setDefault(store, KEY_PROXY_AUTH, "false");
+ setDefault(store, KEY_PROXY_USER, "");
+ setDefault(store, KEY_PROXY_PASS, "");
}
private static void setDefault(IPreferenceStore store, String key, String value){
@@ -111,6 +130,11 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
proxyHostText.setText(store.getString(KEY_PROXY_HOST));
proxyPortText.setText(store.getString(KEY_PROXY_PORT));
proxyTypeCombo.select(store.getString(KEY_PROXY_TYPE).equals(HTTP)?0:1);
+ useAuth=store.getString(KEY_PROXY_AUTH).equals("true");
+ enableAuth.setSelection(useAuth);
+ proxyUserText.setText(store.getString(KEY_PROXY_USER));
+ proxyPassText.setText(store.getString(KEY_PROXY_PASS));
+ proxyPassText.setEchoChar('*');
updateControls();
}
protected void createProxy(Composite composite, int columnSpan) {
@@ -170,6 +194,29 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
gd=new GridData(GridData.FILL_HORIZONTAL);
proxyPortText.setLayoutData(gd);
+ enableAuth=new Button(group, SWT.CHECK);
+ enableAuth.setText("Enable proxy authentication");
+ gd=new GridData();
+ gd.horizontalSpan=2;
+ enableAuth.setLayoutData(gd);
+
+ proxyUserLabel=new Label(group, SWT.NONE);
+ proxyUserLabel.setText("Proxy user name");
+
+ proxyUserText=new Text(group, SWT.SINGLE | SWT.BORDER);
+ proxyUserText.setFont(group.getFont());
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ proxyUserText.setLayoutData(gd);
+
+ proxyPassLabel=new Label(group, SWT.NONE);
+ proxyPassLabel.setText("Proxy password");
+
+ proxyPassText=new Text(group, SWT.SINGLE | SWT.BORDER);
+ proxyPassText.setFont(group.getFont());
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ proxyPassText.setLayoutData(gd);
+
+
// performDefaults();
enableProxy.addSelectionListener(new SelectionListener() {
@@ -179,6 +226,14 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
public void widgetDefaultSelected(SelectionEvent e) {
}
});
+
+ enableAuth.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateControls();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
}
public boolean performOk() {
@@ -189,6 +244,10 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
store.setValue(KEY_PROXY_TYPE, proxyTypeCombo.getText());
store.setValue(KEY_PROXY_HOST, proxyHostText.getText());
store.setValue(KEY_PROXY_PORT, proxyPortText.getText());
+
+ store.setValue(KEY_PROXY_AUTH, enableAuth.getSelection());
+ store.setValue(KEY_PROXY_USER, proxyUserText.getText());
+ store.setValue(KEY_PROXY_PASS, proxyPassText.getText());
}
CVSSSH2Plugin.getDefault().savePluginPreferences();
return result;
@@ -201,6 +260,10 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
store.setValue(KEY_PROXY_TYPE, proxyTypeCombo.getText());
store.setValue(KEY_PROXY_HOST, proxyHostText.getText());
store.setValue(KEY_PROXY_PORT, proxyPortText.getText());
+
+ store.setValue(KEY_PROXY_AUTH, enableAuth.getSelection());
+ store.setValue(KEY_PROXY_USER, proxyUserText.getText());
+ store.setValue(KEY_PROXY_PASS, proxyPassText.getText());
}
protected void performDefaults(){
@@ -209,6 +272,9 @@ public class CVSSSH2PreferencePage extends FieldEditorPreferencePage
proxyHostText.setText("");
proxyPortText.setText(HTTP_DEFAULT_PORT);
proxyTypeCombo.select(0);
+ enableAuth.setSelection(false);
+ proxyUserText.setText("");
+ proxyPassText.setText("");
updateControls();
}

Back to the top