cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Removing RealmParser from fediz-sts.xml
Date Wed, 12 Oct 2016 17:23:28 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master af2ac3667 -> c4ca0c083


Removing RealmParser from fediz-sts.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/c4ca0c08
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/c4ca0c08
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/c4ca0c08

Branch: refs/heads/master
Commit: c4ca0c083e251ff64f65a6b03f1aa63a0d8b4fe4
Parents: af2ac36
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Oct 12 18:23:13 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Oct 12 18:23:13 2016 +0100

----------------------------------------------------------------------
 .../fediz/service/sts/realms/UriRealmParser.java    | 16 +++++++++++++++-
 .../sts/src/main/webapp/WEB-INF/cxf-transport.xml   | 12 ++++++++++++
 services/sts/src/main/webapp/WEB-INF/fediz-sts.xml  | 10 ----------
 .../src/test/resources/sts/cxf-transport.xml        |  1 +
 4 files changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c4ca0c08/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
index 169cc54..2fca3a3 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
@@ -31,6 +31,8 @@ public class UriRealmParser implements RealmParser {
 
     private static final Logger LOG = LoggerFactory.getLogger(UriRealmParser.class);
 
+    private Map<String, Object> realmMap;
+
     @Override
     public String parseRealm(Map<String, Object> messageContext) throws STSException
{
         String url = (String)messageContext.get("org.apache.cxf.request.url");
@@ -49,9 +51,21 @@ public class UriRealmParser implements RealmParser {
             realm = st.nextToken();
         }
         realm = realm.toUpperCase();
+        if (realmMap == null || !realmMap.containsKey(realm)) {
+            LOG.warn("Unknown realm: " + realm);
+            throw new STSException("Unknown realm: " + realm);
+        }
         
         LOG.debug("URI realm parsed: " + realm);
         return realm;
     }
 
-}
+    public Map<String, Object> getRealmMap() {
+        return realmMap;
+    }
+
+    public void setRealmMap(Map<String, Object> realms) {
+        this.realmMap = realms;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c4ca0c08/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
----------------------------------------------------------------------
diff --git a/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml b/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
index a51a582..c06fed8 100644
--- a/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
+++ b/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
@@ -52,6 +52,18 @@
         <property name="location" value="classpath:./sts.properties"/>
     </bean>
     
+    <bean id="customRealmParser" class="org.apache.cxf.fediz.service.sts.realms.UriRealmParser"
>
+        <property name="realmMap" ref="realms" />
+    </bean>
+    
+    <bean id="transportSTSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
+        <property name="callbackHandlerClass" value="${callback.handler}" />
+        <property name="issuer" value="${issuer}" />
+        <property name="realmParser" ref="customRealmParser" />
+        <property name="signatureCryptoProperties" value="${signature.properties}" />
+        <property name="relationships" ref="relationships" />
+    </bean>
+    
     <jaxws:endpoint id="transportSTSRealmA" implementor="#transportSTSProviderBean"
         address="/REALMA/STSServiceTransport" wsdlLocation="/WEB-INF/wsdl/ws-trust-1.4-service.wsdl"
         xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c4ca0c08/services/sts/src/main/webapp/WEB-INF/fediz-sts.xml
----------------------------------------------------------------------
diff --git a/services/sts/src/main/webapp/WEB-INF/fediz-sts.xml b/services/sts/src/main/webapp/WEB-INF/fediz-sts.xml
index 21919c7..3e3ae36 100644
--- a/services/sts/src/main/webapp/WEB-INF/fediz-sts.xml
+++ b/services/sts/src/main/webapp/WEB-INF/fediz-sts.xml
@@ -109,8 +109,6 @@
     <bean id="samlRealmCodec"
         class="org.apache.cxf.fediz.service.sts.realms.SamlRealmCodec" />
 
-    <bean id="customRealmParser" class="org.apache.cxf.fediz.service.sts.realms.UriRealmParser"
/>
-
     <bean id="transportSamlTokenValidator"
         class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
         <property name="samlRealmCodec" ref="samlRealmCodec" />
@@ -128,13 +126,5 @@
         </property>
     </bean>
     
-    <bean id="transportSTSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
-        <property name="callbackHandlerClass" value="${callback.handler}" />
-        <property name="issuer" value="${issuer}" />
-        <property name="realmParser" ref="customRealmParser" />
-        <property name="signatureCryptoProperties" value="${signature.properties}" />
-        <property name="relationships" ref="relationships" />
-    </bean>
-
 </beans>
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c4ca0c08/systests/kerberos/src/test/resources/sts/cxf-transport.xml
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/sts/cxf-transport.xml b/systests/kerberos/src/test/resources/sts/cxf-transport.xml
index 6506b04..be3fe02 100644
--- a/systests/kerberos/src/test/resources/sts/cxf-transport.xml
+++ b/systests/kerberos/src/test/resources/sts/cxf-transport.xml
@@ -160,6 +160,7 @@
         class="org.apache.cxf.fediz.service.sts.realms.SamlRealmCodec" />
 
     <bean id="customRealmParser" class="org.apache.cxf.fediz.service.sts.realms.UriRealmParser">
+        <property name="realmMap" ref="realms" />
     </bean>
 
     <bean id="transportSamlTokenValidator"


Mime
View raw message