You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ffang (via GitHub)" <gi...@apache.org> on 2023/04/11 19:25:39 UTC
[GitHub] [camel-quarkus] ffang opened a new pull request, #4758: #4291 avoid In/Out Message soap headers conflict
ffang opened a new pull request, #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758
<!-- Uncomment and fill this section if your PR is not trivial
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1504980922
Replacing by https://github.com/apache/camel-quarkus/pull/4761 where the failure in CxfWsTrustIT.programmaticSts() is fixed via QCXF 2.0.0.CR1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "aldettinger (via GitHub)" <gi...@apache.org>.
aldettinger commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1504828398
Maybe this one will need to be backported to 2.13.x before release too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ffang commented on a diff in pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ffang (via GitHub)" <gi...@apache.org>.
ffang commented on code in PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#discussion_r1164252708
##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/src/main/java/org/apache/camel/quarkus/component/cxf/soap/securitypolicy/server/it/WsSecurityPolicyServerRoutes.java:
##########
@@ -19,20 +19,25 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
import org.apache.cxf.ext.logging.LoggingFeature;
+import org.apache.cxf.headers.Header;
@ApplicationScoped
public class WsSecurityPolicyServerRoutes extends RouteBuilder {
@Override
public void configure() {
- from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO")
- .log("exchange: ${exchange}")
- .setBody(exchange -> "Secure good morning " + exchange.getMessage().getBody(String.class));
-
+ from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO").process(new Processor() {
+ public void process(final Exchange exchange) throws Exception {
+ exchange.getIn().removeHeader(Header.HEADER_LIST);
Review Comment:
Hi @ppalaga ,
HEADER_LIST in Camel message is from the CXF message out-of-band soap headers(out-of-band means the soap headers are not in the wsdl operation definition, and the ws-security related soap headers are out-of-band ones).
The problem is that, as the test simply verify the camel-cxf consumer endpoint with ws-security checks and then in the camel router itself it set the response body, and in camel-cxf, "SOAP headers are propagated to and from Camel Message headers", so for the returned CXF message, we need to ensure we remove unnecessary HEADER_LIST from camel message before creating soap message(CxfHeaderFilterStrategy can do the similar work but in this test a simple removeHeader should be sufficient).
The original error is that the incoming ws-security headers was sent back with outgoing cxf message, that's why we see double Timestamps, actually, it was worse as it sent back everything back from incoming ws-security headers(the saml2 token, the encrytion, the signature, etc)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "zbendhiba (via GitHub)" <gi...@apache.org>.
zbendhiba commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1505209273
Thanks @ffang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1504002472
I have restarted the failing CI jobs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1504890528
I am working on a fix for the failure in CxfWsTrustIT.programmaticSts()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga closed pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga closed pull request #4758: #4291 avoid In/Out Message soap headers conflict
URL: https://github.com/apache/camel-quarkus/pull/4758
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on a diff in pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on code in PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#discussion_r1163259818
##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/src/main/java/org/apache/camel/quarkus/component/cxf/soap/securitypolicy/server/it/WsSecurityPolicyServerRoutes.java:
##########
@@ -19,20 +19,25 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
import org.apache.cxf.ext.logging.LoggingFeature;
+import org.apache.cxf.headers.Header;
@ApplicationScoped
public class WsSecurityPolicyServerRoutes extends RouteBuilder {
@Override
public void configure() {
- from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO")
- .log("exchange: ${exchange}")
- .setBody(exchange -> "Secure good morning " + exchange.getMessage().getBody(String.class));
-
+ from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO").process(new Processor() {
+ public void process(final Exchange exchange) throws Exception {
+ exchange.getIn().removeHeader(Header.HEADER_LIST);
Review Comment:
@ffang could you please shed some light on where this HEADER_LIST is coming from and why we need to remove it to fix #4291
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#issuecomment-1504889906
> Maybe this one will need to be backported to 2.13.x before release too.
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on a diff in pull request #4758: #4291 avoid In/Out Message soap headers conflict
Posted by "ppalaga (via GitHub)" <gi...@apache.org>.
ppalaga commented on code in PR #4758:
URL: https://github.com/apache/camel-quarkus/pull/4758#discussion_r1168439507
##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/src/main/java/org/apache/camel/quarkus/component/cxf/soap/securitypolicy/server/it/WsSecurityPolicyServerRoutes.java:
##########
@@ -19,20 +19,25 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
import org.apache.cxf.ext.logging.LoggingFeature;
+import org.apache.cxf.headers.Header;
@ApplicationScoped
public class WsSecurityPolicyServerRoutes extends RouteBuilder {
@Override
public void configure() {
- from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO")
- .log("exchange: ${exchange}")
- .setBody(exchange -> "Secure good morning " + exchange.getMessage().getBody(String.class));
-
+ from("cxf:bean:wsSecurityPolicyHelloService?dataFormat=POJO").process(new Processor() {
+ public void process(final Exchange exchange) throws Exception {
+ exchange.getIn().removeHeader(Header.HEADER_LIST);
Review Comment:
Great, thanks for the clarification @ffang!
So similarly written route would also fail on CSB and there is nothing Camel Quarkus specifix about the failure. Nice to know, thanks a lot!
It sounds like this could happen to any user writing a new route using WS-Security/WS-SecurityPolicy. I wonder whether there is way to improve the default behavior? Shouldn't perhaps the security headers be filtered by default? Or wouldn't it be better not to propagate the headers by default unless the user sets the CxfHeaderFilterStrategy (thus giving a sign that he knows what he does)? If changing the code is not feasible, should we not warn about this in the documentation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org