cxf git commit: Some PMD updates
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 3127dfa07 -> 59300095b Some PMD updates Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/59300095 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/59300095 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/59300095 Branch: refs/heads/3.1.x-fixes Commit: 59300095b543d8085d48b1d915353c763f7468c0 Parents: 3127dfa Author: Colm O hEigeartaighAuthored: Wed Dec 23 11:18:49 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 11:19:37 2015 + -- .../cxf/attachment/AttachmentDeserializer.java | 6 +-- .../apache/cxf/attachment/AttachmentUtil.java | 4 +- .../apache/cxf/bus/blueprint/BlueprintBus.java | 4 -- .../org/apache/cxf/bus/spring/SpringBus.java| 4 -- .../cxf/common/injection/ResourceInjector.java | 8 ++-- .../org/apache/cxf/common/util/CacheMap.java| 2 +- .../configuration/ConfiguredBeanLocator.java| 2 +- .../jsse/TLSParameterJaxBUtils.java | 12 ++--- .../org/apache/cxf/endpoint/EndpointImpl.java | 14 +- .../org/apache/cxf/helpers/ServiceUtils.java| 6 +-- .../AbstractAttributedInterceptorProvider.java | 2 +- .../AbstractOutDatabindingInterceptor.java | 3 +- .../cxf/interceptor/AnnotationInterceptors.java | 2 +- .../cxf/interceptor/FIStaxOutInterceptor.java | 4 +- .../cxf/interceptor/StaxOutInterceptor.java | 7 +-- .../apache/cxf/service/ServiceModelVisitor.java | 4 +- .../factory/AnnotationsFactoryBeanListener.java | 4 +- .../invoker/spring/SpringBeanFactory.java | 2 +- .../cxf/staxutils/W3CDOMStreamReader.java | 5 -- .../staxutils/transform/InTransformReader.java | 4 +- .../apache/cxf/ws/addressing/ContextUtils.java | 8 +--- .../ws/addressing/EndpointReferenceUtils.java | 2 +- .../cxf/ws/addressing/VersionTransformer.java | 2 +- .../cxf/bus/extension/ExtensionManagerTest.java | 2 +- .../cxf/bus/osgi/OSGiBusListenerTest.java | 8 ++-- .../common/injection/ResourceInjectorTest.java | 2 - .../spring/ConfigurerImplTest.java | 48 ++-- .../common/gzip/GZIPAcceptEncodingTest.java | 14 +++--- .../cxf/tools/common/VelocityGenerator.java | 4 +- .../common/dom/ExtendedDocumentBuilder.java | 4 +- .../cxf/tools/common/model/JavaMethod.java | 2 +- .../common/toolspec/DummyToolContainer.java | 6 +-- 32 files changed, 94 insertions(+), 107 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/59300095/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index 5bf78d1..8d54660 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -184,7 +184,7 @@ public class AttachmentDeserializer { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { -cache((DelegatingInputStream) body, true); +cache((DelegatingInputStream) body); } List atts = new ArrayList(attachments.getLoadedAttachments()); @@ -196,14 +196,14 @@ public class AttachmentDeserializer { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { -cache((DelegatingInputStream) s.getInputStream(), false); +cache((DelegatingInputStream) s.getInputStream()); } else { //assume a normal stream that is already cached } } } -private void cache(DelegatingInputStream input, boolean deleteOnClose) throws IOException { +private void cache(DelegatingInputStream input) throws IOException { if (loaded.contains(input)) { return; } http://git-wip-us.apache.org/repos/asf/cxf/blob/59300095/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index ec3407a..5950d6c 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -156,7 +156,7 @@ public final class AttachmentUtil { } public static boolean isMtomEnabled(Message message) { -Object prop =
[2/2] cxf git commit: Some PMD updates
Some PMD updates Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a73d1005 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a73d1005 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a73d1005 Branch: refs/heads/3.0.x-fixes Commit: a73d10050e26fd5e5b4c61c45f181170bc32e668 Parents: d7ea93c Author: Colm O hEigeartaighAuthored: Wed Dec 23 11:18:49 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 11:49:00 2015 + -- .../cxf/attachment/AttachmentDeserializer.java | 6 +-- .../apache/cxf/attachment/AttachmentUtil.java | 4 +- .../apache/cxf/bus/blueprint/BlueprintBus.java | 4 -- .../org/apache/cxf/bus/spring/SpringBus.java| 4 -- .../cxf/common/injection/ResourceInjector.java | 8 ++-- .../org/apache/cxf/common/util/CacheMap.java| 2 +- .../configuration/ConfiguredBeanLocator.java| 2 +- .../jsse/TLSParameterJaxBUtils.java | 12 ++--- .../org/apache/cxf/endpoint/EndpointImpl.java | 14 +- .../org/apache/cxf/helpers/ServiceUtils.java| 6 +-- .../AbstractAttributedInterceptorProvider.java | 2 +- .../AbstractOutDatabindingInterceptor.java | 3 +- .../cxf/interceptor/AnnotationInterceptors.java | 2 +- .../cxf/interceptor/FIStaxOutInterceptor.java | 4 +- .../cxf/interceptor/StaxOutInterceptor.java | 7 +-- .../apache/cxf/service/ServiceModelVisitor.java | 4 +- .../factory/AnnotationsFactoryBeanListener.java | 4 +- .../invoker/spring/SpringBeanFactory.java | 2 +- .../cxf/staxutils/W3CDOMStreamReader.java | 5 -- .../staxutils/transform/InTransformReader.java | 4 +- .../apache/cxf/ws/addressing/ContextUtils.java | 8 +--- .../ws/addressing/EndpointReferenceUtils.java | 2 +- .../cxf/ws/addressing/VersionTransformer.java | 2 +- .../cxf/bus/extension/ExtensionManagerTest.java | 2 +- .../cxf/bus/osgi/OSGiBusListenerTest.java | 8 ++-- .../common/injection/ResourceInjectorTest.java | 2 - .../spring/ConfigurerImplTest.java | 48 ++-- .../common/gzip/GZIPAcceptEncodingTest.java | 14 +++--- .../cxf/tools/common/VelocityGenerator.java | 4 +- .../common/dom/ExtendedDocumentBuilder.java | 4 +- .../cxf/tools/common/model/JavaMethod.java | 2 +- .../common/toolspec/DummyToolContainer.java | 6 +-- 32 files changed, 94 insertions(+), 107 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/a73d1005/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index 38e01ce..6d96106 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -184,7 +184,7 @@ public class AttachmentDeserializer { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { -cache((DelegatingInputStream) body, true); +cache((DelegatingInputStream) body); } List atts = new ArrayList(attachments.getLoadedAttachments()); @@ -196,14 +196,14 @@ public class AttachmentDeserializer { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { -cache((DelegatingInputStream) s.getInputStream(), false); +cache((DelegatingInputStream) s.getInputStream()); } else { //assume a normal stream that is already cached } } } -private void cache(DelegatingInputStream input, boolean deleteOnClose) throws IOException { +private void cache(DelegatingInputStream input) throws IOException { if (loaded.contains(input)) { return; } http://git-wip-us.apache.org/repos/asf/cxf/blob/a73d1005/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index 18b198f..eade807 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -155,7 +155,7 @@ public final class AttachmentUtil { } public static boolean isMtomEnabled(Message message) { -Object prop = message.getContextualProperty(org.apache.cxf.message.Message.MTOM_ENABLED); +Object
[1/2] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes d7ea93c74 -> f571cba48 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/f571cba4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f571cba4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f571cba4 Branch: refs/heads/3.0.x-fixes Commit: f571cba48a242eead811b213ccaddc3eab2cc79c Parents: a73d100 Author: Colm O hEigeartaighAuthored: Wed Dec 23 11:49:00 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 11:49:00 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f571cba4/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 285f5ac..c4ff443 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -685,6 +685,7 @@ M 56c0db05126292a61a782f05848321b9b8b8b80c M 58e6563da54fd3237a9a1d21a2cf7115740795a2 M 590313298b7a4d79c80b130357c5036adb6102c2 M 591e5d9cb6ab1ba85a5d37da2fbbf9b53ce777ed +M 59300095b543d8085d48b1d915353c763f7468c0 M 59c97b4e1c6a5eb6d0447fad62c7efbb3371fe00 M 5a9a2a09887c69cdfeff5eac22996ab35fbfc0cf M 5b20a3c909440bab1f0080a0b4b414fef6a6d4b9
cxf git commit: More OAuth2 token management updates
Repository: cxf Updated Branches: refs/heads/master d887fef43 -> 92a87246b More OAuth2 token management updates Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/92a87246 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/92a87246 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/92a87246 Branch: refs/heads/master Commit: 92a87246bc4cac50cf5174313614294c45b3694c Parents: d887fef Author: Sergey BeryozkinAuthored: Wed Dec 23 13:23:33 2015 + Committer: Sergey Beryozkin Committed: Wed Dec 23 13:23:33 2015 + -- .../grants/code/AbstractCodeDataProvider.java | 9 +-- .../code/DefaultEHCacheCodeDataProvider.java| 21 +-- .../code/DefaultEncryptingCodeDataProvider.java | 22 +--- .../provider/AbstractOAuthDataProvider.java | 25 -- .../DefaultEHCacheOAuthDataProvider.java| 27 .../DefaultEncryptingOAuthDataProvider.java | 21 ++- 6 files changed, 93 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/92a87246/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java index 14858c1..23fd17e 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java @@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.oauth2.grants.code; import java.util.List; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -46,7 +47,11 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider public void setCodeLifetime(long codeLifetime) { this.codeLifetime = codeLifetime; } - +protected void removeClientCodeGrants(Client c) { +for (ServerAuthorizationCodeGrant grant : getCodeGrants(c)) { +removeCodeGrant(grant.getCode()); +} +} public static ServerAuthorizationCodeGrant initCodeGrant(AuthorizationCodeRegistration reg, long lifetime) { ServerAuthorizationCodeGrant grant = new ServerAuthorizationCodeGrant(reg.getClient(), lifetime); grant.setRedirectUri(reg.getRedirectUri()); @@ -59,5 +64,5 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider return grant; } protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); -public abstract List getCodeGrants(); +public abstract List getCodeGrants(Client c); } http://git-wip-us.apache.org/repos/asf/cxf/blob/92a87246/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java index de86647..768b969 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java @@ -26,6 +26,7 @@ import net.sf.ehcache.Ehcache; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.helpers.CastUtils; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -56,6 +57,19 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi } @Override +public Client removeClient(String clientId) { +Client c = super.removeClient(clientId); +removeClientCodeGrants(c); +return c; +} + +protected void removeClientCodeGrants(Client c) { +for (ServerAuthorizationCodeGrant grant :
[2/3] cxf git commit: Adding more OAuth negative tests
Adding more OAuth negative tests # Conflicts: # systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/88ed6e9f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/88ed6e9f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/88ed6e9f Branch: refs/heads/3.0.x-fixes Commit: 88ed6e9f581c7b98c3ea6ed5790dfa8b3f41f018 Parents: f571cba Author: Colm O hEigeartaighAuthored: Wed Dec 23 14:58:28 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 15:01:41 2015 + -- .../grants/AuthorizationGrantNegativeTest.java | 452 +++ 1 file changed, 452 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/88ed6e9f/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java index 09c0cb1..74a65be 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import javax.ws.rs.client.ResponseProcessingException; import javax.ws.rs.core.Form; import javax.ws.rs.core.Response; @@ -54,7 +55,396 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB assertTrue("server did not launch correctly", launchServer(BookServerOAuth2GrantsNegative.class, true)); } + +// +// Authorization code grants +// + +@org.junit.Test +public void testAuthorizationCodeBadClient() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("redirect_uri", "http://www.blah.apache.org;); +client.query("response_type", "code"); +client.path("authorize/"); + +// No client +Response response = client.get(); +assertEquals(400, response.getStatus()); + +// Bad client +client.query("client_id", "bad-consumer-id"); +response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testAuthorizationCodeBadRedirectionURI() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("client_id", "consumer-id"); +client.query("response_type", "code"); +client.path("authorize/"); + +// Bad redirect URI +client.query("redirect_uri", "http://www.blah.bad.apache.org;); +Response response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testResponseType() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +
[1/3] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes f571cba48 -> 2ae6337ab 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/13bb2085 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/13bb2085 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/13bb2085 Branch: refs/heads/3.0.x-fixes Commit: 13bb2085aca6cb43852375fb20be971b970a87a3 Parents: 88ed6e9 Author: Colm O hEigeartaighAuthored: Wed Dec 23 15:01:41 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 15:01:41 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/13bb2085/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index c4ff443..82c1e90 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -826,6 +826,7 @@ M d5315e072b8dd5222ede6f8e47c1e3e645209f59 M d5585c4c352803bfdf43e91d3c5dd2bea2abeb86 M d58606e554418899e905cd2f3bc7e8c465eff451 M d7945c77da4f438cd7f52b1a512e65c62409d0ef +M d7b533636ab8216af87bdd46f95953d0f79ea1e6 M d9f4142e87bc8a4f31c1bd1560a01a18b5c66407 M da352523c42bf69ab743f75a5216a03e26a20bef M daac77b18e2693ef4ad424937aedc764229a63ee
[3/3] cxf git commit: Fixing test
Fixing test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2ae6337a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2ae6337a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2ae6337a Branch: refs/heads/3.0.x-fixes Commit: 2ae6337ab7006554c062db05225c56f0cf0ac38e Parents: 13bb208 Author: Colm O hEigeartaighAuthored: Wed Dec 23 15:35:53 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 15:35:53 2015 + -- .../rs/security/oauth2/services/RedirectionBasedGrantService.java | 2 +- .../security/oauth2/grants/AuthorizationGrantNegativeTest.java| 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/2ae6337a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java index e260bbc..adef572 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java @@ -325,7 +325,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService List uris = client.getRedirectUris(); if (redirectUri != null) { if (!uris.contains(redirectUri)) { -redirectUri = null; +reportInvalidRequestError("Client Redirect Uri is invalid"); } } else if (uris.size() == 1 && useRegisteredRedirectUriIfPossible) { redirectUri = uris.get(0); http://git-wip-us.apache.org/repos/asf/cxf/blob/2ae6337a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java index 74a65be..5cf1b0a 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java @@ -731,9 +731,7 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims); return jws.getSignedEncodedJws(); } -<<< HEAD */ -=== private String getAuthorizationCode(WebClient client) { return getAuthorizationCode(client, null); @@ -793,5 +791,4 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB } return foundString.substring(0, ampersandIndex); } ->>> d7b5336... Adding more OAuth negative tests }
cxf git commit: Adding more OAuth negative tests
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes b7389c130 -> d7b533636 Adding more OAuth negative tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d7b53363 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d7b53363 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d7b53363 Branch: refs/heads/3.1.x-fixes Commit: d7b533636ab8216af87bdd46f95953d0f79ea1e6 Parents: b7389c1 Author: Colm O hEigeartaighAuthored: Wed Dec 23 14:58:28 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 14:59:02 2015 + -- .../grants/AuthorizationGrantNegativeTest.java | 449 +++ 1 file changed, 449 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d7b53363/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java index 3da9604..008c473 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java @@ -27,6 +27,7 @@ import java.util.Date; import java.util.List; import java.util.Properties; +import javax.ws.rs.client.ResponseProcessingException; import javax.ws.rs.core.Form; import javax.ws.rs.core.Response; @@ -63,7 +64,396 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB assertTrue("server did not launch correctly", launchServer(BookServerOAuth2GrantsNegative.class, true)); } + +// +// Authorization code grants +// + +@org.junit.Test +public void testAuthorizationCodeBadClient() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("redirect_uri", "http://www.blah.apache.org;); +client.query("response_type", "code"); +client.path("authorize/"); + +// No client +Response response = client.get(); +assertEquals(400, response.getStatus()); + +// Bad client +client.query("client_id", "bad-consumer-id"); +response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testAuthorizationCodeBadRedirectionURI() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("client_id", "consumer-id"); +client.query("response_type", "code"); +client.path("authorize/"); + +// Bad redirect URI +client.query("redirect_uri", "http://www.blah.bad.apache.org;); +Response response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testResponseType() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE);
cxf git commit: Adding more OAuth negative tests
Repository: cxf Updated Branches: refs/heads/master 92a87246b -> 1d9e4a307 Adding more OAuth negative tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1d9e4a30 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1d9e4a30 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1d9e4a30 Branch: refs/heads/master Commit: 1d9e4a307b6b5402092a95381688dab208c458ca Parents: 92a8724 Author: Colm O hEigeartaighAuthored: Wed Dec 23 14:58:28 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 14:58:28 2015 + -- .../grants/AuthorizationGrantNegativeTest.java | 449 +++ 1 file changed, 449 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1d9e4a30/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java index 3da9604..008c473 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java @@ -27,6 +27,7 @@ import java.util.Date; import java.util.List; import java.util.Properties; +import javax.ws.rs.client.ResponseProcessingException; import javax.ws.rs.core.Form; import javax.ws.rs.core.Response; @@ -63,7 +64,396 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB assertTrue("server did not launch correctly", launchServer(BookServerOAuth2GrantsNegative.class, true)); } + +// +// Authorization code grants +// + +@org.junit.Test +public void testAuthorizationCodeBadClient() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("redirect_uri", "http://www.blah.apache.org;); +client.query("response_type", "code"); +client.path("authorize/"); + +// No client +Response response = client.get(); +assertEquals(400, response.getStatus()); + +// Bad client +client.query("client_id", "bad-consumer-id"); +response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testAuthorizationCodeBadRedirectionURI() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +// Get Authorization Code +// Make initial authorization request +client.type("application/json").accept("application/json"); +client.query("client_id", "consumer-id"); +client.query("response_type", "code"); +client.path("authorize/"); + +// Bad redirect URI +client.query("redirect_uri", "http://www.blah.bad.apache.org;); +Response response = client.get(); +assertEquals(400, response.getStatus()); +} + +@org.junit.Test +public void testResponseType() throws Exception { +URL busFile = AuthorizationGrantTest.class.getResource("client.xml"); + +String address = "https://localhost:; + PORT + "/services/"; +WebClient client = WebClient.create(address, setupProviders(), "alice", "security", busFile.toString()); +// Save the Cookie for the second request... +WebClient.getConfig(client).getRequestContext().put( +org.apache.cxf.message.Message.MAINTAIN_SESSION, Boolean.TRUE); + +
cxf git commit: More OAuth2 token management updates
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes b8fe59b5d -> b7389c130 More OAuth2 token management updates Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b7389c13 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b7389c13 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b7389c13 Branch: refs/heads/3.1.x-fixes Commit: b7389c130daac93a96fb781155fcd24d01836d51 Parents: b8fe59b Author: Sergey BeryozkinAuthored: Wed Dec 23 13:23:33 2015 + Committer: Sergey Beryozkin Committed: Wed Dec 23 13:27:06 2015 + -- .../grants/code/AbstractCodeDataProvider.java | 9 +-- .../code/DefaultEHCacheCodeDataProvider.java| 21 +-- .../code/DefaultEncryptingCodeDataProvider.java | 22 +--- .../provider/AbstractOAuthDataProvider.java | 25 -- .../DefaultEHCacheOAuthDataProvider.java| 27 .../DefaultEncryptingOAuthDataProvider.java | 21 ++- 6 files changed, 93 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b7389c13/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java index 14858c1..23fd17e 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java @@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.oauth2.grants.code; import java.util.List; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -46,7 +47,11 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider public void setCodeLifetime(long codeLifetime) { this.codeLifetime = codeLifetime; } - +protected void removeClientCodeGrants(Client c) { +for (ServerAuthorizationCodeGrant grant : getCodeGrants(c)) { +removeCodeGrant(grant.getCode()); +} +} public static ServerAuthorizationCodeGrant initCodeGrant(AuthorizationCodeRegistration reg, long lifetime) { ServerAuthorizationCodeGrant grant = new ServerAuthorizationCodeGrant(reg.getClient(), lifetime); grant.setRedirectUri(reg.getRedirectUri()); @@ -59,5 +64,5 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider return grant; } protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); -public abstract List getCodeGrants(); +public abstract List getCodeGrants(Client c); } http://git-wip-us.apache.org/repos/asf/cxf/blob/b7389c13/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java index de86647..768b969 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java @@ -26,6 +26,7 @@ import net.sf.ehcache.Ehcache; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.helpers.CastUtils; +import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -56,6 +57,19 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi } @Override +public Client removeClient(String clientId) { +Client c = super.removeClient(clientId); +removeClientCodeGrants(c); +return c; +} + +protected void removeClientCodeGrants(Client c) { +for (ServerAuthorizationCodeGrant grant
cxf git commit: Adding an MTOM fault test
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes d7b533636 -> c4ba8c945 Adding an MTOM fault test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c4ba8c94 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c4ba8c94 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c4ba8c94 Branch: refs/heads/3.1.x-fixes Commit: c4ba8c945aac6352b9466b6a7e87616721ae436d Parents: d7b5336 Author: Colm O hEigeartaighAuthored: Wed Dec 23 17:05:03 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:10:41 2015 + -- .../apache/cxf/systest/ws/fault/FaultTest.java | 36 +++- .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 ++ .../org/apache/cxf/systest/ws/fault/client.xml | 8 + .../org/apache/cxf/systest/ws/fault/server.xml | 7 4 files changed, 53 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/c4ba8c94/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 5429b7b..4bc825b 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java @@ -135,6 +135,41 @@ public class FaultTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } +// TODO +@org.junit.Test +@org.junit.Ignore +public void testSoap12Mtom() throws Exception { +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = FaultTest.class.getResource("client.xml"); + +Bus bus = bf.createBus(busFile.toString()); +SpringBusFactory.setDefaultBus(bus); +SpringBusFactory.setThreadDefaultBus(bus); + +URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); +Service service = Service.create(wsdl, SERVICE_QNAME); +QName portQName = new QName(NAMESPACE, "DoubleItSoap12MtomPort"); +DoubleItPortType utPort = +service.getPort(portQName, DoubleItPortType.class); +updateAddressPort(utPort, PORT); + +// Make a successful invocation +((BindingProvider)utPort).getRequestContext().put("security.username", "alice"); +utPort.doubleIt(25); + +// Now make an invocation using another username +((BindingProvider)utPort).getRequestContext().put("security.username", "bob"); +((BindingProvider)utPort).getRequestContext().put("security.password", "password"); +try { +utPort.doubleIt(25); +fail("Expected failure on bob"); +} catch (Exception ex) { +assertTrue(ex.getMessage().contains("This is a fault")); +} +((java.io.Closeable)utPort).close(); +bus.shutdown(true); +} + @org.junit.Test public void testSoap12Dispatch() throws Exception { createBus(); @@ -190,5 +225,4 @@ public class FaultTest extends AbstractBusClientServerTestBase { client.destroy(); } - } http://git-wip-us.apache.org/repos/asf/cxf/blob/c4ba8c94/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl index 2e388f5..2d4bf02 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl @@ -103,6 +103,9 @@ http://localhost:9009/DoubleItSoap12Dispatch"/> + +http://localhost:9009/DoubleItSoap12Mtom"/> + http://localhost:9009/DoubleItAsymmetric"/> http://git-wip-us.apache.org/repos/asf/cxf/blob/c4ba8c94/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml index 7f7ebf0..8863d41 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml +++
[2/3] cxf git commit: Adding an MTOM fault test
Adding an MTOM fault test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b4fc7d55 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b4fc7d55 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b4fc7d55 Branch: refs/heads/3.0.x-fixes Commit: b4fc7d55c5b086ccf5023ebdb5b2853c255eb0c3 Parents: 2ae6337 Author: Colm O hEigeartaighAuthored: Wed Dec 23 17:05:03 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:10:55 2015 + -- .../apache/cxf/systest/ws/fault/FaultTest.java | 36 +++- .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 ++ .../org/apache/cxf/systest/ws/fault/client.xml | 8 + .../org/apache/cxf/systest/ws/fault/server.xml | 7 4 files changed, 53 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b4fc7d55/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 1c8e475..f53366d 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java @@ -135,6 +135,41 @@ public class FaultTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } +// TODO +@org.junit.Test +@org.junit.Ignore +public void testSoap12Mtom() throws Exception { +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = FaultTest.class.getResource("client.xml"); + +Bus bus = bf.createBus(busFile.toString()); +SpringBusFactory.setDefaultBus(bus); +SpringBusFactory.setThreadDefaultBus(bus); + +URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); +Service service = Service.create(wsdl, SERVICE_QNAME); +QName portQName = new QName(NAMESPACE, "DoubleItSoap12MtomPort"); +DoubleItPortType utPort = +service.getPort(portQName, DoubleItPortType.class); +updateAddressPort(utPort, PORT); + +// Make a successful invocation +((BindingProvider)utPort).getRequestContext().put("security.username", "alice"); +utPort.doubleIt(25); + +// Now make an invocation using another username +((BindingProvider)utPort).getRequestContext().put("security.username", "bob"); +((BindingProvider)utPort).getRequestContext().put("security.password", "password"); +try { +utPort.doubleIt(25); +fail("Expected failure on bob"); +} catch (Exception ex) { +assertTrue(ex.getMessage().contains("This is a fault")); +} +((java.io.Closeable)utPort).close(); +bus.shutdown(true); +} + @org.junit.Test public void testSoap12Dispatch() throws Exception { createBus(); @@ -190,5 +225,4 @@ public class FaultTest extends AbstractBusClientServerTestBase { client.destroy(); } - } http://git-wip-us.apache.org/repos/asf/cxf/blob/b4fc7d55/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl index 2e388f5..2d4bf02 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl @@ -103,6 +103,9 @@ http://localhost:9009/DoubleItSoap12Dispatch"/> + +http://localhost:9009/DoubleItSoap12Mtom"/> + http://localhost:9009/DoubleItAsymmetric"/> http://git-wip-us.apache.org/repos/asf/cxf/blob/b4fc7d55/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml index 8011c39..7b8fbe8 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml @@ -38,6 +38,14 @@ +
[1/3] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 2ae6337ab -> d704868a7 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/5f597d57 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5f597d57 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5f597d57 Branch: refs/heads/3.0.x-fixes Commit: 5f597d575ac0cc341a0e9b9912e643d14cf11e50 Parents: b4fc7d5 Author: Colm O hEigeartaighAuthored: Wed Dec 23 17:10:55 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:10:55 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/5f597d57/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 82c1e90..afbc836 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -807,6 +807,7 @@ M c1863fc29c037d01e827e3b2b1dca493fddf986d M c1c75b039df7bd1ca9f11ff21f16593fed0c8c16 M c322ba957e09c58ccef0fe25b382497b031fdc06 M c34bf7ad6bc55b6584dfd009f49a3f4eb8ececc9 +M c4ba8c945aac6352b9466b6a7e87616721ae436d M c5548689b61809d26b20db1d08331b6988f92734 M c55664128b1223667dedacc2011ccd5945d9c8b9 M c5dbb84ac4e5bf73555e85ae1e65a5065393c602
[3/3] cxf git commit: Fixing backmerge
Fixing backmerge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d704868a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d704868a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d704868a Branch: refs/heads/3.0.x-fixes Commit: d704868a70819dd5f7375140f0a44b1c29dd6f39 Parents: 5f597d5 Author: Colm O hEigeartaighAuthored: Wed Dec 23 17:11:32 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:11:32 2015 + -- .../test/resources/org/apache/cxf/systest/ws/fault/client.xml | 6 +++--- .../test/resources/org/apache/cxf/systest/ws/fault/server.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d704868a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml index 7b8fbe8..d80ac42 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml @@ -40,9 +40,9 @@ http://www.example.org/contract/DoubleIt}DoubleItSoap12MtomPort; createdFromAPI="true"> - - - + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/d704868a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml index e696e9b..eded603 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml @@ -45,8 +45,8 @@ http://www.example.org/contract/DoubleIt; id="Soap12Mtom" address="http://localhost:${testutil.ports.fault.Server}/DoubleItSoap12Mtom; serviceName="s:DoubleItService" endpointName="s:DoubleItSoap12MtomPort" implementor="org.apache.cxf.systest.ws.fault.DoubleItPortTypeImpl" wsdlLocation="org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl"> - - + +
cxf git commit: Adding an MTOM fault test
Repository: cxf Updated Branches: refs/heads/master 1d9e4a307 -> 309f0c9fa Adding an MTOM fault test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/309f0c9f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/309f0c9f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/309f0c9f Branch: refs/heads/master Commit: 309f0c9fa9cc9216d6fae183ee1cab66ca208b13 Parents: 1d9e4a3 Author: Colm O hEigeartaighAuthored: Wed Dec 23 17:05:03 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:05:03 2015 + -- .../apache/cxf/systest/ws/fault/FaultTest.java | 36 +++- .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 ++ .../org/apache/cxf/systest/ws/fault/client.xml | 8 + .../org/apache/cxf/systest/ws/fault/server.xml | 7 4 files changed, 53 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 5429b7b..4bc825b 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java @@ -135,6 +135,41 @@ public class FaultTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } +// TODO +@org.junit.Test +@org.junit.Ignore +public void testSoap12Mtom() throws Exception { +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = FaultTest.class.getResource("client.xml"); + +Bus bus = bf.createBus(busFile.toString()); +SpringBusFactory.setDefaultBus(bus); +SpringBusFactory.setThreadDefaultBus(bus); + +URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); +Service service = Service.create(wsdl, SERVICE_QNAME); +QName portQName = new QName(NAMESPACE, "DoubleItSoap12MtomPort"); +DoubleItPortType utPort = +service.getPort(portQName, DoubleItPortType.class); +updateAddressPort(utPort, PORT); + +// Make a successful invocation +((BindingProvider)utPort).getRequestContext().put("security.username", "alice"); +utPort.doubleIt(25); + +// Now make an invocation using another username +((BindingProvider)utPort).getRequestContext().put("security.username", "bob"); +((BindingProvider)utPort).getRequestContext().put("security.password", "password"); +try { +utPort.doubleIt(25); +fail("Expected failure on bob"); +} catch (Exception ex) { +assertTrue(ex.getMessage().contains("This is a fault")); +} +((java.io.Closeable)utPort).close(); +bus.shutdown(true); +} + @org.junit.Test public void testSoap12Dispatch() throws Exception { createBus(); @@ -190,5 +225,4 @@ public class FaultTest extends AbstractBusClientServerTestBase { client.destroy(); } - } http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl index 2e388f5..2d4bf02 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl @@ -103,6 +103,9 @@ http://localhost:9009/DoubleItSoap12Dispatch"/> + +http://localhost:9009/DoubleItSoap12Mtom"/> + http://localhost:9009/DoubleItAsymmetric"/> http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml -- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml index 7f7ebf0..8863d41 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml +++
cxf git commit: Prototyping some token management code in default oAuth2 data providers
Repository: cxf Updated Branches: refs/heads/master f0c825245 -> d887fef43 Prototyping some token management code in default oAuth2 data providers Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d887fef4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d887fef4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d887fef4 Branch: refs/heads/master Commit: d887fef43b750a26cd6691fae1aad671f2f1cd46 Parents: f0c8252 Author: Sergey BeryozkinAuthored: Wed Dec 23 12:45:04 2015 + Committer: Sergey Beryozkin Committed: Wed Dec 23 12:45:04 2015 + -- .../grants/code/AbstractCodeDataProvider.java | 7 +- .../code/DefaultEHCacheCodeDataProvider.java| 24 - .../code/DefaultEncryptingCodeDataProvider.java | 18 .../provider/AbstractOAuthDataProvider.java | 97 +++- .../DefaultEHCacheOAuthDataProvider.java| 20 .../DefaultEncryptingOAuthDataProvider.java | 18 +++- .../oauth2/services/AbstractTokenService.java | 4 + .../oauth2/services/TokenRevocationService.java | 9 +- 8 files changed, 146 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d887fef4/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java index 1b63bb3..14858c1 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java @@ -18,6 +18,8 @@ */ package org.apache.cxf.rs.security.oauth2.grants.code; +import java.util.List; + import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -45,8 +47,6 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider this.codeLifetime = codeLifetime; } -protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); - public static ServerAuthorizationCodeGrant initCodeGrant(AuthorizationCodeRegistration reg, long lifetime) { ServerAuthorizationCodeGrant grant = new ServerAuthorizationCodeGrant(reg.getClient(), lifetime); grant.setRedirectUri(reg.getRedirectUri()); @@ -58,5 +58,6 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider grant.setNonce(reg.getNonce()); return grant; } - +protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); +public abstract List getCodeGrants(); } http://git-wip-us.apache.org/repos/asf/cxf/blob/d887fef4/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java index 5834a2c..de86647 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java @@ -18,10 +18,14 @@ */ package org.apache.cxf.rs.security.oauth2.grants.code; +import java.util.ArrayList; +import java.util.List; + import net.sf.ehcache.Ehcache; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -64,16 +68,30 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi return AbstractCodeDataProvider.initCodeGrant(reg, codeLifetime); } +public List getCodeGrants() { +List keys = CastUtils.cast(codeGrantCache.getKeys()); +List grants = +new ArrayList(keys.size()); +for (String key : keys) { +grants.add(getCodeGrant(key)); +} +return
cxf git commit: Prototyping some token management code in default oAuth2 data providers
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 59300095b -> b8fe59b5d Prototyping some token management code in default oAuth2 data providers Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b8fe59b5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b8fe59b5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b8fe59b5 Branch: refs/heads/3.1.x-fixes Commit: b8fe59b5d696e31b607efca1dc32f2521e99884a Parents: 5930009 Author: Sergey BeryozkinAuthored: Wed Dec 23 12:45:04 2015 + Committer: Sergey Beryozkin Committed: Wed Dec 23 12:47:03 2015 + -- .../grants/code/AbstractCodeDataProvider.java | 7 +- .../code/DefaultEHCacheCodeDataProvider.java| 24 - .../code/DefaultEncryptingCodeDataProvider.java | 18 .../provider/AbstractOAuthDataProvider.java | 97 +++- .../DefaultEHCacheOAuthDataProvider.java| 20 .../DefaultEncryptingOAuthDataProvider.java | 18 +++- .../oauth2/services/AbstractTokenService.java | 4 + .../oauth2/services/TokenRevocationService.java | 9 +- 8 files changed, 146 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b8fe59b5/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java index 1b63bb3..14858c1 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractCodeDataProvider.java @@ -18,6 +18,8 @@ */ package org.apache.cxf.rs.security.oauth2.grants.code; +import java.util.List; + import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -45,8 +47,6 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider this.codeLifetime = codeLifetime; } -protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); - public static ServerAuthorizationCodeGrant initCodeGrant(AuthorizationCodeRegistration reg, long lifetime) { ServerAuthorizationCodeGrant grant = new ServerAuthorizationCodeGrant(reg.getClient(), lifetime); grant.setRedirectUri(reg.getRedirectUri()); @@ -58,5 +58,6 @@ public abstract class AbstractCodeDataProvider extends AbstractOAuthDataProvider grant.setNonce(reg.getNonce()); return grant; } - +protected abstract void saveCodeGrant(ServerAuthorizationCodeGrant grant); +public abstract List getCodeGrants(); } http://git-wip-us.apache.org/repos/asf/cxf/blob/b8fe59b5/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java index 5834a2c..de86647 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java @@ -18,10 +18,14 @@ */ package org.apache.cxf.rs.security.oauth2.grants.code; +import java.util.ArrayList; +import java.util.List; + import net.sf.ehcache.Ehcache; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProvider; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; @@ -64,16 +68,30 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi return AbstractCodeDataProvider.initCodeGrant(reg, codeLifetime); } +public List getCodeGrants() { +List keys = CastUtils.cast(codeGrantCache.getKeys()); +List grants = +new ArrayList(keys.size()); +for (String key : keys) { +grants.add(getCodeGrant(key)); +} +
cxf git commit: Some PMD updates
Repository: cxf Updated Branches: refs/heads/master cf34dcfc9 -> f0c825245 Some PMD updates Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f0c82524 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f0c82524 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f0c82524 Branch: refs/heads/master Commit: f0c825245164f3368d8fbef360c491fd77bb7181 Parents: cf34dcf Author: Colm O hEigeartaighAuthored: Wed Dec 23 11:18:49 2015 + Committer: Colm O hEigeartaigh Committed: Wed Dec 23 11:18:49 2015 + -- .../cxf/attachment/AttachmentDeserializer.java | 6 +-- .../apache/cxf/attachment/AttachmentUtil.java | 4 +- .../apache/cxf/bus/blueprint/BlueprintBus.java | 4 -- .../org/apache/cxf/bus/spring/SpringBus.java| 4 -- .../cxf/common/injection/ResourceInjector.java | 8 ++-- .../org/apache/cxf/common/util/CacheMap.java| 2 +- .../configuration/ConfiguredBeanLocator.java| 2 +- .../jsse/TLSParameterJaxBUtils.java | 12 ++--- .../org/apache/cxf/endpoint/EndpointImpl.java | 14 +- .../org/apache/cxf/helpers/ServiceUtils.java| 6 +-- .../AbstractAttributedInterceptorProvider.java | 2 +- .../AbstractOutDatabindingInterceptor.java | 3 +- .../cxf/interceptor/AnnotationInterceptors.java | 2 +- .../cxf/interceptor/FIStaxOutInterceptor.java | 4 +- .../cxf/interceptor/StaxOutInterceptor.java | 7 +-- .../apache/cxf/service/ServiceModelVisitor.java | 4 +- .../factory/AnnotationsFactoryBeanListener.java | 4 +- .../invoker/spring/SpringBeanFactory.java | 2 +- .../cxf/staxutils/W3CDOMStreamReader.java | 5 -- .../staxutils/transform/InTransformReader.java | 4 +- .../apache/cxf/ws/addressing/ContextUtils.java | 8 +--- .../ws/addressing/EndpointReferenceUtils.java | 2 +- .../cxf/ws/addressing/VersionTransformer.java | 2 +- .../cxf/bus/extension/ExtensionManagerTest.java | 2 +- .../cxf/bus/osgi/OSGiBusListenerTest.java | 8 ++-- .../common/injection/ResourceInjectorTest.java | 2 - .../spring/ConfigurerImplTest.java | 48 ++-- .../common/gzip/GZIPAcceptEncodingTest.java | 14 +++--- .../cxf/tools/common/VelocityGenerator.java | 4 +- .../common/dom/ExtendedDocumentBuilder.java | 4 +- .../cxf/tools/common/model/JavaMethod.java | 2 +- .../common/toolspec/DummyToolContainer.java | 6 +-- 32 files changed, 94 insertions(+), 107 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f0c82524/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index 5bf78d1..8d54660 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -184,7 +184,7 @@ public class AttachmentDeserializer { if (body instanceof DelegatingInputStream && !((DelegatingInputStream) body).isClosed()) { -cache((DelegatingInputStream) body, true); +cache((DelegatingInputStream) body); } List atts = new ArrayList(attachments.getLoadedAttachments()); @@ -196,14 +196,14 @@ public class AttachmentDeserializer { ads.cache(message); } } else if (s.getInputStream() instanceof DelegatingInputStream) { -cache((DelegatingInputStream) s.getInputStream(), false); +cache((DelegatingInputStream) s.getInputStream()); } else { //assume a normal stream that is already cached } } } -private void cache(DelegatingInputStream input, boolean deleteOnClose) throws IOException { +private void cache(DelegatingInputStream input) throws IOException { if (loaded.contains(input)) { return; } http://git-wip-us.apache.org/repos/asf/cxf/blob/f0c82524/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index ec3407a..5950d6c 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -156,7 +156,7 @@ public final class AttachmentUtil { } public static boolean isMtomEnabled(Message message) { -Object prop =