summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Krysinski <mich@man.poznan.pl>2013-07-04 15:02:27 (GMT)
committer Michal Krysinski <mich@man.poznan.pl>2013-07-04 15:02:27 (GMT)
commit0c8bc2e9012d3a8ad84c68e36229d5de20503b03 (patch)
tree28daa60d6428cb81e53ff34bd2e198c9040c588a
parente003f9e72181705f8eb66dd53b80526f112799da (diff)
downloadQCG-Data-0c8bc2e9012d3a8ad84c68e36229d5de20503b03.zip
QCG-Data-0c8bc2e9012d3a8ad84c68e36229d5de20503b03.tar.gz
QCG-Data-0c8bc2e9012d3a8ad84c68e36229d5de20503b03.tar.bz2
gsi proxy login
-rw-r--r--idrop-swing/pom.xml28
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form74
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java639
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java4
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java2
5 files changed, 507 insertions, 240 deletions
diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml
index 18f612b..1177cd5 100644
--- a/idrop-swing/pom.xml
+++ b/idrop-swing/pom.xml
@@ -71,6 +71,32 @@
<version>3.3.2.GA</version>
<scope>runtime</scope>
</dependency>
+ <!-- required for GSI support -->
+ <dependency>
+ <groupId>cryptix</groupId>
+ <artifactId>cryptix</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>cryptix</groupId>
+ <artifactId>cryptix32</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>cryptix</groupId>
+ <artifactId>cryptix-asn1</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ <version>1.40</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.10</version>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -173,7 +199,7 @@
</descriptorRefs>
<archive>
<manifest>
- <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass>
+ <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass>
</manifest>
</archive>
</configuration>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
index aa8775b..e764320 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
@@ -178,7 +178,7 @@
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="1" gridY="10" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -201,6 +201,14 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkGuestLoginActionPerformed"/>
</Events>
</Component>
+ <Component class="javax.swing.JCheckBox" name="chkProxyLogin">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Use GSI"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkProxyLoginActionPerformed"/>
+ </Events>
+ </Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="lblLoginMode">
@@ -210,7 +218,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="9" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
@@ -226,7 +234,67 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="1" gridY="9" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblProxy">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Proxy location:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtProxy">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="7" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblCerts">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Certificates location:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtCerts">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="8" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnProxy">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Choose..."/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnProxyActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="2" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnCerts">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Choose..."/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCertsActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="2" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index fbdc6d2..0ab3cf4 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -9,7 +9,14 @@ import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.JDialog;
+import javax.swing.JFileChooser;
import javax.swing.KeyStroke;
+import org.globus.gsi.GlobusCredential;
+import org.globus.gsi.GlobusCredentialException;
+import org.globus.gsi.gssapi.GlobusGSSCredentialImpl;
+import org.ietf.jgss.GSSCredential;
+import org.ietf.jgss.GSSException;
+import org.irods.jargon.core.connection.GSIIRODSAccount;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.connection.auth.AuthResponse;
@@ -19,6 +26,7 @@ import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServ
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
/**
@@ -71,6 +79,18 @@ public class LoginDialog extends JDialog {
} else {
comboLoginMode.setSelectedItem(mode);
}
+
+ String proxy = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_PROXY_LOCATION);
+
+ if(proxy!=null){
+ txtProxy.setText(proxy);
+ }
+
+ String certificates = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERTIFICATES_LOCATION);
+
+ if(certificates!=null){
+ txtCerts.setText(certificates);
+ }
txtPort.setText(port);
String zone = idropCore.getIdropConfig().getPropertyForKey(
@@ -82,7 +102,9 @@ public class LoginDialog extends JDialog {
String username = idropCore.getIdropConfig().getPropertyForKey(
IdropConfigurationService.ACCOUNT_CACHE_USER_NAME);
txtUserName.setText(username);
- hideAdvancedViewFields();
+ hideAdvancedViewFields();
+ hideProxyLoginFields();
+
}
private void loginUsingPreset() {
@@ -175,7 +197,13 @@ public class LoginDialog extends JDialog {
irodsAccount = IRODSAccount.instanceForAnonymous(
presetHost, presetPort, "", presetZone,
presetResource);
- } else {
+ } else if(chkProxyLogin.isSelected()){
+ GlobusCredential globusCred = new GlobusCredential(txtProxy.getText());
+ GSSCredential gssCred = new GlobusGSSCredentialImpl(globusCred,GSSCredential.INITIATE_AND_ACCEPT);
+ GSIIRODSAccount acc = GSIIRODSAccount.instance(presetHost, presetPort, gssCred, presetResource);
+ acc.setCertificateAuthority(txtCerts.getText());
+ irodsAccount = acc;
+ } else {
irodsAccount = IRODSAccount.instance(presetHost,
presetPort, txtUserName.getText(), new String(
password.getPassword()), sb.toString(),
@@ -192,7 +220,17 @@ public class LoginDialog extends JDialog {
.getText().trim(), Integer.parseInt(txtPort
.getText().trim()), "", txtZone.getText().trim(),
txtResource.getText().trim());
- } else {
+ } else if(chkProxyLogin.isSelected()){
+ // TODO
+ GlobusCredential globusCred = new GlobusCredential(txtProxy.getText());
+ GSSCredential gssCred = new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT);
+ GSIIRODSAccount acc = GSIIRODSAccount.instance(
+ txtHost.getText().trim(),
+ Integer.parseInt(txtPort.getText().trim()), gssCred, txtResource.getText().trim());
+ acc.setCertificateAuthority(txtCerts.getText().trim());
+ irodsAccount = acc;
+
+ } else{
irodsAccount = IRODSAccount.instance(txtHost.getText()
.trim(),
Integer.parseInt(txtPort.getText().trim()),
@@ -208,7 +246,15 @@ public class LoginDialog extends JDialog {
MessageManager.showError(this, ex.getMessage(),
MessageManager.TITLE_MESSAGE);
return true;
- }
+ } catch (GlobusCredentialException ex) {
+ Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,null,ex);
+ MessageManager.showError(this, ex.getMessage(), MessageManager.TITLE_MESSAGE);
+ return true;
+ } catch (GSSException ex) {
+ Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,null,ex);
+ MessageManager.showError(this, ex.getMessage(), MessageManager.TITLE_MESSAGE);
+ return true;
+ }
if (comboLoginMode.getSelectedItem().toString()
.equals(IRODSAccount.AuthScheme.PAM.name())) {
@@ -231,6 +277,9 @@ public class LoginDialog extends JDialog {
try {
idropCore.getIdropConfigurationService()
.saveLogin(irodsAccount);
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PROXY_LOCATION, txtProxy.getText());
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERTIFICATES_LOCATION, txtCerts.getText());
+ //todo save proxy path and certificates location
} catch (IdropException ex) {
throw new IdropRuntimeException("error saving irodsAccount", ex);
}
@@ -308,210 +357,301 @@ public class LoginDialog extends JDialog {
// <editor-fold defaultstate="collapsed"
// <editor-fold defaultstate="collapsed"
- // desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
- java.awt.GridBagConstraints gridBagConstraints;
-
- pnlLoginInfo = new javax.swing.JPanel();
- lblHost = new javax.swing.JLabel();
- txtHost = new javax.swing.JTextField();
- lblPort = new javax.swing.JLabel();
- txtPort = new javax.swing.JTextField();
- lblZone = new javax.swing.JLabel();
- txtZone = new javax.swing.JTextField();
- lblResource = new javax.swing.JLabel();
- txtResource = new javax.swing.JTextField();
- lblUserName = new javax.swing.JLabel();
- txtUserName = new javax.swing.JTextField();
- lblPassword = new javax.swing.JLabel();
- password = new javax.swing.JPasswordField();
- jPanel1 = new javax.swing.JPanel();
- chkAdvancedLogin = new javax.swing.JCheckBox();
- chkGuestLogin = new javax.swing.JCheckBox();
- lblLoginMode = new javax.swing.JLabel();
- comboLoginMode = new javax.swing.JComboBox();
- pnlToolbar = new javax.swing.JPanel();
- btnOK = new javax.swing.JButton();
- btnCancel = new javax.swing.JButton();
- lblLogin = new javax.swing.JLabel();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- pnlLoginInfo.setLayout(new java.awt.GridBagLayout());
-
- lblHost.setText("Host:");
- lblHost.setMaximumSize(new java.awt.Dimension(40, 14));
- lblHost.setMinimumSize(new java.awt.Dimension(30, 14));
- lblHost.setPreferredSize(null);
- lblHost.setRequestFocusEnabled(false);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- pnlLoginInfo.add(lblHost, gridBagConstraints);
-
- txtHost.setColumns(30);
- txtHost.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtHost, gridBagConstraints);
-
- lblPort.setText("Port:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- pnlLoginInfo.add(lblPort, gridBagConstraints);
-
- txtPort.setColumns(30);
- txtPort.setText("1247");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtPort, gridBagConstraints);
-
- lblZone.setText("Zone:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblZone, gridBagConstraints);
-
- txtZone.setColumns(30);
- txtZone.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtZone, gridBagConstraints);
-
- lblResource.setText("Resource:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblResource, gridBagConstraints);
-
- txtResource.setColumns(30);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtResource, gridBagConstraints);
-
- lblUserName.setText("User Name:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblUserName, gridBagConstraints);
-
- txtUserName.setColumns(30);
- txtUserName.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtUserName, gridBagConstraints);
-
- lblPassword.setText("Password:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblPassword, gridBagConstraints);
-
- password.setColumns(30);
- password.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(password, gridBagConstraints);
-
- chkAdvancedLogin.setText("Advanced Login Settings");
- chkAdvancedLogin.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- chkAdvancedLoginActionPerformed(evt);
- }
- });
- jPanel1.add(chkAdvancedLogin);
-
- chkGuestLogin.setText("Login As Guest");
- chkGuestLogin.setToolTipText("Use a guest login");
- chkGuestLogin.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- chkGuestLoginActionPerformed(evt);
- }
- });
- jPanel1.add(chkGuestLogin);
-
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 8;
- pnlLoginInfo.add(jPanel1, gridBagConstraints);
-
- lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
- lblLoginMode.setText("Login Mode:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 7;
- pnlLoginInfo.add(lblLoginMode, gridBagConstraints);
-
- comboLoginMode.setModel(new javax.swing.DefaultComboBoxModel(
- new String[] { "Standard", "PAM" }));
- comboLoginMode.setToolTipText("Authentication mode used at login");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 7;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
- pnlLoginInfo.add(comboLoginMode, gridBagConstraints);
-
- getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
-
- pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT,
- 2, 5));
-
- btnOK.setMnemonic('L');
- btnOK.setText("Login");
- btnOK.setMaximumSize(new java.awt.Dimension(100, 100));
- btnOK.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- btnOKActionPerformed(evt);
- }
- });
- pnlToolbar.add(btnOK);
-
- btnCancel.setMnemonic('c');
- btnCancel.setText("Cancel");
- btnCancel.setMaximumSize(new java.awt.Dimension(100, 100));
- btnCancel.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- btnCancelActionPerformed(evt);
- }
- });
- pnlToolbar.add(btnCancel);
-
- getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
-
- lblLogin.setText("Please log in to your iDrop data grid");
- getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
-
- pack();
- }// </editor-fold>//GEN-END:initComponents
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ pnlLoginInfo = new javax.swing.JPanel();
+ lblHost = new javax.swing.JLabel();
+ txtHost = new javax.swing.JTextField();
+ lblPort = new javax.swing.JLabel();
+ txtPort = new javax.swing.JTextField();
+ lblZone = new javax.swing.JLabel();
+ txtZone = new javax.swing.JTextField();
+ lblResource = new javax.swing.JLabel();
+ txtResource = new javax.swing.JTextField();
+ lblUserName = new javax.swing.JLabel();
+ txtUserName = new javax.swing.JTextField();
+ lblPassword = new javax.swing.JLabel();
+ password = new javax.swing.JPasswordField();
+ jPanel1 = new javax.swing.JPanel();
+ chkAdvancedLogin = new javax.swing.JCheckBox();
+ chkGuestLogin = new javax.swing.JCheckBox();
+ chkProxyLogin = new javax.swing.JCheckBox();
+ lblLoginMode = new javax.swing.JLabel();
+ comboLoginMode = new javax.swing.JComboBox();
+ lblProxy = new javax.swing.JLabel();
+ txtProxy = new javax.swing.JTextField();
+ lblCerts = new javax.swing.JLabel();
+ txtCerts = new javax.swing.JTextField();
+ btnProxy = new javax.swing.JButton();
+ btnCerts = new javax.swing.JButton();
+ pnlToolbar = new javax.swing.JPanel();
+ btnOK = new javax.swing.JButton();
+ btnCancel = new javax.swing.JButton();
+ lblLogin = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ pnlLoginInfo.setLayout(new java.awt.GridBagLayout());
+
+ lblHost.setText("Host:");
+ lblHost.setMaximumSize(new java.awt.Dimension(40, 14));
+ lblHost.setMinimumSize(new java.awt.Dimension(30, 14));
+ lblHost.setPreferredSize(null);
+ lblHost.setRequestFocusEnabled(false);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlLoginInfo.add(lblHost, gridBagConstraints);
+
+ txtHost.setColumns(30);
+ txtHost.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtHost, gridBagConstraints);
+
+ lblPort.setText("Port:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlLoginInfo.add(lblPort, gridBagConstraints);
+
+ txtPort.setColumns(30);
+ txtPort.setText("1247");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtPort, gridBagConstraints);
+
+ lblZone.setText("Zone:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblZone, gridBagConstraints);
+
+ txtZone.setColumns(30);
+ txtZone.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtZone, gridBagConstraints);
+
+ lblResource.setText("Resource:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblResource, gridBagConstraints);
+
+ txtResource.setColumns(30);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtResource, gridBagConstraints);
+
+ lblUserName.setText("User Name:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblUserName, gridBagConstraints);
+
+ txtUserName.setColumns(30);
+ txtUserName.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtUserName, gridBagConstraints);
+
+ lblPassword.setText("Password:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblPassword, gridBagConstraints);
+
+ password.setColumns(30);
+ password.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(password, gridBagConstraints);
+
+ chkAdvancedLogin.setText("Advanced Login Settings");
+ chkAdvancedLogin.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkAdvancedLoginActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkAdvancedLogin);
+
+ chkGuestLogin.setText("Login As Guest");
+ chkGuestLogin.setToolTipText("Use a guest login");
+ chkGuestLogin.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkGuestLoginActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkGuestLogin);
+
+ chkProxyLogin.setText("Use GSI");
+ chkProxyLogin.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkProxyLoginActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkProxyLogin);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 10;
+ pnlLoginInfo.add(jPanel1, gridBagConstraints);
+
+ lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+ lblLoginMode.setText("Login Mode:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 9;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblLoginMode, gridBagConstraints);
+
+ comboLoginMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Standard", "PAM" }));
+ comboLoginMode.setToolTipText("Authentication mode used at login");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 9;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ pnlLoginInfo.add(comboLoginMode, gridBagConstraints);
+
+ lblProxy.setText("Proxy location:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblProxy, gridBagConstraints);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ pnlLoginInfo.add(txtProxy, gridBagConstraints);
+
+ lblCerts.setText("Certificates location:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 8;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblCerts, gridBagConstraints);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 8;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ pnlLoginInfo.add(txtCerts, gridBagConstraints);
+
+ btnProxy.setText("Choose...");
+ btnProxy.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnProxyActionPerformed(evt);
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 7;
+ pnlLoginInfo.add(btnProxy, gridBagConstraints);
+
+ btnCerts.setText("Choose...");
+ btnCerts.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCertsActionPerformed(evt);
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 8;
+ pnlLoginInfo.add(btnCerts, gridBagConstraints);
+
+ getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
+
+ pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 5));
+
+ btnOK.setMnemonic('L');
+ btnOK.setText("Login");
+ btnOK.setMaximumSize(new java.awt.Dimension(100, 100));
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlToolbar.add(btnOK);
+
+ btnCancel.setMnemonic('c');
+ btnCancel.setText("Cancel");
+ btnCancel.setMaximumSize(new java.awt.Dimension(100, 100));
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlToolbar.add(btnCancel);
+
+ getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
+
+ lblLogin.setText("Please log in to your iDrop data grid");
+ getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void chkProxyLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkProxyLoginActionPerformed
+ if(chkProxyLogin.isSelected()){
+ chkGuestLogin.setSelected(false);
+ //hide username/pass
+ hideForGuestLogin();
+ showProxyLoginFields();
+ }else{
+ //show username/password
+ showWhenGuestLogin();
+ hideProxyLoginFields();
+ }
+ }//GEN-LAST:event_chkProxyLoginActionPerformed
+
+ private void btnProxyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProxyActionPerformed
+ final JFileChooser chooser = new JFileChooser();
+ chooser.setFileHidingEnabled(false);
+ int res = chooser.showOpenDialog(this);
+ if(res == JFileChooser.APPROVE_OPTION){
+ if(chooser.getSelectedFile().canRead()){
+ txtProxy.setText(chooser.getSelectedFile().getAbsolutePath());
+ }
+ }
+ }//GEN-LAST:event_btnProxyActionPerformed
+
+ private void btnCertsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCertsActionPerformed
+ final JFileChooser chooser = new JFileChooser();
+ chooser.setFileHidingEnabled(false);
+ chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ int res = chooser.showOpenDialog(this);
+ if(res == JFileChooser.APPROVE_OPTION){
+ txtCerts.setText(chooser.getSelectedFile().getAbsolutePath());
+ }
+ }//GEN-LAST:event_btnCertsActionPerformed
private void chkAdvancedLoginActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_chkAdvancedLoginActionPerformed
@@ -526,9 +666,12 @@ public class LoginDialog extends JDialog {
private void chkGuestLoginActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_chkGuestLoginActionPerformed
if (chkGuestLogin.isSelected()) {
+ chkProxyLogin.setSelected(false);
+ hideProxyLoginFields();
hideForGuestLogin();
+
} else {
- showWhenGuestLogin();
+ showWhenGuestLogin();
}
}// GEN-LAST:event_chkGuestLoginActionPerformed
@@ -539,32 +682,37 @@ public class LoginDialog extends JDialog {
private void btnCancelActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCancelActionPerformed
dispose();
}// GEN-LAST:event_btnCancelActionPerformed
- // Variables declaration - do not modify//GEN-BEGIN:variables
-
- private javax.swing.JButton btnCancel;
- private javax.swing.JButton btnOK;
- private javax.swing.JCheckBox chkAdvancedLogin;
- private javax.swing.JCheckBox chkGuestLogin;
- private javax.swing.JComboBox comboLoginMode;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JLabel lblHost;
- private javax.swing.JLabel lblLogin;
- private javax.swing.JLabel lblLoginMode;
- private javax.swing.JLabel lblPassword;
- private javax.swing.JLabel lblPort;
- private javax.swing.JLabel lblResource;
- private javax.swing.JLabel lblUserName;
- private javax.swing.JLabel lblZone;
- private javax.swing.JPasswordField password;
- private javax.swing.JPanel pnlLoginInfo;
- private javax.swing.JPanel pnlToolbar;
- private javax.swing.JTextField txtHost;
- private javax.swing.JTextField txtPort;
- private javax.swing.JTextField txtResource;
- private javax.swing.JTextField txtUserName;
- private javax.swing.JTextField txtZone;
-
- // End of variables declaration//GEN-END:variables
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnCerts;
+ private javax.swing.JButton btnOK;
+ private javax.swing.JButton btnProxy;
+ private javax.swing.JCheckBox chkAdvancedLogin;
+ private javax.swing.JCheckBox chkGuestLogin;
+ private javax.swing.JCheckBox chkProxyLogin;
+ private javax.swing.JComboBox comboLoginMode;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JLabel lblCerts;
+ private javax.swing.JLabel lblHost;
+ private javax.swing.JLabel lblLogin;
+ private javax.swing.JLabel lblLoginMode;
+ private javax.swing.JLabel lblPassword;
+ private javax.swing.JLabel lblPort;
+ private javax.swing.JLabel lblProxy;
+ private javax.swing.JLabel lblResource;
+ private javax.swing.JLabel lblUserName;
+ private javax.swing.JLabel lblZone;
+ private javax.swing.JPasswordField password;
+ private javax.swing.JPanel pnlLoginInfo;
+ private javax.swing.JPanel pnlToolbar;
+ private javax.swing.JTextField txtCerts;
+ private javax.swing.JTextField txtHost;
+ private javax.swing.JTextField txtPort;
+ private javax.swing.JTextField txtProxy;
+ private javax.swing.JTextField txtResource;
+ private javax.swing.JTextField txtUserName;
+ private javax.swing.JTextField txtZone;
+ // End of variables declaration//GEN-END:variables
private void showAdvancedViewFields() {
txtResource.setVisible(true);
@@ -595,4 +743,25 @@ public class LoginDialog extends JDialog {
lblPassword.setVisible(true);
password.setVisible(true);
}
+
+ private void showProxyLoginFields(){
+ lblProxy.setVisible(true);
+ txtProxy.setVisible(true);
+ btnProxy.setVisible(true);
+ lblCerts.setVisible(true);
+ txtCerts.setVisible(true);
+ btnCerts.setVisible(true);
+ }
+
+ private void hideProxyLoginFields(){
+ lblProxy.setVisible(false);
+ txtProxy.setVisible(false);
+ btnProxy.setVisible(false);
+ lblCerts.setVisible(false);
+ txtCerts.setVisible(false);
+ btnCerts.setVisible(false);
+ }
+
+
+
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index a7a98f5..0b64246 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -35,6 +35,10 @@ public interface IdropConfigurationService {
public static final String ACCOUNT_CACHE_USER_NAME = "irods.account.user";
public static final String ACCOUNT_CACHE_ROOT_DIR = "irods.account.root.dir";
public static final String ACCOUNT_CACHE_LOGIN_MODE = "irods.account.login.mode";
+ // for GSI
+ public static final String ACCOUNT_CACHE_PROXY_LOCATION = "irods.account.gsi.proxy.location";
+ public static final String ACCOUNT_CACHE_CERTIFICATES_LOCATION = "irods.account.gsi.certificates.location";
+ // /for GSI
public static final String POLICY_AWARE_PROPERTY = "policy.aware";
public static final String LOOK_AND_FEEL = "idrop.lookandfeel";
public static final String TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES = "transferengine.record.successful.files";
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
index c2d1dc7..b37b121 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
@@ -1,5 +1,5 @@
package org.irods.jargon.idrop.desktop.systraygui.utils;
public final class Version {
public static String VERSION="2.0.1-SNAPSHOT";
- public static String BUILD_TIME="20130605-1641";
+ public static String BUILD_TIME="20130704-1120";
}