Repository: cxf-fediz
Updated Branches:
refs/heads/1.2.x-fixes 42f597df3 -> b8e71c845
[FEDIZ-129] - Default values in the schema are not actually used
Conflicts:
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/b8e71c84
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/b8e71c84
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/b8e71c84
Branch: refs/heads/1.2.x-fixes
Commit: b8e71c845299fe48617bd5adadc8093d3beb1eed
Parents: 42f597d
Author: Colm O hEigeartaigh <[email protected]>
Authored: Mon Aug 31 17:15:44 2015 +0100
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Mon Aug 31 17:42:10 2015 +0100
----------------------------------------------------------------------
plugins/core/pom.xml | 34 ++++++++++----------
.../cxf/fediz/core/config/FedizContext.java | 6 ++--
.../src/main/resources/schemas/FedizConfig.xsd | 6 ++--
.../core/config/FedizConfigurationTest.java | 8 +++++
pom.xml | 11 -------
5 files changed, 30 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b8e71c84/plugins/core/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/core/pom.xml b/plugins/core/pom.xml
index faaaf28..0d6f2d3 100644
--- a/plugins/core/pom.xml
+++ b/plugins/core/pom.xml
@@ -30,6 +30,7 @@
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cxf.xjc-utils.version>3.0.5-SNAPSHOT</cxf.xjc-utils.version>
</properties>
<dependencies>
<dependency>
@@ -77,30 +78,29 @@
<build>
<plugins>
<plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1.1</version>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-xjc-plugin</artifactId>
+ <version>${cxf.xjc-utils.version}</version>
<executions>
<execution>
<goals>
- <goal>generate</goal>
+ <goal>xsdtojava</goal>
</goals>
</execution>
</executions>
<configuration>
-
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
-
<generatePackage>org.apache.cxf.fediz.core.config.jaxb</generatePackage>
- <includeSchemas>
- <includeSchema>**/FedizConfig.xsd</includeSchema>
- </includeSchemas>
- <excludeSchemas>
- <excludeSchema>test*.xsd</excludeSchema>
- </excludeSchemas>
- <includeBindings>
- <includeBinding>*.xjb</includeBinding>
- </includeBindings>
- <strict>true</strict>
- <verbose>true</verbose>
+ <xsdOptions>
+ <xsdOption>
+
<xsd>${basedir}/src/main/resources/schemas/FedizConfig.xsd</xsd>
+
<packagename>org.apache.cxf.fediz.core.config.jaxb</packagename>
+ <extensionArgs>
+ <arg>-Xdv</arg>
+ </extensionArgs>
+ </xsdOption>
+ </xsdOptions>
+ <extensions>
+
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:${cxf.xjc-utils.version}</extension>
+ </extensions>
</configuration>
</plugin>
<plugin>
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b8e71c84/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
----------------------------------------------------------------------
diff --git
a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
index f537dcb..e05d8bf 100644
---
a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
+++
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
@@ -178,9 +178,8 @@ public class FedizContext implements Closeable {
}
keyManager = new KeyManager(config.getSigningKey());
Properties sigProperties =
createCryptoProperties(config.getSigningKey());
- Crypto crypto;
try {
- crypto = CryptoFactory.getInstance(sigProperties);
+ Crypto crypto = CryptoFactory.getInstance(sigProperties);
keyManager.setCrypto(crypto);
} catch (WSSecurityException e) {
String name = keyManager.getName();
@@ -202,9 +201,8 @@ public class FedizContext implements Closeable {
}
decryptionKeyManager = new KeyManager(config.getTokenDecryptionKey());
Properties decProperties =
createCryptoProperties(config.getTokenDecryptionKey());
- Crypto crypto;
try {
- crypto = CryptoFactory.getInstance(decProperties);
+ Crypto crypto = CryptoFactory.getInstance(decProperties);
decryptionKeyManager.setCrypto(crypto);
} catch (WSSecurityException e) {
String name = decryptionKeyManager.getName();
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b8e71c84/plugins/core/src/main/resources/schemas/FedizConfig.xsd
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/resources/schemas/FedizConfig.xsd
b/plugins/core/src/main/resources/schemas/FedizConfig.xsd
index 5364dcb..19922c6 100644
--- a/plugins/core/src/main/resources/schemas/FedizConfig.xsd
+++ b/plugins/core/src/main/resources/schemas/FedizConfig.xsd
@@ -16,7 +16,7 @@
<xs:element ref="audienceUris" />
<xs:element ref="certificateValidation" />
<xs:element ref="certificateStores" />
- <xs:element ref="tokenExpirationValidation" />
+ <xs:element ref="tokenExpirationValidation" minOccurs="0" />
<xs:element ref="maximumClockSkew" />
<xs:element ref="tokenReplayCache" />
<xs:element ref="serviceCertificate" />
@@ -85,9 +85,9 @@
<xs:element name="maximumClockSkew" type="xs:integer" default="5" />
- <xs:element name="tokenExpirationValidation" type="xs:boolean"
default="true">
+ <xs:element name="tokenExpirationValidation" type="xs:boolean"
default="true" >
<xs:annotation>
- <xs:documentation>Decision weather the token validation (e.g.
lifetime) shall be
+ <xs:documentation>Decision whether the token validation (e.g.
lifetime) shall be
performed on every request
(true) or only once at initial authentication (false).
</xs:documentation>
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b8e71c84/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
----------------------------------------------------------------------
diff --git
a/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
index 8c379d6..dd3780d 100644
---
a/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
+++
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
@@ -401,5 +401,13 @@ public class FedizConfigurationTest {
return fedContext.getTokenReplayCache();
}
+
+ @org.junit.Test
+ public void testDefaultValues() throws JAXBException, IOException {
+ ContextConfig config = new ContextConfig();
+
+ Assert.assertTrue(config.getMaximumClockSkew().intValue() == 5);
+ Assert.assertTrue(config.isTokenExpirationValidation());
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b8e71c84/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b0a01c2..583eb7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,14 +86,6 @@
<!-- OSGi related properties -->
- <!-- please maintain alphabetical order here -->
- <fediz.jaxb21.version>2.1</fediz.jaxb21.version>
- <fediz.jaxb21.impl.version>2.1.13</fediz.jaxb21.impl.version>
- <fediz.jaxb21.xjc.version>2.1.13</fediz.jaxb21.xjc.version>
- <fediz.jaxb22.version>2.2.6</fediz.jaxb22.version>
- <fediz.jaxb22.impl.version>2.2.5</fediz.jaxb22.impl.version>
- <fediz.jaxb22.xjc.version>2.2.5</fediz.jaxb22.xjc.version>
-
<fediz.checkstyle.extension />
<fediz.downloadSources>true</fediz.downloadSources>
@@ -765,9 +757,6 @@
<jdk>1.7</jdk>
</activation>
<properties>
-
<fediz.jaxb.version>${fediz.jaxb22.version}</fediz.jaxb.version>
-
<fediz.jaxb.impl.version>${fediz.jaxb22.impl.version}</fediz.jaxb.impl.version>
-
<fediz.jaxb.xjc.version>${fediz.jaxb22.impl.version}</fediz.jaxb.xjc.version>
<jdk.version>1.6</jdk.version>
</properties>
<build>