Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4543 - in branches/perfsonarui: ant jars/axis jars/xalan src src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/aa src/org/perfsonar/perfsonarui/aa/resources src/org/perfsonar/perfsonarui/config src/org/perfsonar/perfsonarui/test/aa src/org/perfsonar/perfsonarui/ui

Subject: perfsonar development work

List archive

perfsonar: r4543 - in branches/perfsonarui: ant jars/axis jars/xalan src src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/aa src/org/perfsonar/perfsonarui/aa/resources src/org/perfsonar/perfsonarui/config src/org/perfsonar/perfsonarui/test/aa src/org/perfsonar/perfsonarui/ui


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4543 - in branches/perfsonarui: ant jars/axis jars/xalan src src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/aa src/org/perfsonar/perfsonarui/aa/resources src/org/perfsonar/perfsonarui/config src/org/perfsonar/perfsonarui/test/aa src/org/perfsonar/perfsonarui/ui
  • Date: Thu, 25 Sep 2008 08:05:05 -0400

Author: nina
Date: 2008-09-25 08:05:05 -0400 (Thu, 25 Sep 2008)
New Revision: 4543

Added:
branches/perfsonarui/jars/axis/commons-collections-3.1.jar
branches/perfsonarui/jars/axis/commons-lang-2.1.jar
branches/perfsonarui/jars/axis/edugain-1.0-RC2.jar
branches/perfsonarui/jars/axis/openws-trunk-jdk-1.5.jar
branches/perfsonarui/jars/axis/perfsonar-base-1.0.20080924.jar
branches/perfsonarui/jars/axis/velocity-1.5.jar
branches/perfsonarui/jars/xalan/xerces-2.9.1-xercesImpl.jar
branches/perfsonarui/jars/xalan/xerces-2.9.1-xml-apis.jar
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/Stream2FileTool.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/

branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/ValidComponentsFile

branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/eduGAINtruststore.jks
Removed:
branches/perfsonarui/jars/axis/edugain-0.6.jar
branches/perfsonarui/jars/axis/edugain-0.7alpha.jar
branches/perfsonarui/jars/axis/opensaml-2.0-TP2-jdk-1.5.jar
branches/perfsonarui/jars/axis/opensaml1-1.1.jar
branches/perfsonarui/jars/axis/perfsonar-base-1.0.20080225.jar
branches/perfsonarui/jars/axis/xmltooling-1.0-TP2-jdk-1.5.jar
branches/perfsonarui/jars/xalan/xerces-xml-apis-2.8.0.jar
branches/perfsonarui/jars/xalan/xercesImpl-2.8.0.jar
Modified:
branches/perfsonarui/ant/build.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AACertificate.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AAPerfsonarRequest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/ICredentialsListener.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/SwingCredentialListener.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/config/MA.conf

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/AASupportTest.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/SwingCredentialListenerTest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/TestAA.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfsonarModel.java
branches/perfsonarui/src/resources.files
Log:
Changes (code and dependencies) necessary for AA to works with the new
edugain and perfsonarbase libraries. Improved SwingCredentialListener (UI for
selecting IdP). PerfsonarUI version updated to 0.13

Modified: branches/perfsonarui/ant/build.xml
===================================================================
--- branches/perfsonarui/ant/build.xml 2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/ant/build.xml 2008-09-25 12:05:05 UTC (rev 4543)
@@ -22,7 +22,7 @@
-->
<project basedir="../" default="all" name="perfsonar">

- <property name="version" value="0.12b" />
+ <property name="version" value="0.13" />
<!-- compile options -->
<property name="build.sysclasspath" value="ignore" />
<property name="build.compiler" value="modern" />

Added: branches/perfsonarui/jars/axis/commons-collections-3.1.jar


Property changes on:
branches/perfsonarui/jars/axis/commons-collections-3.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Added: branches/perfsonarui/jars/axis/commons-lang-2.1.jar


Property changes on: branches/perfsonarui/jars/axis/commons-lang-2.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Deleted: branches/perfsonarui/jars/axis/edugain-0.6.jar

Deleted: branches/perfsonarui/jars/axis/edugain-0.7alpha.jar

Added: branches/perfsonarui/jars/axis/edugain-1.0-RC2.jar


Property changes on: branches/perfsonarui/jars/axis/edugain-1.0-RC2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Deleted: branches/perfsonarui/jars/axis/opensaml-2.0-TP2-jdk-1.5.jar

Deleted: branches/perfsonarui/jars/axis/opensaml1-1.1.jar

Added: branches/perfsonarui/jars/axis/openws-trunk-jdk-1.5.jar


Property changes on: branches/perfsonarui/jars/axis/openws-trunk-jdk-1.5.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Deleted: branches/perfsonarui/jars/axis/perfsonar-base-1.0.20080225.jar

Added: branches/perfsonarui/jars/axis/perfsonar-base-1.0.20080924.jar


Property changes on:
branches/perfsonarui/jars/axis/perfsonar-base-1.0.20080924.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Added: branches/perfsonarui/jars/axis/velocity-1.5.jar


