Repository: cxf Updated Branches: refs/heads/3.1.x-fixes f00d7da9a -> fd958fdbc
Splitting realm configuration into a separate file Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/736e7d46 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/736e7d46 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/736e7d46 Branch: refs/heads/3.1.x-fixes Commit: 736e7d464e3a6261ecfc041709924b7effc00cce Parents: f00d7da Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Aug 3 15:16:02 2016 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Aug 3 18:05:03 2016 +0100 ---------------------------------------------------------------------- .../cxf/sts/token/realm/RealmProperties.java | 17 ++++++++++ .../systest/sts/deployment/cxf-transport.xml | 13 ++------ .../cxf/systest/sts/deployment/realms.xml | 33 ++++++++++++++++++++ .../sts/deployment/stax-cxf-transport.xml | 13 ++------ 4 files changed, 56 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/736e7d46/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/RealmProperties.java ---------------------------------------------------------------------- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/RealmProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/RealmProperties.java index dfe65c6..8909248 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/RealmProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/RealmProperties.java @@ -41,6 +41,7 @@ public class RealmProperties { private static final Logger LOG = LogUtils.getL7dLogger(RealmProperties.class); + private String name; private String issuer; private String signatureAlias; private Crypto signatureCrypto; @@ -58,6 +59,22 @@ public class RealmProperties { } /** + * Get the name of this realm + * @return realmA + */ + public String getName() { + return name; + } + + /** + * Set the name of this realm + * @param name the name of this realm + */ + public void setName(String name) { + this.name = name; + } + + /** * Set the issuer of this realm * @param issuer the issuer of this realm */ http://git-wip-us.apache.org/repos/asf/cxf/blob/736e7d46/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml index b2b3404..8d721d9 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml @@ -24,6 +24,9 @@ <cxf:logging/> </cxf:features> </cxf:bus> + + <import resource="realms.xml" /> + <bean id="hokDelegationHandler" class="org.apache.cxf.sts.token.delegation.HOKDelegationHandler"/> <bean id="utDelegationHandler" class="org.apache.cxf.sts.token.delegation.UsernameTokenDelegationHandler"/> @@ -96,16 +99,6 @@ <value>https://localhost:(\d)*/doubleit/services/doubleittransport.* </value> </util:list> - <bean id="realmA" class="org.apache.cxf.sts.token.realm.RealmProperties"> - <property name="issuer" value="a-issuer"/> - </bean> - <bean id="realmB" class="org.apache.cxf.sts.token.realm.RealmProperties"> - <property name="issuer" value="b-issuer"/> - </bean> - <util:map id="realms"> - <entry key="a-issuer" value-ref="realmA"/> - <entry key="b-issuer" value-ref="realmB"/> - </util:map> <bean id="samlRealmCodec" class="org.apache.cxf.systest.sts.common.SAMLRealmCNCodec"/> <bean id="customRealmParser" class="org.apache.cxf.systest.sts.common.UriRealmParser"/> <bean id="identityMapper" class="org.apache.cxf.systest.sts.common.CustomIdentityMapper"/> http://git-wip-us.apache.org/repos/asf/cxf/blob/736e7d46/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/realms.xml ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/realms.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/realms.xml new file mode 100644 index 0000000..4aee41d --- /dev/null +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/realms.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!-- + 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. +--> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:test="http://apache.org/hello_world_soap_http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/sc hemas/configuration/http-jetty.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <bean id="realmA" class="org.apache.cxf.sts.token.realm.RealmProperties"> + <property name="issuer" value="a-issuer"/> + <property name="name" value="a-issuer"/> + </bean> + <bean id="realmB" class="org.apache.cxf.sts.token.realm.RealmProperties"> + <property name="issuer" value="b-issuer"/> + <property name="name" value="b-issuer"/> + </bean> + <util:map id="realms"> + <entry key="#{realmA.getName()}" value-ref="realmA"/> + <entry key="#{realmB.getName()}" value-ref="realmB"/> + </util:map> +</beans> http://git-wip-us.apache.org/repos/asf/cxf/blob/736e7d46/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml index 43c75c7..8405022 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml @@ -24,6 +24,9 @@ <cxf:logging/> </cxf:features> </cxf:bus> + + <import resource="realms.xml" /> + <bean id="hokDelegationHandler" class="org.apache.cxf.sts.token.delegation.HOKDelegationHandler"/> <bean id="transportSTSProviderBean2" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider"> <property name="issueOperation" ref="transportIssueDelegate2"/> @@ -84,16 +87,6 @@ <value>https://localhost:(\d)*/doubleit/services/doubleittransport.* </value> </util:list> - <bean id="realmA" class="org.apache.cxf.sts.token.realm.RealmProperties"> - <property name="issuer" value="a-issuer"/> - </bean> - <bean id="realmB" class="org.apache.cxf.sts.token.realm.RealmProperties"> - <property name="issuer" value="b-issuer"/> - </bean> - <util:map id="realms"> - <entry key="a-issuer" value-ref="realmA"/> - <entry key="b-issuer" value-ref="realmB"/> - </util:map> <bean id="samlRealmCodec" class="org.apache.cxf.systest.sts.common.SAMLRealmCNCodec"/> <bean id="customRealmParser" class="org.apache.cxf.systest.sts.common.UriRealmParser"/> <bean id="identityMapper" class="org.apache.cxf.systest.sts.common.CustomIdentityMapper"/>
