cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1571407 - in /cxf/fediz/trunk/services/idp/src: main/filters/realm-a/ main/filters/realm-b/ main/resources/ main/webapp/WEB-INF/ test/java/org/apache/cxf/fediz/service/idp/service/jpa/ test/resources/
Date Mon, 24 Feb 2014 19:38:50 GMT
Author: owulff
Date: Mon Feb 24 19:38:49 2014
New Revision: 1571407

URL: http://svn.apache.org/r1571407
Log:
[FEDIZ-78] Provide a configurable mechanism to load the DB initially

Added:
    cxf/fediz/trunk/services/idp/src/main/resources/entities-realmb.xml
      - copied, changed from r1571105, cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml
Modified:
    cxf/fediz/trunk/services/idp/src/main/filters/realm-a/env.properties
    cxf/fediz/trunk/services/idp/src/main/filters/realm-b/env.properties
    cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml
    cxf/fediz/trunk/services/idp/src/main/resources/persistenceContext.xml
    cxf/fediz/trunk/services/idp/src/main/resources/realm.properties
    cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/federation-signin-request.xml
    cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
    cxf/fediz/trunk/services/idp/src/test/resources/realm.properties
    cxf/fediz/trunk/services/idp/src/test/resources/testContext.xml

Modified: cxf/fediz/trunk/services/idp/src/main/filters/realm-a/env.properties
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/filters/realm-a/env.properties?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/filters/realm-a/env.properties (original)
+++ cxf/fediz/trunk/services/idp/src/main/filters/realm-a/env.properties Mon Feb 24 19:38:49
2014
@@ -2,4 +2,5 @@ realm.STS_URI=REALMA
 realmA.port=9443
 realmB.port=12443
 idp-config=idp-config-realma.xml
+db-load-config=entities-realma.xml
 realm-uri=urn:org:apache:cxf:fediz:idp:realm-A
\ No newline at end of file

Modified: cxf/fediz/trunk/services/idp/src/main/filters/realm-b/env.properties
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/filters/realm-b/env.properties?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/filters/realm-b/env.properties (original)
+++ cxf/fediz/trunk/services/idp/src/main/filters/realm-b/env.properties Mon Feb 24 19:38:49
2014
@@ -2,4 +2,5 @@ realm.STS_URI=REALMB
 realmA.port=9443
 realmB.port=12443
 idp-config=idp-config-realmb.xml
+db-load-config=entities-realmb.xml
 realm-uri=urn:org:apache:cxf:fediz:idp:realm-B
\ No newline at end of file

Modified: cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml Mon Feb 24 19:38:49
2014
@@ -81,7 +81,7 @@
         <property name="realm" value="urn:org:apache:cxf:fediz:idp:realm-B" />
         <property name="cacheTokens" value="true" />
         <property name="url" value="https://localhost:12443/fediz-idp-remote/federation"
/>
-        <property name="certificate" value="trusted cert" />
+        <property name="certificate" value="realmb.cert" />
         <property name="trustType" value="PEER_TRUST" />
         <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706"
/>
         <property name="federationType" value="FederateIdentity" />

Copied: cxf/fediz/trunk/services/idp/src/main/resources/entities-realmb.xml (from r1571105,
cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml)
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/resources/entities-realmb.xml?p2=cxf/fediz/trunk/services/idp/src/main/resources/entities-realmb.xml&p1=cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml&r1=1571105&r2=1571407&rev=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/resources/entities-realma.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/resources/entities-realmb.xml Mon Feb 24 19:38:49
2014
@@ -26,15 +26,15 @@
         http://www.springframework.org/schema/util
         http://www.springframework.org/schema/util/spring-util-2.0.xsd">
 
-    <bean id="idp-realmA" class="org.apache.cxf.fediz.service.idp.service.jpa.IdpEntity">
-        <property name="realm" value="urn:org:apache:cxf:fediz:idp:realm-A" />
-        <property name="uri" value="realma" />
+    <bean id="idp-realmB" class="org.apache.cxf.fediz.service.idp.service.jpa.IdpEntity">
+        <property name="realm" value="urn:org:apache:cxf:fediz:idp:realm-B" />
+        <property name="uri" value="realmb" />
         <property name="provideIdpList" value="true" />
         <property name="useCurrentIdp" value="true" />