Property changes on: branches/perfsonarui/jars/axis/velocity-1.5.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Deleted: branches/perfsonarui/jars/axis/xmltooling-1.0-TP2-jdk-1.5.jar

Added: branches/perfsonarui/jars/xalan/xerces-2.9.1-xercesImpl.jar


Property changes on:
branches/perfsonarui/jars/xalan/xerces-2.9.1-xercesImpl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Added: branches/perfsonarui/jars/xalan/xerces-2.9.1-xml-apis.jar


Property changes on: branches/perfsonarui/jars/xalan/xerces-2.9.1-xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Deleted: branches/perfsonarui/jars/xalan/xerces-xml-apis-2.8.0.jar

Deleted: branches/perfsonarui/jars/xalan/xercesImpl-2.8.0.jar

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -25,6 +25,7 @@
import java.util.Hashtable;
import java.util.List;

+import org.perfsonar.perfsonarui.aa.AACertificate;
import org.perfsonar.perfsonarui.aa.IAACapable;
import org.perfsonar.perfsonarui.aa.ICredentialsListener;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
@@ -59,7 +60,7 @@
*
*/
public abstract class SmartMARequest extends AbstractMARequest implements
IAACapable {
- protected String mds_url="http://mds.edugain.org:8080";;
+ protected String mds_url=AACertificate.MDS_DEFAULT;
protected boolean aa_enabled = false;
protected boolean parallel = true;
protected int requestsRunning = 0;

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AACertificate.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AACertificate.java
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AACertificate.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -24,9 +24,12 @@

package org.perfsonar.perfsonarui.aa;

+import java.io.File;
import java.security.KeyPair;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;

import net.geant.edugain.meta.metadata.BEMetaData;
@@ -42,6 +45,15 @@
import org.perfsonar.perfsonarui.plugins.MAEndpoint;

public class AACertificate {
+ public static final String FILE_ValidComponentsFile =
"ValidComponentsFile";
+ public static final String FILE_eduGAINtruststore =
"eduGAINtruststore.jks";
+ public static final String FILE_ClientSASLCA = "ClientSASLCA.jks";
+
+ public static final String MDS_DEFAULT =
"https://mds.rediris.es:8443";;
+ public static final String GIdP_DEFAULT = "gidp.geant2.net";
+ public static final String GIdP_Port_DEFAULT = "4088";
+
+
protected static PSLogger logger = new PSLogger(AASupport.class);

private X509Certificate x509 = null;
private KeyPair keyPair = null;
@@ -62,7 +74,7 @@

}

- public synchronized void retrieveCertificate(String
mds_url,ICredentialsListener credentialsListener) throws PSException {
+ public synchronized void retrieveCertificate(String
mds_url,ICredentialsListener<CAInterface> credentialsListener) throws
PSException {
logger.debug("Retrieving new certificate...");
MAEndpoint mds = new
MAEndpoint("MDS,"+mds_url+",,,,mds,mds");
try {
@@ -71,10 +83,22 @@
}

List<CAInterface> idproviders =
queryMDS(mds.getEndpoint());
- if (idproviders.size() == 0) throw new
PSException(mds,"No CA online");
+ Collections.sort(idproviders, new
Comparator<CAInterface>() {
+ public int compare(CAInterface o1,
CAInterface o2) {
+ return
o1.getId().compareTo(o2.getId());
+ }
+ });
+ CAInterface cai = null;
+ if (idproviders.size() == 0) {
+ cai = new CAInterface();
+
cai.setContactURL(GIdP_DEFAULT+":"+GIdP_Port_DEFAULT);
+ cai.setId("GIdP (Default)");
+ cai.setDescription("No IdP received
from MDS, using the default one");
+ idproviders.add(cai);
+ logger.warn("No IdP received from
MDS, using default "+cai);
+ }
+ cai =
credentialsListener.selectIdentityProvider(idproviders, "", "");

-
- CAInterface cai =
credentialsListener.selectIdentityProvider(idproviders, "", "");
if (cai != null) {

int p =
cai.getContactURL().lastIndexOf(':');
@@ -103,7 +127,7 @@

public SASLCAClient querySASL(String username, String userpass,
String saslhost, int saslport) throws PerfSONARException {

- System.setProperty("javax.net.ssl.trustStore",
"ClientSASLCA.jks");
+ System.setProperty("javax.net.ssl.trustStore",
AACertificate.FILE_ClientSASLCA);
System.setProperty("javax.net.ssl.trustStorePassword",
"123456");
System.setProperty("javax.net.ssl.trustStoreType", "jceks");

@@ -133,7 +157,9 @@
List<BEMetaData> bes = null;

try {
- bes =
EduGAINMetadataService.getOrganizationList(mds);
+ File eduGAINtruststore =
Stream2FileTool.load("org/perfsonar/perfsonarui/aa/resources/"+FILE_eduGAINtruststore,FILE_eduGAINtruststore);
+ File validComponentsFile =
Stream2FileTool.load("org/perfsonar/perfsonarui/aa/resources/"+FILE_ValidComponentsFile,FILE_ValidComponentsFile);
+
bes=EduGAINMetadataService.getOrganizationList(mds,
eduGAINtruststore.getAbsolutePath() , "12345678" ,
validComponentsFile.getAbsolutePath() );
} catch (Throwable x){
throw new PerfSONARException(mds,x);
}
@@ -143,14 +169,14 @@
ArrayList<CAInterface> idProviders = new
ArrayList<CAInterface>();
for (int i=0; i<bes.size(); i++) {
BEMetaData be=bes.get(i);
- //logger.info("Bridging Element
"+be.getComponentID());
+

- CAInterface caonline=be.getCAInterface();
- if (caonline!=null) {
- idProviders.add(caonline);
- logger.info("*** CA online:
"+caonline.getContactURL() + "\t" + caonline.getDescription() + "\t" +
caonline.getName());
+ CAInterface idprovider=be.getCAInterface();
+ if (idprovider!=null) {
+ idProviders.add(idprovider);
+ logger.info("*** CA online:
"+idprovider.getContactURL() + "\t" + idprovider.getId());

- }
+ } else logger.warn("Bridging Element "+
be.getComponentID() + " getIDPInterface returns null");

}
return idProviders;

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AAPerfsonarRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AAPerfsonarRequest.java
2008-09-24 10:29:54 UTC (rev 4542)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/AAPerfsonarRequest.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -78,7 +78,7 @@
}
public SASLCAClient querySASL(String username, String userpass,
String saslhost, int saslport) throws PerfSONARException {

- System.setProperty("javax.net.ssl.trustStore",
"ClientSASLCA.jks");
+ System.setProperty("javax.net.ssl.trustStore",
AACertificate.FILE_ClientSASLCA);
System.setProperty("javax.net.ssl.trustStorePassword",
"123456");
System.setProperty("javax.net.ssl.trustStoreType", "jceks");

@@ -94,61 +94,7 @@


}
- public List<CAInterface> queryMDS(String mds) throws
PerfSONARException{
-
System.setProperty("javax.xml.datatype.DatatypeFactory",
"org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl");
-
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
-
System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");
-
System.setProperty("javax.xml.validation.SchemaFactory",
"org.apache.xerces.jaxp.validation.XMLSchemaFactory");
-
System.setProperty("org.w3c.dom.DOMImplementationSourceList",
"org.apache.xerces.dom.DOMXSImplementationSourceImpl");
- System.setProperty("org.xml.sax.driver",
"org.apache.xerces.parsers.SAXParser");
-
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema","org.apache.xerces.jaxp.validation.XMLSchemaFactory";);
-
System.setProperty("javax.xml.soap.MessageFactory","org.apache.axis.soap.MessageFactoryImpl");
-
- //List<BEMetaData> bes= null;
- List<BEMetaData> bes = null;
-
- bes = EduGAINMetadataService.getOrganizationList(mds);
- //bes = getOrganizationList(mds);
- ArrayList<CAInterface> idProviders = new
ArrayList<CAInterface>();
- for (int i=0; i<bes.size(); i++) {
- BEMetaData be=bes.get(i);
- //logger.info("Bridging Element
"+be.getComponentID());
-
- CAInterface caonline=be.getCAInterface();
- if (caonline!=null) {
- idProviders.add(caonline);
- logger.info("*** CA online:
"+caonline.getContactURL() + "\t" + caonline.getDescription() + "\t" +
caonline.getName());
-
- }
-
- }
- return idProviders;
- }
- /*
- public static List<BEMetaData> getOrganizationList(String uriMds)
throws PerfSONARException {
- List<BEMetaData> list=new LinkedList<BEMetaData>();
- try {
- MetaDataRequester requester=new MetaDataRequester();
- StringBuffer sb = requester.requestMetaData(new
URL(uriMds));
- DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);

- DocumentBuilder builder =
factory.newDocumentBuilder();
- Document mdsInfo=builder.parse(new
ByteArrayInputStream(sb.toString().getBytes()));
-
- NodeList nodelist =
org.apache.xpath.XPathAPI.selectNodeList(mdsInfo,
"//md:EntityDescriptor[@entityID]");
- for (int i=0; i<nodelist.getLength(); i++) {
- Element hbe=(Element)nodelist.item(i);
- BEMetaData m = new BEMetaData();
-
- }
-
- return list;
- } catch (Exception e) {
- throw new
PerfSONARException("error.as.mds_query","EduGAINMetadataService: a problem
querying the MDS: "+e.getMessage());
- }
- }
- */
public ICredentialsListener getCredentialsListener() {
return AASupport.getInstance().getCredentialsListener();
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/ICredentialsListener.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/ICredentialsListener.java
2008-09-24 10:29:54 UTC (rev 4542)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/ICredentialsListener.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -3,10 +3,10 @@
import java.awt.Component;
import java.util.List;

-import net.geant.edugain.meta.metadata.CAInterface;
+import net.geant.edugain.meta.metadata.RoleInterface;

-public interface ICredentialsListener {
- CAInterface selectIdentityProvider(List<CAInterface> idProviders,
String username, String userPass);
+public interface ICredentialsListener<R extends RoleInterface> {
+ R selectIdentityProvider(List<R> idProviders, String username, String
userPass);
void setDialogParentComponent(Component parent);
public String getUserName();
public String getPassword();

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/Stream2FileTool.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/SwingCredentialListener.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/SwingCredentialListener.java
2008-09-24 10:29:54 UTC (rev 4542)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/SwingCredentialListener.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -1,28 +1,34 @@
package org.perfsonar.perfsonarui.aa;

import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

+import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
+import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
+import javax.swing.ListCellRenderer;

import net.geant.edugain.meta.metadata.CAInterface;

import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.GroupLayout.SequentialGroup;

-public class SwingCredentialListener extends JPanel implements
ICredentialsListener{
+public class SwingCredentialListener extends JPanel implements
ICredentialsListener<CAInterface>{
protected JFormattedTextField usernameField;
protected JPasswordField passwordField;
protected JComboBox idProvidersBox;
+ protected ComboBoxRenderer renderer;
protected Component parent = null;
- protected String url = "";
+ protected CAInterface selected = null;
/**
*
*/
@@ -37,10 +43,17 @@
idProvidersBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JComboBox cb = (JComboBox)e.getSource();
- url = (String)cb.getSelectedItem();
+ selected = (CAInterface)cb.getSelectedItem();
}
});

+ renderer = new ComboBoxRenderer();
+ FontMetrics fm =
idProvidersBox.getFontMetrics(idProvidersBox.getFont());
+ renderer.setPreferredSize(new
Dimension(fm.stringWidth("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW"),
fm.getHeight()*5));
+ idProvidersBox.setRenderer(renderer);
+// idProvidersBox.setMaximumRowCount(3);
+
+
JLabel usernameLabel = new JLabel("User");
JLabel passwordLabel = new JLabel("Password");
usernameField = new JFormattedTextField();
@@ -103,18 +116,14 @@
passwordField.setText(userPass);
idProvidersBox.removeAllItems();
for (int i=0; i < idProviders.size();i++)
-
idProvidersBox.addItem(idProviders.get(i).getContactURL());
+ idProvidersBox.addItem(idProviders.get(i));

idProvidersBox.setSelectedIndex(0);
- url = idProvidersBox.getItemAt(0).toString();
+ selected = (CAInterface)idProvidersBox.getItemAt(0);

JOptionPane.showMessageDialog(parent, this, "Enter
credentials", JOptionPane.PLAIN_MESSAGE, null);
-
- for (int i=0; i < idProviders.size();i++)
- if (url.equals(idProviders.get(i).getContactURL()))
- return idProviders.get(i);

- return null;
+ return selected;
}


@@ -122,3 +131,67 @@
this.parent = parent;
}
}
+
+class ComboBoxRenderer extends JLabel implements ListCellRenderer {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1618494807722973220L;
+
+
+ public ComboBoxRenderer() {
+ super();
+ setOpaque(true);
+ setHorizontalAlignment(LEFT);
+ setVerticalAlignment(TOP);
+ }
+
+
+ public Component getListCellRendererComponent(
+ JList list,
+ Object value,
+ int index,
+ boolean isSelected,
+ boolean cellHasFocus) {
+
+ if (isSelected) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ } else {
+ setBackground(list.getBackground());
+ setForeground(list.getForeground());
+ }
+
+ if (value != null) {
+ CAInterface cai = (CAInterface) value;
+ StringBuffer b = new StringBuffer();
+ b.append("<html><table>");
+ if (cai.getId() != null) {
+ b.append("<tr><th>ID:</th><td><b>");
+ b.append(cai.getId());
+ b.append("</b></td></tr>");
+ }
+ if (cai.getContactURL() != null) {
+ b.append("<tr><th><b>URL:</b></th><td><u>");
+ b.append(cai.getContactURL());
+ b.append("</u></td></tr>");
+ }
+ if (cai.getDescription() != null) {
+ b.append("<tr><td></td><td><i>");
+ b.append(cai.getDescription());
+ b.append("</i></td></tr>");
+ }

+ b.append("</table></html>");
+ setText(b.toString());
+ setFont(list.getFont());
+ }
+
+ return this;
+ }
+
+
+
+}
+
+

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/ValidComponentsFile

Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/eduGAINtruststore.jks


Property changes on:
branches/perfsonarui/src/org/perfsonar/perfsonarui/aa/resources/eduGAINtruststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/config/MA.conf
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/config/MA.conf
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/config/MA.conf
2008-09-25 12:05:05 UTC (rev 4543)
@@ -49,6 +49,6 @@

FCCN-LS,http://mdm01.fccn.pt:8080/XML-LS-1.1.1/services/LookupService,ls,"",ls,ls

PIONIER-LS,http://ls.perfsonar.pionier.net.pl:8080/XML-LS-1.1.1/services/LookupService,ls,"",ls,ls

PIONIER-homeLS,http://ls.perfsonar.pionier.net.pl:8080/xml-ls/services/LookupService,hls,"",ls,ls
-PIONIER-globalLS,http://loco4.man.poznan.pl:8180/gls/services/LookupService,gls,"",ls,ls
+GEANT2-globalLS,http://ls.perfsonar.pionier.net.pl:9990/perfSONAR_PS/services/gLS,gls,"",ls,ls

;SURFNET-homeLS,http://sonar1.amsterdam.surfnet.nl:8080/xml-ls-home/services/LookupService,hls,"",ls,ls

GN2-homeLS,http://loco4.man.poznan.pl:8180/xml-ls-gn2/services/LookupService,hls,"",ls,ls
\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/AASupportTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/AASupportTest.java
2008-09-24 10:29:54 UTC (rev 4542)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/AASupportTest.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -31,6 +31,8 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

+import javax.swing.UIManager;
+
import org.perfsonar.perfsonarui.aa.AACertificate;
import org.perfsonar.perfsonarui.aa.AASupport;

@@ -40,13 +42,13 @@
public class AASupportTest extends TestCase {
protected ExecutorService executor = Executors.newFixedThreadPool(5);
public void test() throws Exception {
-
+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
ArrayList<Future<AACertificate>> f = new
ArrayList<Future<AACertificate>>();
for (int i=0; i < 10; i++)
f.add(executor.submit(new Callable<AACertificate>() {
public AACertificate call() throws Exception {
AASupport a = AASupport.getInstance();
-
a.setMds_url("http://mds.edugain.org:8080";);
+
a.setMds_url(AACertificate.MDS_DEFAULT);
return a.getCertificate();
}
})

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/SwingCredentialListenerTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/SwingCredentialListenerTest.java
2008-09-24 10:29:54 UTC (rev 4542)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/SwingCredentialListenerTest.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -3,6 +3,8 @@
import java.util.ArrayList;
import java.util.List;

+import javax.swing.UIManager;
+
import junit.framework.TestCase;

import net.geant.edugain.meta.metadata.CAInterface;
@@ -15,22 +17,28 @@
/*
* Test method for
'org.perfsonar.aa.SwingCredentialListener.getInput()'
*/
- public void testGetInput() {
- ICredentialsListener l = new SwingCredentialListener();
+ public void testGetInput() throws Exception {
+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ ICredentialsListener<CAInterface> l = new
SwingCredentialListener();
String username ="";
String userPass ="";
List<CAInterface> idProviders = new ArrayList<CAInterface>();
CAInterface cai = new CAInterface();
- cai.setContactURL("test1");
+ cai.setId("test1 ID");
+ cai.setContactURL("http://test1.url";);
+ cai.setDescription("test 1 description");
idProviders.add(cai);
cai = new CAInterface();
- cai.setContactURL("test2");
+ cai.setId("test2 ID");
+ cai.setContactURL("http://test2.url";);
+ cai.setDescription("test 2 description");
idProviders.add(cai);
cai = l.selectIdentityProvider(idProviders, username,
userPass);
if (cai != null){
System.out.println(username);
System.out.println(userPass);
}
+ assertNotNull(cai);
}

}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/TestAA.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/TestAA.java
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/test/aa/TestAA.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -24,6 +24,7 @@

package org.perfsonar.perfsonarui.test.aa;

+import java.io.File;
import java.io.FileInputStream;
import java.security.KeyPair;
import java.security.KeyStore;
@@ -36,14 +37,19 @@
import java.util.List;

import junit.framework.TestCase;
+import net.geant.edugain.meta.metadata.AAInterface;
import net.geant.edugain.meta.metadata.BEMetaData;
import net.geant.edugain.meta.metadata.CAInterface;
+import net.geant.edugain.meta.metadata.EGAttribute;
+import net.geant.edugain.meta.metadata.IDPInterface;
+import net.geant.edugain.meta.metadata.RoleInterface;

import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.client.base.authn.edugain.EduGAINMetadataService;
import org.perfsonar.client.base.authn.saslca.SASLCAClient;
import org.perfsonar.client.base.authn.saslca.SASLCAClientConfiguration;
import org.perfsonar.client.base.authn.saslca.UserID;
+import org.perfsonar.perfsonarui.aa.AACertificate;

/**
* Jars used:
@@ -168,60 +174,84 @@
*/
public class TestAA extends TestCase {
public void testMDS() throws Exception {
- String defaultMDS="http://mds.edugain.org:8080";;
//"http://mds.rediris.es:8080";;
- List<BEMetaData> bes= null;
+ System.setProperty("javax.xml.datatype.DatatypeFactory",
"org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl");
+
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
+ System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");
+ System.setProperty("javax.xml.validation.SchemaFactory",
"org.apache.xerces.jaxp.validation.XMLSchemaFactory");
+ System.setProperty("org.w3c.dom.DOMImplementationSourceList",
"org.apache.xerces.dom.DOMXSImplementationSourceImpl");
+ System.setProperty("org.xml.sax.driver",
"org.apache.xerces.parsers.SAXParser");
+
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema","org.apache.xerces.jaxp.validation.XMLSchemaFactory";);
+
System.setProperty("javax.xml.soap.MessageFactory","org.apache.axis.soap.MessageFactoryImpl");
+
+ String defaultMDS=AACertificate.MDS_DEFAULT;
+ List<BEMetaData> bes= null;

- bes =
EduGAINMetadataService.getOrganizationList(defaultMDS);
- /*
-Bridging Element urn:geant:edugain:component:be:feide:feide.no
-Bridging Element urn:geant:edugain:component:be:gidp_federation:dante.net
-*** CA online: srv2.ams.nl.geant2.net:4408
-Bridging Element urn:geant:edugain:component:be:href:niif.hu
-Bridging Element urn:geant:edugain:component:be:rediris:rediris.es
-*** CA online: homer.rediris.es:4408
-Bridging Element urn:geant:edugain:component:be:switch:switch.ch
- */
+ assertTrue(new
File(AACertificate.FILE_eduGAINtruststore).exists());
+ assertTrue(new
File(AACertificate.FILE_ValidComponentsFile).exists());
+ bes=EduGAINMetadataService.getOrganizationList(defaultMDS,
AACertificate.FILE_eduGAINtruststore ,
+ "12345678" ,
+ AACertificate.FILE_ValidComponentsFile );

+ assertNotNull(bes);
+ assertTrue(bes.size()>0);
+
+ int cainterfaces = 0;
for (int i=0; i<bes.size(); i++) {
BEMetaData be=bes.get(i);
System.out.println("Bridging Element
"+be.getComponentID());
+ RoleInterface caonline= be.getCAInterface();
+ printRoleInterface(caonline);
+ System.out.println("");
+ if (caonline != null)
+ cainterfaces++;

- CAInterface caonline=be.getCAInterface();
- if (caonline!=null) {
- System.out.println("*** CA online:
"+caonline.getContactURL() + "\t" + caonline.getDescription() + "\t" +
caonline.getName());
+ }
+ assertTrue(cainterfaces>0);

+ }
+ protected void printRoleInterface(RoleInterface ri) {
+ if (ri != null)
+ System.out.println(ri.getClass().getName() + "\t"
+ri.getContactURL()
+ + "\t" + ri.getId());
+ }
+/*
+Bridging Element urn:geant:edugain:component:be:dfn:orion40.dfn.de
+net.geant.edugain.meta.metadata.AAInterface
https://thor.aai.dfn.de/ShiBE-H/SAMLSOAPReceiver dfn-aa
+net.geant.edugain.meta.metadata.IDPInterface
https://thor.aai.dfn.de/ShiBE-H/WebSSORequestListener dfn-idp
+eduPersonPrincipalName []

- }
+Bridging Element urn:geant:edugain:component:be:rnp:unifacs
+net.geant.edugain.meta.metadata.IDPInterface
https://hbe.nuperc.unifacs.br/simplesaml/shib13/idp/SSOService.php
hbe.nuperc.unifacs.br

- }
+Bridging Element urn:geant:edugain:component:be:gidp:dante.net
+net.geant.edugain.meta.metadata.IDPInterface
http://gidp.geant2.net/simplesaml/shib13/idp/SSOService.php GIdP
+urn:mace:dir:attribute-def:eduPersonPrincipalName []
+urn:mace:dir:attribute-def:eduPersonEntitlement []
+urn:mace:dir:attribute-def:preferredLanguage []
+urn:mace:dir:attribute-def:sn []
+urn:mace:terena.org:schac:personalPosition []
+urn:mace:terena.org:schac:projectMembership []
+urn:mace:terena.org:schac:projectSpecificRole []
+urn:mace:terena.org:schac:shacHomeOrganization []
+urn:mace:terena.org:schac:schacHomeOrganizationType []

- }
- /*
- public void testMDS_example() {
- try {
- List<BridgingElement>
bes=EduGAINMetadataService.getOrganizationList();
- for (int i=0; i<bes.size(); i++) {
- BridgingElement be=bes.get(i);
- System.out.println("Bridging Element "+i+":
"+be.getOrganizationName()+" <-> "+be.getComponentID());
- }
- } catch (PerfSONARException e) {
- e.printStackTrace();
- }
- }
- */
+Bridging Element urn:geant:edugain:component:be:dame:PAPIorg:aa
+net.geant.edugain.meta.metadata.AAInterface
https://caligula.inf.um.es:8443/PAPIBE/attrrequest DAMePAPIAA
+ */
public void testSASL() throws Exception {
- final String PARAM_USERNAME="";
+ final String PARAM_USERNAME="first_nina-perfSONAR.net";
final String PARAM_USERPASS="perfsonar";

- final String PARAM_SASLCAHOST="srv2.ams.nl.geant2.net";
+ final String PARAM_SASLCAHOST=AACertificate.GIdP_DEFAULT;
final int PARAM_SASLCAPORT=4088;
X509Certificate certificate =
querySASL(PARAM_USERNAME,PARAM_USERPASS,PARAM_SASLCAHOST,PARAM_SASLCAPORT);
assertNotNull(certificate);
printCertificate(certificate);
}
+
public X509Certificate querySASL(String username, String userpass,
String saslhost, int saslport) throws PerfSONARException {

- System.setProperty("javax.net.ssl.trustStore",
"ClientSASLCA.jks");
+ System.setProperty("javax.net.ssl.trustStore",
AACertificate.FILE_ClientSASLCA);
System.setProperty("javax.net.ssl.trustStorePassword",
"123456");
System.setProperty("javax.net.ssl.trustStoreType", "jceks");

@@ -263,7 +293,7 @@

public void testKeystore() throws Exception {
KeyStore ks = KeyStore.getInstance("JCEKS");
- ks.load(new FileInputStream("ClientSASLCA.jks"),
"123456".toCharArray());
+ ks.load(new
FileInputStream(AACertificate.FILE_ClientSASLCA), "123456".toCharArray());
assertTrue(ks.containsAlias("ssl"));
assertTrue(ks.isCertificateEntry("ssl"));


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/MANIFESTAPP.MFT
2008-09-25 12:05:05 UTC (rev 4543)
@@ -1,12 +1,12 @@
Manifest-version: 1.0
Main-Class: org.perfsonar.perfsonarui.ui.PerfSonarApp
-Class-Path: jars/ui/swing-layout-1.0.jar jars/axis/saaj.jar
jars/axis/axis.jar jars/axis/axis-ant.jar jars/axis/commons-discovery-0.2.jar
jars/axis/commons-logging-1.0.4.jar jars/axis/jaxrpc.jar
jars/axis/log4j-1.2.15.jar jars/axis/wsdl4j-1.5.1.jar jars/xml/activation.jar
jars/xml/mail.jar jars/xml/jdom.jar jars/ui/jcommon-1.0.10.jar
jars/ui/jfreechart-1.0.6.jar jars/l2fprod/l2fprod-common-all.jar
jars/xml/commons-cli-1.0.jar jars/dns/dnsjava-2.0.3.jar
jars/axis/codec-1.0.jar jars/axis/bcprov-jdk15-138.jar
jars/axis/edugain-0.7alpha.jar jars/axis/javolution-3.7.jar
jars/axis/joda-time-1.4.jar jars/axis/opensaml1-1.1.jar
jars/axis/opensaml-2.0-TP2-jdk-1.5.jar
jars/axis/perfsonar-base-1.0.20080225.jar jars/axis/sasl-ca-1.0.jar
jars/axis/wsdl4j-1.5.1.jar jars/axis/wss4j-1.5.3.jar
jars/axis/xmlsec-1.4.1.jar jars/axis/xmltooling-1.0-TP2-jdk-1.5.jar
jars/xalan/xalan-2.7.0.jar jars/xalan/xalan-serializer-2.7.0.jar
jars/xalan/xercesImpl-2.8.0.jar jars/xalan/xerces-xml-apis-2.8.0.jar
+Class-Path: jars/ui/swing-layout-1.0.jar jars/axis/saaj.jar
jars/axis/axis.jar jars/axis/axis-ant.jar jars/axis/commons-discovery-0.2.jar
jars/axis/commons-logging-1.0.4.jar jars/axis/jaxrpc.jar
jars/axis/log4j-1.2.15.jar jars/axis/wsdl4j-1.5.1.jar jars/xml/activation.jar
jars/xml/mail.jar jars/xml/jdom.jar jars/ui/jcommon-1.0.10.jar
jars/ui/jfreechart-1.0.6.jar jars/l2fprod/l2fprod-common-all.jar
jars/xml/commons-cli-1.0.jar jars/dns/dnsjava-2.0.3.jar
jars/axis/codec-1.0.jar jars/axis/bcprov-jdk15-138.jar
jars/axis/edugain-1.0-RC2.jar jars/axis/javolution-3.7.jar
jars/axis/joda-time-1.4.jar jars/axis/opensaml-1.1.jar
jars/axis/opensaml-trunk-jdk-1.5.jar
jars/axis/perfsonar-base-1.0.20080924.jar jars/axis/sasl-ca-1.0.jar
jars/axis/wsdl4j-1.5.1.jar jars/axis/wss4j-1.5.3.jar
jars/axis/xmlsec-1.4.1.jar jars/axis/xmltooling-trunk-jdk-1.5.jar
jars/xalan/xalan-2.7.0.jar jars/xalan/xalan-serializer-2.7.0.jar
jars/xalan/xerces-2.9.1-xercesImpl.jar jars/xalan/xerces-2.9.1-xml-apis.ja
r jars/axis/slf4j-api-1.4.3.jar jars/axis/slf4j-simple-1.4.3.jar
jars/axis/velocity-1.5.jar jars/axis/commons-collections-3.1.jar
jars/axis/commons-lang-2.1.jar jars/axis/openws-trunk-jdk-1.5.jar
Specification-Title: perfSonar test application
-Specification-Version: 0.12b
+Specification-Version: 0.13
Specification-Vendor: perfsonar.acad.bg
Package-Title: org.perfsonar.perfsonarui
-Package-Version: 0.12b
+Package-Version: 0.13
Package-Vendor: acad.bg
Implementation-Title: Perfsonar UI
-Implementation-Version: 0.12b
+Implementation-Version: 0.13
Implementation-Vendor:

\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfsonarModel.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfsonarModel.java
2008-09-24 10:29:54 UTC (rev 4542)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfsonarModel.java
2008-09-25 12:05:05 UTC (rev 4543)
@@ -47,6 +47,7 @@
import org.perfsonar.perfsonarui.PSLogger;
import org.perfsonar.perfsonarui.ResponseData;
import org.perfsonar.perfsonarui.SmartMARequest;
+import org.perfsonar.perfsonarui.aa.AACertificate;
import org.perfsonar.perfsonarui.aa.IAACapable;
import org.perfsonar.perfsonarui.ls.LSManager;
import org.perfsonar.perfsonarui.ma.MAPerfsonarModel;
@@ -412,7 +413,7 @@
Option mds = OptionBuilder.withLongOpt("mds")
.hasArg()
.withArgName("URL")
- .withDescription("URL of Metadata Service, used to retrieve the list
of Identity Providers, default http://mds.rediris.es:8080";)
+ .withDescription("URL of Metadata Service, used to retrieve the list
of Identity Providers, default "+ AACertificate.MDS_DEFAULT)
.create( "m" );

Option aggregate = OptionBuilder.withLongOpt("aggregate")
@@ -491,31 +492,32 @@
logger.error( exp);
}
}
+ protected void fileDownload(String url, File file) throws Exception {
+ if (!file.exists()) {
+ logger.info("Downloading "+url + " to
"+file.getAbsolutePath());
+ URL u = new URL(url);
+ InputStream in = u.openStream();
+ FileOutputStream out = new FileOutputStream(file);
+ byte[] bytes = new byte[512];
+ int len;
+ long count = 0;
+// read() returns -1 on EOF
+ while ((len = in.read(bytes, 0, bytes.length)) >= 0) {
+ out.write(bytes, 0, len);
+ count += len;
+ }
+ out.flush();
+ out.close();
+ in.close();
+ }
+ }

protected void setOptions(CommandLine line) {
if( line.hasOption( 's' ) ) {
String url = line.getOptionValue( 's' );
try {
- File file = new File("ClientSASLCA.jks");
- if (!file.exists()) {
- logger.info("Downloading "+url + " to
"+file.getAbsolutePath());
- URL u = new URL(url);
- InputStream in = u.openStream();
- FileOutputStream out = new
FileOutputStream(file);
- byte[] bytes = new byte[512];
- int len;
- long count = 0;
- // read() returns -1 on EOF
- while ((len = in.read(bytes, 0,
bytes.length)) >= 0) {
- out.write(bytes, 0, len);
- count += len;
- }
- out.flush();
- out.close();
- in.close();
- }
-
-
+ File file = new File(AACertificate.FILE_ClientSASLCA);
+ fileDownload(url, file);
} catch (Exception x) {
try {
logger.error(x);
@@ -545,7 +547,7 @@
} catch (Exception x) {
logger.error(x);
}
- String mds = "http://mds.edugain.org:8080";;
+ String mds = AACertificate.MDS_DEFAULT;
if( line.hasOption( 'm' ) ) {
mds = line.getOptionValue( 'm' );
}

Modified: branches/perfsonarui/src/resources.files
===================================================================
--- branches/perfsonarui/src/resources.files 2008-09-24 10:29:54 UTC (rev
4542)
+++ branches/perfsonarui/src/resources.files 2008-09-25 12:05:05 UTC (rev
4543)
@@ -25,4 +25,6 @@
org/perfsonar/perfsonarui/ma/ResourceBundle.properties
org/perfsonar/perfsonarui/ResourceBundle.properties
org/perfsonar/perfsonarui/playground/ResourceBundle.properties
+org/perfsonar/perfsonarui/aa/resources/eduGAINtruststore.jks
+org/perfsonar/perfsonarui/aa/resources/ValidComponentsFile




  • perfsonar: r4543 - in branches/perfsonarui: ant jars/axis jars/xalan src src/org/perfsonar/perfsonarui src/org/perfsonar/perfsonarui/aa src/org/perfsonar/perfsonarui/aa/resources src/org/perfsonar/perfsonarui/config src/org/perfsonar/perfsonarui/test/aa src/org/perfsonar/perfsonarui/ui, svnlog, 09/25/2008

Archive powered by MHonArc 2.6.16.

Top of Page