perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6039 - in trunk: perfsonar-java-base2 perfsonar-java-base2/src/main/java/org/perfsonar/base2/client perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca perfsonar-java-base2/src/main/java/org/perfsonar/test perfsonar-java-rrd-ma-SQL_backend
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r6039 - in trunk: perfsonar-java-base2 perfsonar-java-base2/src/main/java/org/perfsonar/base2/client perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca perfsonar-java-base2/src/main/java/org/perfsonar/test perfsonar-java-rrd-ma-SQL_backend
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6039 - in trunk: perfsonar-java-base2 perfsonar-java-base2/src/main/java/org/perfsonar/base2/client perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca perfsonar-java-base2/src/main/java/org/perfsonar/test perfsonar-java-rrd-ma-SQL_backend
- Date: Tue, 27 Nov 2012 14:22:45 +0000 (GMT)
Author: nordunet.behrmann
Date: 2012-11-27 14:22:45 +0000 (Tue, 27 Nov 2012)
New Revision: 6039
Removed:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/RequestHandlerTest.java
Modified:
trunk/perfsonar-java-base2/pom.xml
trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml
Log:
perfsonar-java-base2, perfsonar-java-rrd-ma: Update repositories and
dependencies
jar-repository was removed in a recent cleanup of SVN. Since then
perfsonar-java-base2
and perfsonar-java-rrd-ma have failed to compile.
This commit updates the repository links and dependencies to once again allow
these
packages to compile. Several dependencies have been updated to newer versions.
The SASLCA client has been deleted as it appeared to be unused and allowed us
to
remove a number of dependencies on unmaintained libraries.
Modified: trunk/perfsonar-java-base2/pom.xml
===================================================================
--- trunk/perfsonar-java-base2/pom.xml 2012-11-27 11:17:20 UTC (rev 6038)
+++ trunk/perfsonar-java-base2/pom.xml 2012-11-27 14:22:45 UTC (rev 6039)
@@ -4,10 +4,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.geant.perfsonar</groupId>
- <artifactId>ps-mdm-base2</artifactId>
+ <artifactId>perfsonar-java-base2</artifactId>
<packaging>jar</packaging>
<name>Perfsonar Base2 package</name>
- <version>1.0.6</version>
+ <version>1.0.7</version>
<description>
The perfSONAR base provides a number of common, shared classes which
can be used by
MA, MP and Clients.
@@ -118,84 +118,154 @@
</build>
<repositories>
- <repository>
- <id>ibiblio</id>
- <name>ibiblio repository</name>
-
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
- </repository>
- <repository>
+ <repository>
+ <id>ibiblio</id>
+ <name>ibiblio repository</name>
+ <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
+ </repository>
+ <repository>
+ <id>shibboleth.internet2.edu</id>
+ <name>shibboleth repository</name>
+
<url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
+ </repository>
+ <repository>
+ <id>shibboleth-3rd-party</id>
+ <name>shibboleth 3rd party</name>
+
<url>https://build.shibboleth.net/nexus/content/repositories/thirdparty/</url>
+ </repository>
+ <repository>
<id>geant-repository</id>
<name>GEANT repository</name>
+ <url>https://artifactory.geant.net/artifactory/repo/</url>
+ </repository>
+ <repository>
+ <id>geant-repository-3rd-party</id>
+ <name>GEANT repository</name>
<url>https://artifactory.geant.net/artifactory/geant-repo/net/geant/3rdparty/</url>
- </repository>
- <repository>
- <id>perfsonar-old-repo</id>
- <name>old perfSONAR repository</name>
-
<url>http://svn.geant.net/GEANT/SA2/ps-java-services/trunk/jar-repository/</url>
- </repository>
- <repository>
- <id>codehaus-release-repo</id>
- <name>Codehaus Release Repo</name>
- <url>http://repository.codehaus.org</url>
- </repository>
+ </repository>
+ <repository>
+ <id>codehaus-release-repo</id>
+ <name>Codehaus Release Repo</name>
+ <url>http://repository.codehaus.org</url>
+ </repository>
</repositories>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-jaxws</artifactId>
<version>1.4.1</version>
<exclusions>
- <exclusion>
- <artifactId>stax-api</artifactId>
- <groupId>javax.xml.stream</groupId>
- </exclusion>
+ <exclusion>
+ <artifactId>stax-api</artifactId>
+ <groupId>javax.xml.stream</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xalan</artifactId>
+ <groupId>xalan</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<!-- got for auth -->
<dependency>
- <groupId>bouncycastle</groupId>
+ <groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId>
- <version>124</version>
+ <version>1.40</version>
</dependency>
<dependency>
- <groupId>edugain</groupId>
+ <groupId>net.geant2.edugain</groupId>
<artifactId>edugain</artifactId>
- <version>1.0-RC2</version>
+ <version>1.0-RC4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
- <groupId>perfsonar</groupId>
+ <groupId>net.geant.perfsonar</groupId>
<artifactId>perfsonar-authr</artifactId>
<version>0.5</version>
</dependency>
<dependency>
- <groupId>sasl-ca</groupId>
- <artifactId>sasl-ca</artifactId>
- <version>1.0</version>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ <version>1.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
- <groupId>codec</groupId>
- <artifactId>codec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>xmltooling</groupId>
- <artifactId>xmltooling</artifactId>
- <version>1.2.0</version>
- </dependency>
- <dependency>
<groupId>wss4j</groupId>
<artifactId>wss4j</artifactId>
<version>1.5.1</version>
@@ -217,30 +287,50 @@
<artifactId>xmlsec</artifactId>
<groupId>org.apache.santuario</groupId>
</exclusion>
+ <exclusion>
+ <artifactId>xalan</artifactId>
+ <groupId>xalan</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
+ <groupId>org.apache.xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
</dependency>
<dependency>
- <groupId>xerces</groupId>
- <artifactId>xerces-xml-apis</artifactId>
- <version>2.8.0</version>
+ <groupId>org.apache.xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>2.9.1</version>
</dependency>
<dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
+ <groupId>org.apache.xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
</dependency>
<dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan-serializer</artifactId>
- <version>2.7.0</version>
+ <groupId>org.apache.xerces</groupId>
+ <artifactId>serializer</artifactId>
+ <version>2.9.1</version>
</dependency>
<dependency>
- <groupId>com.sun.xacml</groupId>
+ <groupId>net.geant.perfsonar</groupId>
<artifactId>sunxacml</artifactId>
<version>1.2</version>
</dependency>
@@ -259,19 +349,25 @@
<artifactId>xmlrpc-client</artifactId>
<groupId>org.apache.xmlrpc</groupId>
<version>3.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.6</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.6.6</version>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.6</version>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml</artifactId>
<version>1.1</version>
@@ -285,6 +381,12 @@
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.4.6</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,223 +0,0 @@
-package org.perfsonar.base2.client;
-
-import java.io.ByteArrayOutputStream;
-import java.security.KeyPair;
-import java.security.PrivateKey;
-import java.security.cert.CertificateParsingException;
-import java.security.cert.X509Certificate;
-import java.text.DateFormat;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.rampart.util.Axis2Util;
-import org.perfsonar.base2.client.authn.AttrEERequestGenerator;
-import org.perfsonar.base2.client.authn.AuthNDataFactory;
-import org.perfsonar.base2.client.authn.AuthNEERequestGenerator;
-import org.perfsonar.base2.client.authn.AuthNX509Data;
-import org.perfsonar.base2.client.authn.saslca.SASLCAClient;
-import org.perfsonar.base2.client.authn.saslca.SASLCAClientConfiguration;
-import org.perfsonar.base2.client.authn.saslca.UserID;
-import org.perfsonar.base2.service.authn.AttrRequest;
-import org.perfsonar.base2.service.authn.AttrResponse;
-import org.perfsonar.base2.service.exceptions.PerfSONARException;
-import org.perfsonar.base2.service.requesthandler.ServiceMessage;
-import org.perfsonar.base2.xml.AXIOMCreator;
-import org.perfsonar.base2.xml.Element;
-import org.perfsonar.base2.xml.StaxParser;
-import org.perfsonar.base2.xml.nmwg.Message;
-import org.w3c.dom.Document;
-
-public class UbCSaslTest {
- private UserID userID;
-
- private SASLCAClientConfiguration clientConfig;
-
- private SASLCAClient client;
-
- public void test(String[] args) {
- try {
- String saslCAServer = null;
- String saslCAPort = null;
- String tsFile = null;
- String tsPassword = null;
- String tsType = null;
- String username = null;
- String userpassword = null;
- String oper = null;
- String endPoint = null;
-
- if (args.length == 9) {
- saslCAServer = args[0];
- saslCAPort = args[1];
- tsFile = args[2];
- tsPassword = args[3];
- tsType = args[4];
- username = args[5];
- userpassword = args[6];
- oper = args[7];
- endPoint = args[8];
- } else {
- System.out.println("Error: Wrong number (" +
args.length
- + "!= 9) of parameters!!!");
- return;
- }
- System.out.println("SASL CA Server: " + saslCAServer);
- System.out.println("SASL CA Port: " + saslCAPort);
- System.out.println("TrustStore File: " + tsFile);
- System.out.println("TrustStore Password: " +
tsPassword);
- System.out.println("TrustStore Type: " + tsType);
- System.out.println("Username: " + username);
- System.out.println("Password: " + userpassword);
- System.out.println("Operation: " + oper);
- System.out.println("End Point: " + endPoint);
-
- System.setProperty("javax.net.ssl.trustStore",
tsFile);
-
System.setProperty("javax.net.ssl.trustStorePassword", tsPassword);
- System.setProperty("javax.net.ssl.trustStoreType",
tsType);
-
- userID = new UserID(username, userpassword);
- clientConfig = new
SASLCAClientConfiguration(saslCAServer,Integer.parseInt(saslCAPort),"RSA",1024,"auth-only");
- client = new SASLCAClient(userID, clientConfig);
-
- KeyPair keyPair = client.generateKeyPair();
- if (oper.equals("get")) {
- checkCertificate(keyPair);
- }
- else if (oper.equals("authn")) {
- sendAuthNEERequest(keyPair,endPoint);
- }
- else if (oper.equals("attr")) {
- sendAttrEERequest(keyPair,endPoint);
- }
-
- } catch (PerfSONARException e) {
- e.printStackTrace();
- } catch (CertificateParsingException e) {
- e.printStackTrace();
- }
- }
-
- public void checkCertificate(KeyPair keyPair) throws
CertificateParsingException, PerfSONARException {
- X509Certificate certificate = client.getCertficate(keyPair);
- System.out.println("Issuer DN:
"+certificate.getIssuerDN().toString());
- System.out.println("Subject DN:
"+certificate.getSubjectDN().toString());
- Collection<List<?>> collection = certificate
- .getSubjectAlternativeNames();
- for (List<?> list : collection) {
- for (Object aList : list) {
- if (aList.toString().startsWith("http")) {
- System.out.println("Subject Alternative Name:" +
aList.toString());
- }
- }
- }
- System.out.println("Valid from:
"+DateFormat.getInstance().format(certificate.getNotBefore()));
- System.out.println("Valid until:
"+DateFormat.getInstance().format(certificate.getNotAfter()));
- }
-
- public void sendAuthNEERequest(KeyPair keyPair,String endPoint)
throws PerfSONARException {
- try {
- PrivateKey privateKey=keyPair.getPrivate();
- X509Certificate cert = client.getCertficate(keyPair);
- AuthNEERequestGenerator rg=new AuthNEERequestGenerator();
- Message m = rg.generateRequestMessage();
- AXIOMCreator cr = new AXIOMCreator();
-
- OMElement requestOMElement = cr.getElement(m);
- SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
- SOAPEnvelope se = soapFactory.createSOAPEnvelope();
- SOAPBody soapBody = soapFactory.createSOAPBody(se);
- soapBody.addChild(requestOMElement);
-
- Document doc =
Axis2Util.getDocumentFromSOAPEnvelope(se, true);
-
- AuthNX509Data
authnData=AuthNDataFactory.getDefaultAuthNX509Data();
- Object reqRaw=authnData.addX509STInMessage(doc, privateKey,
cert);
- SOAPEnvelope envelope = (SOAPEnvelope)reqRaw;
- System.out.println(envelope.toString());
-
- OMElement result = new Axis2Client().send(endPoint,
- envelope.getHeader().getFirstElement(),
requestOMElement);
-
- System.out.println(result.toString());
-
- } catch (Exception e) {
- e.printStackTrace();
- throw new PerfSONARException(e.getMessage());
- }
- }
-
- public void sendAttrEERequest(KeyPair keyPair,String endPoint) throws
PerfSONARException {
- try {
- checkCertificate(keyPair);
-
- PrivateKey privateKey=keyPair.getPrivate();
- X509Certificate cert = client.getCertficate(keyPair);
-
- AttrRequest attrReq = new AttrRequest();
- attrReq.setIssuer("Issuer");
-
attrReq.setSubject("urn:geant:edugain:component:be:gidp:user:first_candido-perfSONAR.net");
- List<String> listValues = new LinkedList<String>();
- listValues.add("perfSONAR.net");
- attrReq.addAttribute("urn:oid:1.3.6.1.4.1.25178.1.2.9",
"schacHomeOrganization", listValues);
-
- AttrEERequestGenerator rg = new AttrEERequestGenerator();
- Message m = rg.generateRequestMessage(attrReq);
- AXIOMCreator cr = new AXIOMCreator();
-
- OMElement requestOMElement = cr.getElement(m);
- SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
- SOAPEnvelope se = soapFactory.createSOAPEnvelope();
- SOAPBody soapBody = soapFactory.createSOAPBody(se);
- soapBody.addChild(requestOMElement);
-
- Document doc =
Axis2Util.getDocumentFromSOAPEnvelope(se, true);
-
- AuthNX509Data
authnData=AuthNDataFactory.getDefaultAuthNX509Data();
- Object reqRaw=authnData.addX509STInMessage(doc, privateKey,
cert);
- SOAPEnvelope envelope = (SOAPEnvelope)reqRaw;
-
- OMElement result = new Axis2Client().send(endPoint,
- envelope.getHeader().getFirstElement(),
requestOMElement);
-
- ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
- result.serialize(baos2);
-
- StaxParser sp = new StaxParser();
- Element respElem = sp.parse(result.getXMLStreamReader());
- ServiceMessage sm = new ServiceMessage(respElem);
-
- Element response = sm.getElement();
-
- AttrResponse
respAttr=AttrResponse.getAttrResponse(response);
- if
(respAttr.getStatus()==AttrResponse.ATTR_OK_RESPONSE) {
- Map<String, List<String>> attrs =
respAttr.getAttributes();
- Set<String> keys = attrs.keySet();
- for (String key : keys) {
- System.out.println("* " + key);
- List<String> values = attrs.get(key);
- for (String value : values) {
- System.out.println("*** " + value);
- }
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw new PerfSONARException(e.getMessage());
- }
- }
-
- public static void main(String[] args) {
- UbCSaslTest ubcSasl = new UbCSaslTest();
- ubcSasl.test(args);
- }
-
-}
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,104 +0,0 @@
-package org.perfsonar.base2.client.authn.saslca;
-
-import java.security.KeyPair;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.X509Certificate;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-
-import org.perfsonar.base2.service.exceptions.PerfSONARException;
-
-import codec.pkcs10.CertificationRequest;
-
-import edu.psu.sasl_ca.ClientProtocolHandler;
-import edu.psu.sasl_ca.util.StringConstants;
-import edu.psu.sasl_ca.util.Util;
-
-public class SASLCAClient {
- private ClientProtocolHandler clientProtocolHandler;
- private UserID userID;
- private UserIDCallbackHandler cbh;
- private SASLCAClientConfiguration clientConfig;
-
- public SASLCAClient(UserID userID, SASLCAClientConfiguration
clientConfig) throws PerfSONARException {
- this.userID=userID;
- this.cbh=new UserIDCallbackHandler(userID);
- this.clientConfig=clientConfig;
- clientConfig.setCbh(cbh);
- try {
- clientProtocolHandler=new
ClientProtocolHandler(clientConfig.getServerName(),clientConfig.getServerPort(),
-
clientConfig.getCallbackHandler(),clientConfig.getSaslProperties());
- } catch (Exception e) {
- String m = "SASLCAClient: Error creating the Client
protocol handler: "+e.getMessage();
- throw new PerfSONARException(m);
- }
- }
-
- public KeyPair generateKeyPair() throws PerfSONARException {
- try {
- KeyPair eduGainKeyPair =
Util.generateKeyPair(clientConfig.getKeyAlgorithm(),
clientConfig.getKeySize());
- return eduGainKeyPair;
- } catch (NoSuchAlgorithmException e) {
- String m = "SASLCAClient: Wrong key algorithm ";
- throw new PerfSONARException(m);
- }
- }
-
- public X509Certificate getCertficate(KeyPair eduGainKeyPair) throws
PerfSONARException {
- CertificationRequest edugainCSR;
- Map<CertificationRequest, X509Certificate[]> certMap;
-
- Subject subj=new Subject();
- subj.getPrincipals().add(userID);
-
- try {
- edugainCSR = ClientProtocolHandler.generateCSR(
- StringConstants.edugainCertIdentifier,
- eduGainKeyPair,
- "SHA1withRSA"
- );
- } catch (Exception e) {
- String m = "SASLCAClient: Error generating the CSR:
"+e.getMessage();
- throw new PerfSONARException(m);
- }
- clientProtocolHandler.addCSR(edugainCSR);
-
- try {
- certMap = Subject
- .doAs(subj, clientProtocolHandler);
- } catch (Exception e) {
- e.printStackTrace();
- String m = "SASLCAClient: Error getting the signed
CSR: "+e.getMessage();
- throw new PerfSONARException(m);
- }
-
- X509Certificate[] certChain = certMap.get(edugainCSR);
- boolean valid = Util.verifyCertChain(certChain);
- if (!valid) {
- String m = "SASLCAClient: Error verifying the signed
CSR. Received certs ("+certChain.length+")";
-/* for (int i=0; i<certChain.length; i++) {
- if (certChain[i]!=null) {
- m+="* Subject
DN("+certChain[i].getSubjectDN().toString()+") Issuer DN
("+certChain[i].getIssuerDN().toString()+") From
("+DateFormat.getInstance().format(certChain[i].getNotBefore())+") Until
("+DateFormat.getInstance().format(certChain[i].getNotAfter())+")\n";
- }
- else {
- m+="* Cert #"+i+" is null\n";
- }
- } */
- throw new PerfSONARException(m);
- }
-
- try {
- for (X509Certificate certificate : certChain) {
- if (certificate.getSubjectDN()!=null) {
- return certificate;
- }
- }
- } catch (Exception e) {
- String m = "SASLCAClient: Error checking the public
key of the certificate: "+e.getMessage();
- throw new PerfSONARException(m);
- }
-
- return null;
- }
-}
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,302 +0,0 @@
-/* LionShare/SASL-CA License
- *
- * The LionShare/SASL-CA License, Version 1. Copyright (c) 2004,
- * The Pennsylvania State University All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
this list
- * of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
this
- * list of conditions and the following disclaimer in the documentation
and/or other
- * materials provided with the distribution, if any, must include the
following
- * acknowledgment:
- *
- * "This product includes software developed by The Pennsylvania State
University
- * <http://lionshare.its.psu.edu/> LionShare Project." Alternatively, this
- * acknowledgement may appear in the software itself, if and wherever such
third-
- * party acknowledgments normally appear.
- *
- * Neither the name of LionShare, SASL-CA nor the names of its contributors,
nor the
- * Pennsylvania State University, may be used to endorse or promote products
derived
- * from this software without specific prior written permission. For written
- * permission, please contact
.
- *
- * Products derived from this software may not be called LionShare, SASL-CA,
PSU, or
- * The Pennsylvania State University, nor may LionShare or SASL-CA appear in
their
- * name, without prior written permission of The Pennsylvania State
University.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND
- * WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, AND
- * NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY
QUALITY,
- * PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER, CONTRIBUTORS OR THE PENNSYLVANIA STATE UNIVERSITY BE
LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-package org.perfsonar.base2.client.authn.saslca;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-
-import edu.psu.sasl_ca.util.StringConstants;
-
-public class SASLCAClientConfiguration {
-/* private LoggerComponent logger;
-
- private ConfigurationComponent config;
-
- private final String SASLCA_SERVER_PARAM = "service.saslca.server";
-
- private final String SASLCA_SERVER_PORT = "service.saslca.port";
-
- private final String SASLCA_KEY_ALG = "service.saslca.keyalg";
-
- private final String SASLCA_KEY_STRENGTH = "server.saslca.keystrengh";
-
- private final String SASLCA_SEC_LAYER = "server.saslca.seclayer";
-*/
- /** hostname of the SASL-CA server */
- private String serverName = null;
-
- /** host port of the SASL-CA server */
- private int serverPort = 4088;
-
- /** JCE algorithm identifier for the CSR key generation algorithm */
- private String keyAlgorithm = "RSA";
-
- /** keysize for the CSR keys */
- private int keySize = 1024;
-
- /** the callback handler */
- private CallbackHandler cbh = null;
-
- /** The SASL security layer properties for each SASL mechanism. */
- private Map<String, String> saslProperties;
-
- /** The list of TLS ciphersuites */
- private String[] cipherSuites = null;
-
- /** The list of TLS protocols */
- private String[] tlsProtocols = null;
-
-/* public SASLCAClientConfiguration() throws PerfSONARException {
- try {
- logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
- .getComponent(ComponentNames.LOGGER);
- } catch (PerfSONARException e) {
- String m = "SASLCAClientConfiguration: Can't obtain
Logger component ";
- throw new PerfSONARException(m);
- }
- try {
- config = (ConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
- } catch (PerfSONARException e) {
-
- String m = "SASLCAClientConfiguration: Can't obtain
Config component ";
- logger.error(m);
- throw new PerfSONARException(m);
- }
- try {
- serverName = config.getProperty(SASLCA_SERVER_PARAM);
- serverPort = Integer.parseInt(config
- .getProperty(SASLCA_SERVER_PORT));
- keyAlgorithm = config.getProperty(SASLCA_KEY_ALG);
- keySize =
Integer.parseInt(config.getProperty(SASLCA_KEY_STRENGTH));
- saslProperties = setupSaslSecurityLayer(config
- .getProperty(SASLCA_SEC_LAYER));
- } catch (Exception e) {
- String m = "AADispatchSOAPProtocol: Can't obtain
required parameters ";
- logger.error(m);
- throw new PerfSONARException(m);
- }
- }
-*/
- public SASLCAClientConfiguration(String serverName, int serverPort,
String keyAlgorithm, int keySize,
- String saslCASecLayer) {
- this.serverName=serverName;
- this.serverPort=serverPort;
- this.keyAlgorithm=keyAlgorithm;
- this.keySize=keySize;
- this.saslProperties = setupSaslSecurityLayer(saslCASecLayer);
- }
-
- /**
- * Parse the SASL-CA properties and setup the SASL security layer
properties.
- *
- * A SASL security layer can be null (SASL only authenticates the
user), or it can optionally
- * provide integrity protection or confidentiality. Futher, it can
require mutual authentication
- * of the client and server.
- *
- * @param securityString A
{@link
String} representation of the security layer properties.
- *
- * @return A
{@link
Map} of SASL security layer properties.
- *
- * @see javax.security.sasl.Sasl#createSaslClient
- */
- public static Map<String, String> setupSaslSecurityLayer(
- final String securityString) {
-
- Map<String, String> securityLayerProps = new HashMap<String,
String>();
-
- if (securityString == null || securityString.trim().length()
== 0) {
- return securityLayerProps;
- }
-
- String temp = securityString.trim();
-
- StringBuilder qopString = new StringBuilder();
-
- for (String component : temp.split(" ")) {
-
- if
(component.equals(StringConstants.secLayerMutualAuth)) {
-
securityLayerProps.put(javax.security.sasl.Sasl.SERVER_AUTH,
- "true");
- } else if
(component.equals(StringConstants.secLayerAuthOnly)) {
-
- if (qopString.length() > 0) {
- qopString.append(",");
- }
-
- qopString.append("auth");
- } else if
(component.equals(StringConstants.secLayerAuthInt)) {
-
- if (qopString.length() > 0) {
- qopString.append(",");
- }
-
- qopString.append("auth-int");
- } else if
(component.equals(StringConstants.secLayerAuthConf)) {
-
- if (qopString.length() > 0) {
- qopString.append(",");
- }
-
- qopString.append("auth-conf");
- }
- }
-
- String s = qopString.toString();
-
- if (!s.equals("")) {
- securityLayerProps.put(javax.security.sasl.Sasl.QOP,
s);
- }
-
- return securityLayerProps;
- }
-
- /**
- * Returns the SASL-CA's server name.
- */
- public String getServerName() {
-
- return serverName;
- }
-
- /**
- * Returns the SASL-CA's server port.
- */
- public int getServerPort() {
-
- return serverPort;
- }
-
- /**
- * Returns the JCE algorithm name for generating keypairs.
- */
- public String getKeyAlgorithm() {
-
- return keyAlgorithm;
- }
-
- /**
- * Returns the keysize for the algorithm in
{@link
#getKeyAlgorithm()}
- */
- public int getKeySize() {
-
- return keySize;
- }
-
- /**
- * Returns the SASL properties for this client.
- */
- public Map<String, String> getSaslProperties() {
-
- return this.saslProperties;
- }
-
- /**
- * Returns the
{@link
CallbackHandler} for this client
- */
- public CallbackHandler getCallbackHandler() {
-
- return this.cbh;
- }
-
- /**
- * Returns the list of SSL/TLS protocols for this client
- */
- public String[] getTLSProtocols() {
-
- return this.tlsProtocols;
- }
-
- /**
- * Returns the list of SSL/TLS ciphersuites for this client
- */
- public String[] getTLSCipherSuites() {
-
- return this.cipherSuites;
- }
-
- public CallbackHandler getCbh() {
- return cbh;
- }
-
- public void setCbh(CallbackHandler cbh) {
- this.cbh = cbh;
- }
-
- public String[] getCipherSuites() {
- return cipherSuites;
- }
-
- public void setCipherSuites(String[] cipherSuites) {
- this.cipherSuites = cipherSuites;
- }
-
- public String[] getTlsProtocols() {
- return tlsProtocols;
- }
-
- public void setTlsProtocols(String[] tlsProtocols) {
- this.tlsProtocols = tlsProtocols;
- }
-
- public void setKeyAlgorithm(String keyAlgorithm) {
- this.keyAlgorithm = keyAlgorithm;
- }
-
- public void setKeySize(int keySize) {
- this.keySize = keySize;
- }
-
- public void setServerName(String serverName) {
- this.serverName = serverName;
- }
-
- public void setServerPort(int serverPort) {
- this.serverPort = serverPort;
- }
-}
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,29 +0,0 @@
-package org.perfsonar.base2.client.authn.saslca;
-
-import java.security.Principal;
-
-public class UserID implements Principal {
- String name;
- String password;
-
- public UserID(String name,String password) {
- this.name=name;
- this.password=password;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name=name;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-}
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,33 +0,0 @@
-package org.perfsonar.base2.client.authn.saslca;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-public class UserIDCallbackHandler implements CallbackHandler {
- UserID userId;
-
- public UserIDCallbackHandler(UserID userId) {
- this.userId=userId;
- }
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (Callback callback : callbacks) {
- if (callback instanceof NameCallback) {
- NameCallback nc = (NameCallback) callback;
- nc.setName(userId.getName());
- } else if (callback instanceof PasswordCallback) {
- PasswordCallback pc = (PasswordCallback) callback;
- pc.setPassword(userId.getPassword().toCharArray());
- } else {
- throw new UnsupportedCallbackException(callback,
"Unrecognized Callback");
- }
- }
- }
-
-}
Deleted:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/RequestHandlerTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/RequestHandlerTest.java
2012-11-27 11:17:20 UTC (rev 6038)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/RequestHandlerTest.java
2012-11-27 14:22:45 UTC (rev 6039)
@@ -1,55 +0,0 @@
-package org.perfsonar.test;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.perfsonar.base2.service.requesthandler.axis2.Axis2RequestHandler;
-
-
-public class RequestHandlerTest {
-
- /**
- * @param args
- * @throws FactoryConfigurationError
- * @throws XMLStreamException
- * @throws FileNotFoundException
- */
- public static void main(String[] args) throws FileNotFoundException,
XMLStreamException, FactoryConfigurationError {
-
- //config LOG
- Logger log = Logger.getLogger("perfsonar");
- log.addAppender(new ConsoleAppender(new SimpleLayout()));
-
- //String req = "EchoRequest";
- //String req = "LSQueryRequest";
- String req = "LSControlRequest-join";
-
- //create the parser
- XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(
-
"/home/mac/projects/perfsonar/simple-service/samples/requests/"+req+".xml"));
-
- //create the builder
- StAXOMBuilder builder = new StAXOMBuilder(parser);
-
- //get the root element (in this case the envelope)
- OMElement documentElement = builder.getDocumentElement();
-
- Axis2RequestHandler rh = new Axis2RequestHandler();
- OMElement resp = rh.message(documentElement);
- System.out.println("\nRESPONSE: \n");
- resp.serialize(System.out);
- System.out.println("\n\n");
-
- }
-
-}
Modified: trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml
===================================================================
--- trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml 2012-11-27 11:17:20
UTC (rev 6038)
+++ trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml 2012-11-27 14:22:45
UTC (rev 6039)
@@ -210,11 +210,6 @@
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</repository>
<repository>
- <id>personar</id>
- <name>personar repository</name>
-
<url>http://svn.geant.net/GEANT/SA2/ps-java-services/trunk/jar-repository</url>
- </repository>
- <repository>
<id>codehaus-release-repo</id>
<name>Codehaus Release Repo</name>
<url>http://repository.codehaus.org</url>
@@ -222,7 +217,7 @@
<repository>
<id>geant-repository</id>
<name>perfSONAR repository</name>
- <url>https://artifactory.geant.net/artifactory/geant-repo/</url>
+ <url>https://artifactory.geant.net/artifactory/repo/</url>
</repository>
<repository>
<id>jboss-repository</id>
@@ -231,6 +226,26 @@
</repository>
</repositories>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.6</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
@@ -240,8 +255,8 @@
<dependency>
<groupId>net.geant.perfsonar</groupId>
- <artifactId>ps-mdm-base2</artifactId>
- <version>1.0.6</version>
+ <artifactId>perfsonar-java-base2</artifactId>
+ <version>1.0.7</version>
</dependency>
<dependency>
<groupId>net.geant.perfsonar</groupId>
@@ -259,16 +274,6 @@
<artifactId>joda-time</artifactId>
<version>1.4</version>
</dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-jaxws</artifactId>
- <version>1.4.1</version>
- </dependency>
<!-- JPA -->
<dependency>
@@ -291,82 +296,6 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
-
- <!-- got for auth -->
- <dependency>
- <groupId>opensaml</groupId>
- <artifactId>opensaml1</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- <version>124</version>
- </dependency>
- <dependency>
- <groupId>xml-security</groupId>
- <artifactId>xmlsec</artifactId>
- <version>1.3.0</version>
- </dependency>
- <dependency>
- <groupId>edugain</groupId>
- <artifactId>edugain</artifactId>
- <version>1.0-RC2</version>
- </dependency>
- <dependency>
- <groupId>perfsonar</groupId>
- <artifactId>perfsonar-authr</artifactId>
- <version>0.5</version>
- </dependency>
- <dependency>
- <groupId>wss4j</groupId>
- <artifactId>wss4j</artifactId>
- <version>1.5.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-core</artifactId>
- <version>1.4</version>
- <exclusions>
- <exclusion>
- <artifactId>opensaml</artifactId>
- <groupId>opensaml</groupId>
- </exclusion>
- <exclusion>
- <artifactId>bcprov-jdk13</artifactId>
- <groupId>bouncycastle</groupId>
- </exclusion>
- <exclusion>
- <artifactId>xmlsec</artifactId>
- <groupId>org.apache.santuario</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.0</version>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xerces-xml-apis</artifactId>
- <version>2.8.0</version>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan-serializer</artifactId>
- <version>2.7.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xacml</groupId>
- <artifactId>sunxacml</artifactId>
- <version>1.2</version>
- </dependency>
</dependencies>
<reporting>
- [pS-dev] [GEANT/SA2/ps-java-services] r6039 - in trunk: perfsonar-java-base2 perfsonar-java-base2/src/main/java/org/perfsonar/base2/client perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca perfsonar-java-base2/src/main/java/org/perfsonar/test perfsonar-java-rrd-ma-SQL_backend, svn-noreply, 11/27/2012
Archive powered by MHonArc 2.6.16.