-        <property name="certificate" value="stsKeystoreA.properties" />
-        <property name="certificatePassword" value="realma" />
-        <property name="stsUrl" value="https://localhost:9443/fediz-idp-sts/REALMA" />
-        <property name="idpUrl" value="https://localhost:9443/fediz-idp/federation" />
+        <property name="certificate" value="stsKeystoreB.properties" />
+        <property name="certificatePassword" value="realmb" />
+        <property name="stsUrl" value="https://localhost:12443/fediz-idp-sts/REALMB" />
+        <property name="idpUrl" value="https://localhost:12443/fediz-idp/federation" />
         <property name="supportedProtocols">
             <util:list>
                 <value>http://docs.oasis-open.org/wsfed/federation/200706
@@ -54,16 +54,11 @@
                 <entry key="default" value="/login/default" />
             </util:map>
         </property>
-        <property name="serviceDisplayName" value="REALM A" />
-        <property name="serviceDescription" value="IDP of Realm A" />
+        <property name="serviceDisplayName" value="REALM B" />
+        <property name="serviceDescription" value="IDP of Realm B" />
         <property name="applications">
             <util:list>
-                <ref bean="srv-fedizhelloworld" />
-            </util:list>
-        </property>
-        <property name="trustedIdps">
-            <util:list>
-                <ref bean="trusted-idp-realmB" />
+                <ref bean="idp-realmA" />
             </util:list>
         </property>
         <property name="claimTypesOffered">
@@ -76,50 +71,16 @@
         </property>
     </bean>
 
-    <bean id="trusted-idp-realmB"
-        class="org.apache.cxf.fediz.service.idp.service.jpa.TrustedIdpEntity">
-        <property name="realm" value="urn:org:apache:cxf:fediz:idp:realm-B" />
-        <property name="cacheTokens" value="true" />
-        <property name="url" value="https://localhost:12443/fediz-idp-remote/federation"
/>
-        <property name="certificate" value="trusted cert" />
-        <property name="trustType" value="PEER_TRUST" />
-        <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706"
/>
-        <property name="federationType" value="FederateIdentity" />
-        <property name="name" value="Realm B" />
-        <property name="description" value="Realm B description" />
-    </bean>
-
-    <bean id="srv-fedizhelloworld" class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationEntity">
-        <property name="realm" value="urn:org:apache:cxf:fediz:fedizhelloworld" />
+    <bean id="idp-realmA" class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationEntity">
+        <property name="realm" value="urn:org:apache:cxf:fediz:idp:realm-A" />
         <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706"
/>
-        <property name="serviceDisplayName" value="Fedizhelloworld" />
-        <property name="serviceDescription" value="Web Application to illustrate WS-Federation"
/>
-        <property name="role" value="ApplicationServiceType" />
+        <property name="serviceDisplayName" value="Resource IDP Realm A" />
+        <property name="serviceDescription" value="Resource IDP Realm A" />
+        <property name="role" value="SecurityTokenServiceType" />
         <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"
/>
         <property name="lifeTime" value="3600" />
     </bean>
     
-    <bean class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationClaimEntity">
-        <property name="application" ref="srv-fedizhelloworld" />
-        <property name="claim" ref="claim_role" />
-        <property name="optional" value="false" />
-    </bean>
-    <bean class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationClaimEntity">
-        <property name="application" ref="srv-fedizhelloworld" />
-        <property name="claim" ref="claim_givenname" />
-        <property name="optional" value="false" />
-    </bean>
-    <bean class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationClaimEntity">
-        <property name="application" ref="srv-fedizhelloworld" />
-        <property name="claim" ref="claim_surname" />
-        <property name="optional" value="false" />
-    </bean>
-    <bean class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationClaimEntity">
-        <property name="application" ref="srv-fedizhelloworld" />
-        <property name="claim" ref="claim_email" />
-        <property name="optional" value="false" />
-    </bean>
-    
     <bean id="claim_role"
         class="org.apache.cxf.fediz.service.idp.service.jpa.ClaimEntity">
         <property name="claimType"

Modified: cxf/fediz/trunk/services/idp/src/main/resources/persistenceContext.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/resources/persistenceContext.xml?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/resources/persistenceContext.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/resources/persistenceContext.xml Mon Feb 24 19:38:49
2014
@@ -31,7 +31,7 @@
     http://www.springframework.org/schema/jdbc
     http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"
        default-autowire="byName">
-
+    
     <context:component-scan base-package="org.apache.cxf.fediz.service.idp.service" />
     <context:component-scan base-package="org.apache.cxf.fediz.service.idp.rest" />
 
@@ -91,7 +91,7 @@
 
     <bean id="dbLoader"
         class="org.apache.cxf.fediz.service.idp.service.jpa.DBLoaderSpring">
