[2/2] cxf git commit: Merge branch 'CXF-7109' of https://github.com/tadayosi/cxf
Merge branch 'CXF-7109' of https://github.com/tadayosi/cxf Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c05e56d4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c05e56d4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c05e56d4 Branch: refs/heads/master Commit: c05e56d4a99511884fba01b1fb707c120ea81433 Parents: 70e1cbf 4eb81d3 Author: Freeman FangAuthored: Wed Oct 26 10:04:12 2016 +0800 Committer: Freeman Fang Committed: Wed Oct 26 10:04:12 2016 +0800 -- .../org/apache/cxf/endpoint/ClientImpl.java | 14 ++--- .../cxf/interceptor/ClientOutFaultObserver.java | 3 ++- .../cxf/message/AbstractWrappedMessage.java | 3 +++ .../org/apache/cxf/message/ExchangeImpl.java| 4 .../java/org/apache/cxf/message/StringMap.java | 7 +++ .../org/apache/cxf/message/StringMapImpl.java | 4 .../http/asyncclient/AsyncHTTPConduitTest.java | 21 .../apache/cxf/transport/http/HTTPConduit.java | 11 +- 8 files changed, 58 insertions(+), 9 deletions(-) --
[1/2] cxf git commit: [CXF-7109] ClientCallback may be invoked twice when Async HTTP Transport is used
Repository: cxf Updated Branches: refs/heads/master 70e1cbf0a -> c05e56d4a [CXF-7109] ClientCallback may be invoked twice when Async HTTP Transport is used Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4eb81d30 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4eb81d30 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4eb81d30 Branch: refs/heads/master Commit: 4eb81d3044c0f663d580cdbd3b611d5e3b1b4ac5 Parents: e6d2a51 Author: Tadayoshi SatoAuthored: Tue Oct 25 18:45:42 2016 +0900 Committer: Tadayoshi Sato Committed: Wed Oct 26 09:35:11 2016 +0900 -- .../org/apache/cxf/endpoint/ClientImpl.java | 14 ++--- .../cxf/interceptor/ClientOutFaultObserver.java | 3 ++- .../cxf/message/AbstractWrappedMessage.java | 3 +++ .../org/apache/cxf/message/ExchangeImpl.java| 4 .../java/org/apache/cxf/message/StringMap.java | 7 +++ .../org/apache/cxf/message/StringMapImpl.java | 4 .../http/asyncclient/AsyncHTTPConduitTest.java | 21 .../apache/cxf/transport/http/HTTPConduit.java | 11 +- 8 files changed, 58 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4eb81d30/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java -- diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java index 428f794..848d3bc 100644 --- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java +++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java @@ -791,8 +791,11 @@ public class ClientImpl if (resCtx != null) { responseContext.put(Thread.currentThread(), resCtx); } -callback.handleException(resCtx, error); - +// remove callback so that it won't be invoked twice +callback = message.getExchange().remove(ClientCallback.class); +if (callback != null) { +callback.handleException(resCtx, error); +} } } else { chain.doIntercept(message); @@ -801,8 +804,13 @@ public class ClientImpl } callback = message.getExchange().get(ClientCallback.class); +if (callback == null || isPartialResponse(message)) { +return; +} -if (callback != null && !isPartialResponse(message)) { +// remove callback so that it won't be invoked twice +callback = message.getExchange().remove(ClientCallback.class); +if (callback != null) { message.getExchange().setInMessage(message); Map resCtx = CastUtils.cast((Map)message .getExchange() http://git-wip-us.apache.org/repos/asf/cxf/blob/4eb81d30/core/src/main/java/org/apache/cxf/interceptor/ClientOutFaultObserver.java -- diff --git a/core/src/main/java/org/apache/cxf/interceptor/ClientOutFaultObserver.java b/core/src/main/java/org/apache/cxf/interceptor/ClientOutFaultObserver.java index 0c879c5..f139da9 100644 --- a/core/src/main/java/org/apache/cxf/interceptor/ClientOutFaultObserver.java +++ b/core/src/main/java/org/apache/cxf/interceptor/ClientOutFaultObserver.java @@ -50,7 +50,8 @@ public class ClientOutFaultObserver extends AbstractFaultChainInitiatorObserver return; } Exception ex = m.getContent(Exception.class); -ClientCallback callback = m.getExchange().get(ClientCallback.class); +// remove callback so that it won't be invoked twice +ClientCallback callback = m.getExchange().remove(ClientCallback.class); if (callback != null) { Map resCtx = CastUtils.cast((Map) m.getExchange().getOutMessage().get( http://git-wip-us.apache.org/repos/asf/cxf/blob/4eb81d30/core/src/main/java/org/apache/cxf/message/AbstractWrappedMessage.java -- diff --git a/core/src/main/java/org/apache/cxf/message/AbstractWrappedMessage.java b/core/src/main/java/org/apache/cxf/message/AbstractWrappedMessage.java index 496b97b..094e432 100644 --- a/core/src/main/java/org/apache/cxf/message/AbstractWrappedMessage.java +++ b/core/src/main/java/org/apache/cxf/message/AbstractWrappedMessage.java @@ -157,6 +157,9 @@ public abstract class AbstractWrappedMessage implements Message { public
cxf git commit: Updated Spring Boot demos. Added metrics filtering based on CXF and application metric registry only
Repository: cxf Updated Branches: refs/heads/master e6d2a5121 -> 70e1cbf0a Updated Spring Boot demos. Added metrics filtering based on CXF and application metric registry only Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/70e1cbf0 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/70e1cbf0 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/70e1cbf0 Branch: refs/heads/master Commit: 70e1cbf0a1a48edd7da5ef25c371e352a95e79a2 Parents: e6d2a51 Author: retaAuthored: Tue Oct 25 21:44:07 2016 -0400 Committer: reta Committed: Tue Oct 25 21:44:07 2016 -0400 -- .../sample/rs/service/SampleRestApplication.java | 19 +++ 1 file changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/70e1cbf0/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java -- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java index ca9c445..e146a7f 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java +++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java @@ -17,13 +17,32 @@ * under the License. */ package sample.rs.service; +import java.util.Collections; + import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics; +import org.springframework.boot.actuate.endpoint.MetricsEndpoint; +import org.springframework.boot.actuate.metrics.reader.MetricRegistryMetricReader; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.context.annotation.Bean; + +import com.codahale.metrics.MetricRegistry; @SpringBootApplication @EnableEurekaClient public class SampleRestApplication { +@Bean +public MetricRegistry metricRegistry(){ +return new MetricRegistry(); +} + +@Bean +public MetricsEndpoint metricsEndpoint(final MetricRegistry registry) { +return new MetricsEndpoint(Collections.singleton(new MetricReaderPublicMetrics( +new MetricRegistryMetricReader(registry; +} + public static void main(String[] args) { SpringApplication.run(SampleRestApplication.class, args); }
cxf-fediz git commit: Fixing LDAP configuration
Repository: cxf-fediz Updated Branches: refs/heads/master a758d3137 -> 747223b34 Fixing LDAP configuration Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/747223b3 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/747223b3 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/747223b3 Branch: refs/heads/master Commit: 747223b34bec2dce20369202eb4e672420b81ec7 Parents: a758d31 Author: Colm O hEigeartaighAuthored: Tue Oct 25 16:55:23 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 16:55:23 2016 +0100 -- services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/747223b3/services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml -- diff --git a/services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml b/services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml index dbd3265..8b36f86 100644 --- a/services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml +++ b/services/sts/src/main/webapp/WEB-INF/endpoints/ldap.xml @@ -102,16 +102,16 @@ http://docs.oasis-open.org/ws-sx/ws-trust/200512/; serviceName="ns1:SecurityTokenService" endpointName="ns1:TransportUT_Port"> - + - \ No newline at end of file +
cxf-fediz git commit: Switch to using https for repos
Repository: cxf-fediz Updated Branches: refs/heads/1.2.x-fixes 99bf606ac -> 0f5ae8cea Switch to using https for repos Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/0f5ae8ce Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/0f5ae8ce Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/0f5ae8ce Branch: refs/heads/1.2.x-fixes Commit: 0f5ae8cea4d891fa3cc2f20fbd579034646d68c4 Parents: 99bf606 Author: Colm O hEigeartaighAuthored: Tue Oct 25 14:29:02 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 14:29:28 2016 +0100 -- pom.xml | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0f5ae8ce/pom.xml -- diff --git a/pom.xml b/pom.xml index c3543df..7f6629e 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -134,13 +134,6 @@ -central -https://repo1.maven.org/maven2 - -true - - - wasdev-maven-repo wasdev-maven-repo http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ @@ -149,7 +142,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -159,13 +152,6 @@ -central -https://repo1.maven.org/maven2 - -true - - - Liberty Liberty Repository http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/
cxf-fediz git commit: Switch to using https for repos
Repository: cxf-fediz Updated Branches: refs/heads/master b8faa2db2 -> a758d3137 Switch to using https for repos Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/a758d313 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/a758d313 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/a758d313 Branch: refs/heads/master Commit: a758d3137a09ca2299583bf74bd71c500bbd64dd Parents: b8faa2d Author: Colm O hEigeartaighAuthored: Tue Oct 25 14:29:02 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 14:29:02 2016 +0100 -- pom.xml | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/a758d313/pom.xml -- diff --git a/pom.xml b/pom.xml index 0110631..a82ae12 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -135,13 +135,6 @@ -central -https://repo1.maven.org/maven2 - -true - - - wasdev-maven-repo wasdev-maven-repo http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ @@ -150,7 +143,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -160,13 +153,6 @@ -central -https://repo1.maven.org/maven2 - -true - - - Liberty Liberty Repository http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/
[1/2] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 00e228729 -> 6907457ca Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6907457c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6907457c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6907457c Branch: refs/heads/3.0.x-fixes Commit: 6907457ca76fc750ba73226598806b70594dad57 Parents: fb0ae74 Author: Colm O hEigeartaighAuthored: Tue Oct 25 13:43:02 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 13:43:02 2016 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6907457c/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 4375282..3d65fe7 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -378,6 +378,7 @@ B 49c35937c3a0813ed4ccf34dd03fd5fa2f41b86c B 49e1943994503e96e6c69f4e55d8a0ba9f5464c8 B 4a1ee7cd1175169d448d4bd557e2ae3deff27b4d B 4a749e745ee64b3d9ee09eb9e7a35039127d6f40 +B 4a97a25efc17e0d0ce3d96a1476a8183e5a97879 B 4aa03532795379b702249e881a3bf027062a797c B 4b15b8a49c1ea75c346ea4a53e3110db7edbd127 B 4b44512d8c3fe76620dbac37d220038435c75ba5
[2/2] cxf git commit: Switch to use https for the repositories entries
Switch to use https for the repositories entries Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fb0ae745 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fb0ae745 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fb0ae745 Branch: refs/heads/3.0.x-fixes Commit: fb0ae745bc9dd004de375745bbb6ae4ca570cef9 Parents: 00e2287 Author: Colm O hEigeartaighAuthored: Tue Oct 25 11:15:18 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 13:43:02 2016 +0100 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/fb0ae745/pom.xml -- diff --git a/pom.xml b/pom.xml index 243732e..60c8d5c 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -82,7 +82,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ true
[2/2] cxf git commit: Record older ActAs attributes in the newer token
Record older ActAs attributes in the newer token Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4a97a25e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4a97a25e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4a97a25e Branch: refs/heads/3.1.x-fixes Commit: 4a97a25efc17e0d0ce3d96a1476a8183e5a97879 Parents: 03d40ca Author: Colm O hEigeartaighAuthored: Tue Oct 25 11:15:02 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 13:37:56 2016 +0100 -- .../ActAsAttributeStatementProvider.java| 30 ++ .../token/provider/SAMLProviderActAsTest.java | 96 2 files changed, 126 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4a97a25e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java index 808cad2..cd0e837 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java @@ -34,6 +34,7 @@ import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.apache.wss4j.common.saml.bean.AttributeBean; import org.apache.wss4j.common.saml.bean.AttributeStatementBean; import org.apache.wss4j.dom.WSConstants; +import org.opensaml.core.xml.XMLObject; /** * An AttributeStatementProvider implementation to handle "ActAs". It adds an "ActAs "attribute" with the name of @@ -94,6 +95,35 @@ public class ActAsAttributeStatementProvider implements AttributeStatementProvid SamlAssertionWrapper wrapper = new SamlAssertionWrapper((Element)parameter); SAMLTokenPrincipal principal = new SAMLTokenPrincipalImpl(wrapper); parameterBean.addAttributeValue(principal.getName()); + +// Check for other ActAs attributes here + add them in +if (wrapper.getSaml2() != null) { +for (org.opensaml.saml.saml2.core.AttributeStatement attributeStatement +: wrapper.getSaml2().getAttributeStatements()) { +for (org.opensaml.saml.saml2.core.Attribute attribute : attributeStatement.getAttributes()) { +if ("ActAs".equals(attribute.getName())) { +for (XMLObject attributeValue : attribute.getAttributeValues()) { +Element attributeValueElement = attributeValue.getDOM(); +String text = attributeValueElement.getTextContent(); +parameterBean.addAttributeValue(text); +} +} +} +} +} else if (wrapper.getSaml1() != null) { +for (org.opensaml.saml.saml1.core.AttributeStatement attributeStatement +: wrapper.getSaml1().getAttributeStatements()) { +for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { +if ("ActAs".equals(attribute.getAttributeName())) { +for (XMLObject attributeValue : attribute.getAttributeValues()) { +Element attributeValueElement = attributeValue.getDOM(); +String text = attributeValueElement.getTextContent(); +parameterBean.addAttributeValue(text); +} +} +} +} +} } return parameterBean; http://git-wip-us.apache.org/repos/asf/cxf/blob/4a97a25e/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java -- diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java index 768da57..ad90fe4 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java @@ -288,6 +288,102 @@ public class SAMLProviderActAsTest extends org.junit.Assert {
[1/2] cxf git commit: Switch to use https for the repositories entries
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 03d40ca7c -> 4537bb27c Switch to use https for the repositories entries Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4537bb27 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4537bb27 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4537bb27 Branch: refs/heads/3.1.x-fixes Commit: 4537bb27c60afdfcba52dc452dc5abf0e729f810 Parents: 4a97a25 Author: Colm O hEigeartaighAuthored: Tue Oct 25 11:15:18 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 13:37:56 2016 +0100 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4537bb27/pom.xml -- diff --git a/pom.xml b/pom.xml index 03165a2..bbee3e0 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -82,7 +82,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ true
[2/2] cxf git commit: Switch to use https for the repositories entries
Switch to use https for the repositories entries Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e6d2a512 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e6d2a512 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e6d2a512 Branch: refs/heads/master Commit: e6d2a5121f4a92a4fc52f8792ac038bf717459ce Parents: 6cec1a1 Author: Colm O hEigeartaighAuthored: Tue Oct 25 11:15:18 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 11:15:18 2016 +0100 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/e6d2a512/pom.xml -- diff --git a/pom.xml b/pom.xml index 3a5225e..c209fb3 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ Apache Snapshot Repo true @@ -82,7 +82,7 @@ apache.snapshots -http://repository.apache.org/snapshots/ +https://repository.apache.org/snapshots/ true
[1/2] cxf git commit: Record older ActAs attributes in the newer token
Repository: cxf Updated Branches: refs/heads/master 160618509 -> e6d2a5121 Record older ActAs attributes in the newer token Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6cec1a13 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6cec1a13 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6cec1a13 Branch: refs/heads/master Commit: 6cec1a13d90d93f26017453836b2d759f7437165 Parents: 1606185 Author: Colm O hEigeartaighAuthored: Tue Oct 25 11:15:02 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Oct 25 11:15:02 2016 +0100 -- .../ActAsAttributeStatementProvider.java| 30 ++ .../token/provider/SAMLProviderActAsTest.java | 96 2 files changed, 126 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6cec1a13/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java index 808cad2..cd0e837 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ActAsAttributeStatementProvider.java @@ -34,6 +34,7 @@ import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.apache.wss4j.common.saml.bean.AttributeBean; import org.apache.wss4j.common.saml.bean.AttributeStatementBean; import org.apache.wss4j.dom.WSConstants; +import org.opensaml.core.xml.XMLObject; /** * An AttributeStatementProvider implementation to handle "ActAs". It adds an "ActAs "attribute" with the name of @@ -94,6 +95,35 @@ public class ActAsAttributeStatementProvider implements AttributeStatementProvid SamlAssertionWrapper wrapper = new SamlAssertionWrapper((Element)parameter); SAMLTokenPrincipal principal = new SAMLTokenPrincipalImpl(wrapper); parameterBean.addAttributeValue(principal.getName()); + +// Check for other ActAs attributes here + add them in +if (wrapper.getSaml2() != null) { +for (org.opensaml.saml.saml2.core.AttributeStatement attributeStatement +: wrapper.getSaml2().getAttributeStatements()) { +for (org.opensaml.saml.saml2.core.Attribute attribute : attributeStatement.getAttributes()) { +if ("ActAs".equals(attribute.getName())) { +for (XMLObject attributeValue : attribute.getAttributeValues()) { +Element attributeValueElement = attributeValue.getDOM(); +String text = attributeValueElement.getTextContent(); +parameterBean.addAttributeValue(text); +} +} +} +} +} else if (wrapper.getSaml1() != null) { +for (org.opensaml.saml.saml1.core.AttributeStatement attributeStatement +: wrapper.getSaml1().getAttributeStatements()) { +for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { +if ("ActAs".equals(attribute.getAttributeName())) { +for (XMLObject attributeValue : attribute.getAttributeValues()) { +Element attributeValueElement = attributeValue.getDOM(); +String text = attributeValueElement.getTextContent(); +parameterBean.addAttributeValue(text); +} +} +} +} +} } return parameterBean; http://git-wip-us.apache.org/repos/asf/cxf/blob/6cec1a13/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java -- diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java index 768da57..ad90fe4 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java @@ -288,6 +288,102 @@ public class