You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "coheigea (via GitHub)" <gi...@apache.org> on 2026/09/09 15:01:55 UTC

[PR] Fix encrypted properties tests to work with WSS4J 4.0.2 [cxf]

coheigea opened a new pull request, #3458:
URL: https://github.com/apache/cxf/pull/3458

   The Jasypt algorithm changed, for now we'll just use the old encrypted values in the CXF tests until we pick up WSS4J 4.0.2 properly.


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix encrypted properties tests to work with WSS4J 4.0.2 [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on code in PR #3458:
URL: https://github.com/apache/cxf/pull/3458#discussion_r3971153550


##########
systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java:
##########
@@ -246,25 +246,32 @@ public void testEncryptedPassword() throws Exception {
             return;
         }
 
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = ActionTest.class.getResource(
-                      JavaUtils.isFIPSEnabled() 
-                      ? "client-fips.xml" : "client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        BusFactory.setDefaultBus(bus);
-        BusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-        QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPasswordPort");
-        DoubleItPortType port =
-                service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        assertEquals(50, port.doubleIt(25));
-
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
+        try {
+            if (!JavaUtils.isFIPSEnabled()) {

Review Comment:
   @coheigea may I suggest please to have two independent test runs in Maven, non-FIPs as defaut:
   
   ```
   <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <executions>
                       <execution>
                           <id>default-test</id>
                           <configuration>
                               <systemPropertyVariables>
   <org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>true</org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>
                               </systemPropertyVariables>
                           </configuration>
                       </execution>
   </plugin>
   ```
   
   And FIPS one:
   
   ```
   <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
   
                       <execution>
                           <id>fips-test</id>
                           <goals>
                               <goal>test</goal>
                           </goals>
                           <configuration>
                               <systemPropertyVariables>
                                   <org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>false</org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm>
                               </systemPropertyVariables>
                           </configuration>
                       </execution>
                   </executions>
               </plugin>
   ```
   
   More than happy to help with that, it is very difficult to eliminate side effects of system properties in tests, thank you. 



-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix encrypted properties tests to work with WSS4J 4.0.2 [cxf]

Posted by "coheigea (via GitHub)" <gi...@apache.org>.
coheigea commented on code in PR #3458:
URL: https://github.com/apache/cxf/pull/3458#discussion_r3975999597


##########
systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java:
##########
@@ -246,25 +246,32 @@ public void testEncryptedPassword() throws Exception {
             return;
         }
 
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = ActionTest.class.getResource(
-                      JavaUtils.isFIPSEnabled() 
-                      ? "client-fips.xml" : "client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        BusFactory.setDefaultBus(bus);
-        BusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-        QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPasswordPort");
-        DoubleItPortType port =
-                service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        assertEquals(50, port.doubleIt(25));
-
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
+        try {
+            if (!JavaUtils.isFIPSEnabled()) {

Review Comment:
   @reta This is pretty complicated though for something I plan to remove once we pick up WSS4J 4.0.2 - I will convert the non-fIPS cases to the same algorithm that the FIPS case currently uses. The current code is just to tide us over so that I can compile the CXF main code with both versions of WSS4J for testing.



-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix encrypted properties tests to work with WSS4J 4.0.2 [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on code in PR #3458:
URL: https://github.com/apache/cxf/pull/3458#discussion_r3978447415


##########
systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java:
##########
@@ -246,25 +246,32 @@ public void testEncryptedPassword() throws Exception {
             return;
         }
 
-        SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = ActionTest.class.getResource(
-                      JavaUtils.isFIPSEnabled() 
-                      ? "client-fips.xml" : "client.xml");
-
-        Bus bus = bf.createBus(busFile.toString());
-        BusFactory.setDefaultBus(bus);
-        BusFactory.setThreadDefaultBus(bus);
-
-        URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
-        Service service = Service.create(wsdl, SERVICE_QNAME);
-        QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPasswordPort");
-        DoubleItPortType port =
-                service.getPort(portQName, DoubleItPortType.class);
-        updateAddressPort(port, PORT);
-        assertEquals(50, port.doubleIt(25));
-
-        ((java.io.Closeable)port).close();
-        bus.shutdown(true);
+        try {
+            if (!JavaUtils.isFIPSEnabled()) {

Review Comment:
   Oh I see, thanks @coheigea , if that is temporary - non-issue



-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix encrypted properties tests to work with WSS4J 4.0.2 [cxf]

Posted by "coheigea (via GitHub)" <gi...@apache.org>.
coheigea merged PR #3458:
URL: https://github.com/apache/cxf/pull/3458


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org