-        <property name="resource" value="entities-realma.xml" />
+        <property name="resource" value="${db-load-config}" />
     </bean>
 
     <bean id="dbListener"

Modified: cxf/fediz/trunk/services/idp/src/main/resources/realm.properties
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/resources/realm.properties?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/resources/realm.properties (original)
+++ cxf/fediz/trunk/services/idp/src/main/resources/realm.properties Mon Feb 24 19:38:49 2014
@@ -1,3 +1,4 @@
 realm.STS_URI=${realm.STS_URI}
 realmA.port=${realmA.port}
 realmB.port=${realmB.port}
+db-load-config=${db-load-config}

Modified: cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/federation-signin-request.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/federation-signin-request.xml?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/federation-signin-request.xml (original)
+++ cxf/fediz/trunk/services/idp/src/main/webapp/WEB-INF/federation-signin-request.xml Mon
Feb 24 19:38:49 2014
@@ -68,12 +68,12 @@
         <if
             test="flowScope.idpConfig.trustedIdps == null or idpConfig.trustedIdps.isEmpty()"
             then="checkDefaultToThisIDP" />
-        <if test="flowScope.idpConfig.isProvideIDPList() == false"
+        <if test="flowScope.idpConfig.isProvideIdpList() == false"
             then="checkDefaultToThisIDP" else="showIDPList" />
     </decision-state>
 
     <decision-state id="checkDefaultToThisIDP">
-        <if test="flowScope.idpConfig.isUseCurrentIDP()" then="checkWauthTypeSupported"
+        <if test="flowScope.idpConfig.isUseCurrentIdp()" then="checkWauthTypeSupported"
             else="viewBadRequest" />
     </decision-state>
 

Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
(original)
+++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPATest.java
Mon Feb 24 19:38:49 2014
@@ -58,7 +58,7 @@ public class TrustedIdpDAOJPATest {
     @Test
     public void testReadExistingTrustedIdp() {
         TrustedIdp trustedIdp = trustedIdpDAO.getTrustedIDP("urn:org:apache:cxf:fediz:idp:realm-B");
-        Assert.isTrue("trusted cert".equals(trustedIdp.getCertificate()),
+        Assert.isTrue("realmb.cert".equals(trustedIdp.getCertificate()),
                       "Certificate name doesn't match");
         Assert.isTrue("Realm B description".equals(trustedIdp.getDescription()),
                       "Description name doesn't match");
@@ -92,7 +92,7 @@ public class TrustedIdpDAOJPATest {
         
         trustedIdp = trustedIdpDAO.getTrustedIDP(realm);
         
-        Assert.isTrue("trusted cert".equals(trustedIdp.getCertificate()),
+        Assert.isTrue("realmb.cert".equals(trustedIdp.getCertificate()),
                       "Certificate name doesn't match");
         Assert.isTrue("Realm B description".equals(trustedIdp.getDescription()),
                       "Description name doesn't match");
@@ -188,7 +188,7 @@ public class TrustedIdpDAOJPATest {
         TrustedIdp trustedIdp = new TrustedIdp();
         trustedIdp.setRealm(realm);
         trustedIdp.setCacheTokens(false);
-        trustedIdp.setCertificate("trusted cert");
+        trustedIdp.setCertificate("realmb.cert");
         trustedIdp.setDescription("Realm B description");
         trustedIdp.setFederationType("FederateIdentity");
         trustedIdp.setName("Realm B");

Modified: cxf/fediz/trunk/services/idp/src/test/resources/realm.properties
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/resources/realm.properties?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/resources/realm.properties (original)
+++ cxf/fediz/trunk/services/idp/src/test/resources/realm.properties Mon Feb 24 19:38:49 2014
@@ -1,3 +1,4 @@
 realm.STS_URI=REALMA
 realmA.port=8443
 realmB.port=12443
+db-load-config=entities-realma.xml

Modified: cxf/fediz/trunk/services/idp/src/test/resources/testContext.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/resources/testContext.xml?rev=1571407&r1=1571406&r2=1571407&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/test/resources/testContext.xml (original)
+++ cxf/fediz/trunk/services/idp/src/test/resources/testContext.xml Mon Feb 24 19:38:49 2014
@@ -39,6 +39,7 @@
         <property name="locations">
             <list>
                 <value>classpath:persistence.properties</value>
+                <value>classpath:realm.properties</value>
             </list>
         </property>
         <property name="ignoreResourceNotFound" value="true" />



Mime
View raw message