Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 15c7bcde4 -> 30e2b03d1
Making it possible for to run XMLSec in interceptors as JAXRS client response filters Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/516f8cbe Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/516f8cbe Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/516f8cbe Branch: refs/heads/3.1.x-fixes Commit: 516f8cbe28b6fa73969bdcf96f447a675fafe023 Parents: 15c7bcd Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Mon Mar 27 17:18:16 2017 +0100 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Mon Mar 27 17:24:03 2017 +0100 ---------------------------------------------------------------------- .../security/xml/ClientXmlEncInterceptor.java | 36 ++++++++++++++++++++ .../security/xml/ClientXmlSecInInterceptor.java | 36 ++++++++++++++++++++ 2 files changed, 72 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/516f8cbe/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlEncInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlEncInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlEncInterceptor.java new file mode 100644 index 0000000..1cfa36e --- /dev/null +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlEncInterceptor.java @@ -0,0 +1,36 @@ +/** + * 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. + */ +package org.apache.cxf.rs.security.xml; + +import java.io.IOException; + +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientResponseContext; +import javax.ws.rs.client.ClientResponseFilter; + +import org.apache.cxf.jaxrs.utils.JAXRSUtils; + +public class ClientXmlEncInterceptor extends XmlEncInInterceptor implements ClientResponseFilter { + + @Override + public void filter(ClientRequestContext reqCtx, ClientResponseContext respCtx) throws IOException { + handleMessage(JAXRSUtils.getCurrentMessage()); + } + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/516f8cbe/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlSecInInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlSecInInterceptor.java new file mode 100644 index 0000000..f270d1b --- /dev/null +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/ClientXmlSecInInterceptor.java @@ -0,0 +1,36 @@ +/** + * 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. + */ +package org.apache.cxf.rs.security.xml; + +import java.io.IOException; + +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientResponseContext; +import javax.ws.rs.client.ClientResponseFilter; + +import org.apache.cxf.jaxrs.utils.JAXRSUtils; + +public class ClientXmlSecInInterceptor extends XmlSecInInterceptor implements ClientResponseFilter { + + @Override + public void filter(ClientRequestContext reqCtx, ClientResponseContext respCtx) throws IOException { + handleMessage(JAXRSUtils.getCurrentMessage()); + } + +}