Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41772DC37 for ; Sat, 18 May 2013 16:05:19 +0000 (UTC) Received: (qmail 52060 invoked by uid 500); 18 May 2013 16:05:19 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 52013 invoked by uid 500); 18 May 2013 16:05:19 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 52006 invoked by uid 99); 18 May 2013 16:05:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 16:05:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 16:05:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 94816238890D; Sat, 18 May 2013 16:04:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1484133 [2/6] - in /cxf/trunk/services: ./ xkms/ xkms/xkms-client/ xkms/xkms-client/src/ xkms/xkms-client/src/main/ xkms/xkms-client/src/main/java/ xkms/xkms-client/src/main/java/org/ xkms/xkms-client/src/main/java/org/apache/ xkms/xkms-cl... Date: Sat, 18 May 2013 16:04:40 -0000 To: commits@cxf.apache.org From: ashakirin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130518160444.94816238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: cxf/trunk/services/xkms/xkms-common/src/main/model/binding.xjb URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/model/binding.xjb?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-common/src/main/model/binding.xjb (added) +++ cxf/trunk/services/xkms/xkms-common/src/main/model/binding.xjb Sat May 18 16:04:37 2013 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-common/src/main/model/xenc-schema.xsd URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/model/xenc-schema.xsd?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-common/src/main/model/xenc-schema.xsd (added) +++ cxf/trunk/services/xkms/xkms-common/src/main/model/xenc-schema.xsd Sat May 18 16:04:37 2013 @@ -0,0 +1,183 @@ + + + + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.wsdl?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.wsdl (added) +++ cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.wsdl Sat May 18 16:04:37 2013 @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.xsd URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.xsd?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.xsd (added) +++ cxf/trunk/services/xkms/xkms-common/src/main/model/xkms.xsd Sat May 18 16:04:37 2013 @@ -0,0 +1,439 @@ + + + +]> + + + + + + XML Schema for XKMS 2.0 Recommendation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-common/src/main/model/xmldsig-core-schema.xsd URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/model/xmldsig-core-schema.xsd?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-common/src/main/model/xmldsig-core-schema.xsd (added) +++ cxf/trunk/services/xkms/xkms-common/src/main/model/xmldsig-core-schema.xsd Sat May 18 16:04:37 2013 @@ -0,0 +1,318 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-features/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-features/pom.xml?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-features/pom.xml (added) +++ cxf/trunk/services/xkms/xkms-features/pom.xml Sat May 18 16:04:37 2013 @@ -0,0 +1,78 @@ + + + + + 4.0.0 + org.apache.cxf.services.xkms + cxf-services-xkms-features + pom + Apache CXF XKMS Karaf Features + http://cxf.apache.org + + + org.apache.cxf + cxf-parent + 2.8.0-SNAPSHOT + ../../../parent/pom.xml + + + + + + ${project.basedir}/src/main/resources + true + + **/features.xml + **/*.cfg + **/*.properties + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter + generate-resources + + resources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + target/classes/features.xml + xml + + + target/classes/org.apache.cxf.xkms.cfg + org.apache.cxf.xkms + cfg + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-features/src/main/resources/features.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-features/src/main/resources/features.xml?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-features/src/main/resources/features.xml (added) +++ cxf/trunk/services/xkms/xkms-features/src/main/resources/features.xml Sat May 18 16:04:37 2013 @@ -0,0 +1,42 @@ + + + + + + cxf + spring-dm + mvn:${project.groupId}/cxf-services-xkms-common/${project.version} + mvn:${project.groupId}/cxf-services-xkms-client/${project.version} + + + + cxf + spring-dm + mvn:${project.groupId}/cxf-services-xkms-common/${project.version} + mvn:${project.groupId}/cxf-services-xkms-service/${project.version} + mvn:${project.groupId}/cxf-services-xkms-x509-handlers/${project.version} + mvn:${project.groupId}/cxf-services-xkms-osgi/${project.version} + + mvn:${project.groupId}/cxf-services-xkms-features/${project.version}/cfg/org.apache.cxf.xkms + + + + Added: cxf/trunk/services/xkms/xkms-features/src/main/resources/org.apache.cxf.xkms.cfg URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-features/src/main/resources/org.apache.cxf.xkms.cfg?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-features/src/main/resources/org.apache.cxf.xkms.cfg (added) +++ cxf/trunk/services/xkms/xkms-features/src/main/resources/org.apache.cxf.xkms.cfg Sat May 18 16:04:37 2013 @@ -0,0 +1,30 @@ +################################################################################# +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# XKMS configuration properties + +# 1. Filesystem backend +#xkms.backend.file.storageDir=data/xkms/keys + +# 2. LDAP backend +xkms.backend.ldap.url=ldap://localhost:2389 +xkms.backend.ldap.user=cn=Directory Manager +xkms.backend.ldap.pwd=test +xkms.backend.ldap.retry=2 +xkms.backend.ldap.rootDN=dc=example,dc=com \ No newline at end of file Added: cxf/trunk/services/xkms/xkms-itests/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-itests/pom.xml?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-itests/pom.xml (added) +++ cxf/trunk/services/xkms/xkms-itests/pom.xml Sat May 18 16:04:37 2013 @@ -0,0 +1,197 @@ + + + + + 4.0.0 + org.apache.cxf.services.xkms + cxf-services-xkms-itests + Apache CXF XKMS Integration Tests + http://cxf.apache.org + + + org.apache.cxf + cxf-parent + 2.8.0-SNAPSHOT + ../../../parent/pom.xml + + + + 2.6.0 + + + + + org.apache.cxf.services.xkms + cxf-services-xkms-common + ${project.version} + + + org.apache.cxf.services.xkms + cxf-services-xkms-x509-handlers + ${project.version} + + + org.apache.cxf.services.xkms + cxf-services-xkms-service + ${project.version} + + + org.apache.cxf.services.xkms + cxf-services-xkms-ldap-persistence + ${project.version} + + + org.apache.cxf.services.xkms + cxf-services-xkms-file-persistence + ${project.version} + + + + org.apache.karaf + apache-karaf + 2.2.9 + test + tar.gz + + + org.apache.karaf + org.apache.karaf.client + + + + + + org.apache.karaf.tooling.exam + org.apache.karaf.tooling.exam.container + 2.3.0 + test + + + + org.ops4j.pax.exam + pax-exam-junit4 + ${exam.version} + + + org.ops4j.pax.exam + pax-exam-inject + ${exam.version} + + + org.ops4j.pax.exam + pax-exam-link-mvn + ${exam.version} + test + + + + org.ops4j.pax.url + pax-url-aether + 1.5.0 + test + + + + org.apache.felix + org.apache.felix.framework + 3.2.2 + test + + + org.ops4j.pax.swissbox + pax-swissbox-tinybundles + 1.3.1 + + + junit + junit + test + + + org.slf4j + slf4j-log4j12 + 1.6.1 + + + + org.apache.cxf.services.xkms + cxf-services-xkms-features + ${project.version} + xml + + + + + + + org.ops4j.pax.exam + maven-paxexam-plugin + 1.2.4 + + + generate-config + + generate-config + generate-depends-file + + + + + + equinox + log + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.ops4j.pax.exam + + + maven-paxexam-plugin + + + [1.2.4,) + + + + generate-depends-file + + generate-config + + + + + + + + + + + + + + Added: cxf/trunk/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/XkmsServiceTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/XkmsServiceTest.java?rev=1484133&view=auto ============================================================================== --- cxf/trunk/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/XkmsServiceTest.java (added) +++ cxf/trunk/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/XkmsServiceTest.java Sat May 18 16:04:37 2013 @@ -0,0 +1,127 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.xkms.itests; + +import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.editConfigurationFilePut; +import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.karafDistributionConfiguration; +import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.logLevel; +import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.scanFeatures; + +import java.io.File; +import java.net.URISyntaxException; +import java.util.UUID; + +import javax.inject.Inject; + +import junit.framework.Assert; + +import org.apache.cxf.xkms.model.xkms.PrototypeKeyBindingType; +import org.apache.cxf.xkms.model.xkms.RegisterRequestType; +import org.apache.cxf.xkms.model.xkms.RegisterResultType; +import org.apache.cxf.xkms.model.xkms.ResultMajorEnum; +import org.apache.cxf.xkms.model.xkms.ResultMinorEnum; +import org.apache.cxf.xkms.model.xmldsig.KeyInfoType; +import org.apache.karaf.tooling.exam.options.LogLevelOption; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.CoreOptions; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.Configuration; +import org.ops4j.pax.exam.junit.ExamReactorStrategy; +import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.exam.options.MavenArtifactUrlReference; +import org.ops4j.pax.exam.options.MavenUrlReference; +import org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactorFactory; +import org.osgi.framework.BundleContext; +import org.w3._2002._03.xkms_wsdl.XKMSPortType; + +@RunWith(JUnit4TestRunner.class) +@ExamReactorStrategy(EagerSingleStagedReactorFactory.class) +public class XkmsServiceTest { + private static final String HTTP_PORT = "9191"; + + private static final String XKMS_ENDPOINT = "http://localhost:" + HTTP_PORT + "/cxf/XKMS"; + + @Inject + BundleContext bundleContext; + + @Inject + XKMSPortType xkmsService; + + @Configuration + public Option[] config() { + MavenArtifactUrlReference karafUrl = maven() + .groupId("org.apache.karaf").artifactId("apache-karaf") + .version("2.3.0").type("tar.gz"); + MavenUrlReference cxfFeatures = maven().groupId("org.apache.cxf.karaf") + .artifactId("apache-cxf").type("xml").classifier("features") + .version("2.7.0"); + MavenUrlReference xkmsFeatures = maven() + .groupId("org.apache.cxf.services.xkms") + .artifactId("cxf-services-xkms-features").type("xml") + .version("2.7.1-SNAPSHOT"); + + return new Option[] { + karafDistributionConfiguration().frameworkUrl(karafUrl) + .karafVersion("2.3.0").name("Apache Karaf") + .unpackDirectory(new File("target/exam")), + logLevel(LogLevelOption.LogLevel.INFO), + CoreOptions. + scanFeatures(cxfFeatures, "cxf"), + scanFeatures(xkmsFeatures, "cxf-xkms-service", "cxf-xkms-client").start(), + editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", + "org.osgi.service.http.port", HTTP_PORT), + editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg", + "xkms.endpoint", XKMS_ENDPOINT), + + editConfigurationFilePut("etc/org.apache.cxf.xkms.cfg", + "xkms.filepersistence.storageDir", "data/xkms/keys"), + + + // vmOption( + // "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" ) + }; + } + + @Test + public void testEmptyRegister() throws URISyntaxException, Exception { + RegisterRequestType request = new RegisterRequestType(); + request.setId(UUID.randomUUID().toString()); + RegisterResultType result = xkmsService.register(request); + Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(), result.getResultMajor()); + Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_FAILURE.value(), result.getResultMinor()); + } + + @Test + public void testRegisterWithoutKey() throws URISyntaxException, Exception { + RegisterRequestType request = new RegisterRequestType(); + PrototypeKeyBindingType binding = new PrototypeKeyBindingType(); + KeyInfoType keyInfo = new KeyInfoType(); + binding.setKeyInfo(keyInfo); + request.setPrototypeKeyBinding(binding ); + request.setId(UUID.randomUUID().toString()); + RegisterResultType result = xkmsService.register(request); + Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(), result.getResultMajor()); + Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_FAILURE.value(), result.getResultMinor()); + } + + +}