You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/02/17 18:36:25 UTC

[cxf] branch 3.2.x-fixes updated (9e431cf -> e46201d)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 9e431cf  Updating Brave OSGi sample README file
     new ef22e75  Cxf 8208 - Handle exceptions when looking up swagger ui resources (#637)
     new e46201d  Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                      | 12 ++++++++
 rt/rs/description-swagger-ui/pom.xml               |  5 +++
 .../jaxrs/swagger/ui/SwaggerUiResourceLocator.java |  8 ++++-
 .../swagger/ui/SwaggerUIResourceLocatorTest.java   | 36 ++++++++++++----------
 4 files changed, 44 insertions(+), 17 deletions(-)
 copy systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/htrace/IsTimelineEmpty.java => rt/rs/description-swagger-ui/src/test/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUIResourceLocatorTest.java (55%)


[cxf] 01/02: Cxf 8208 - Handle exceptions when looking up swagger ui resources (#637)

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ef22e75d168654144d15426153f5c8891a2b1f7b
Author: Nate Chadwick <na...@gmail.com>
AuthorDate: Mon Feb 17 12:40:59 2020 -0500

    Cxf 8208 - Handle exceptions when looking up swagger ui resources (#637)
    
    * Fix condition where swaggerui resource would fail requests with special
    characters. add test CXF-8208
    
    * CXF-8208 add junit, fix exception handler
    
    * Specify IllegalArgumentException
    
    * Remove try catch - add expected.
    
    * Update SwaggerUiResourceLocator.java
    
    Removed unneeded import.
    
    * Update SwaggerUIResourceLocatorTest.java
    
    Co-authored-by: Colm O hEigeartaigh <co...@users.noreply.github.com>
    (cherry picked from commit 2a6b7327c584b6394a795c26c9cb7897900dcf63)
    (cherry picked from commit 97c854bbe30a77b4925704f59b187158054296bf)
---
 rt/rs/description-swagger-ui/pom.xml               |  5 +++
 .../jaxrs/swagger/ui/SwaggerUiResourceLocator.java |  8 +++-
 .../swagger/ui/SwaggerUIResourceLocatorTest.java   | 43 ++++++++++++++++++++++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/rt/rs/description-swagger-ui/pom.xml b/rt/rs/description-swagger-ui/pom.xml
index 464153c..ed5fea9a 100644
--- a/rt/rs/description-swagger-ui/pom.xml
+++ b/rt/rs/description-swagger-ui/pom.xml
@@ -51,5 +51,10 @@
             <scope>provided</scope>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResourceLocator.java b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResourceLocator.java
index 45da62d..6c396dd 100644
--- a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResourceLocator.java
+++ b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResourceLocator.java
@@ -50,8 +50,14 @@ public class SwaggerUiResourceLocator {
         if (resourcePath.startsWith("/")) {
             resourcePath = resourcePath.substring(1);
         }
+        URL ret;
 
-        return URI.create(swaggerUiRoot + resourcePath).toURL();
+        try {
+            ret = URI.create(swaggerUiRoot + resourcePath).toURL();
+        } catch (IllegalArgumentException ex) {
+            throw new MalformedURLException(ex.getMessage());
+        }
+        return ret;
     }
 
     /**
diff --git a/rt/rs/description-swagger-ui/src/test/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUIResourceLocatorTest.java b/rt/rs/description-swagger-ui/src/test/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUIResourceLocatorTest.java
new file mode 100644
index 0000000..198127e
--- /dev/null
+++ b/rt/rs/description-swagger-ui/src/test/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUIResourceLocatorTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.jaxrs.swagger.ui;
+
+import java.net.MalformedURLException;
+
+import org.junit.Test;
+
+
+
+public class SwaggerUIResourceLocatorTest {
+
+    @Test(expected = MalformedURLException.class)
+    public void testLocateWithBadCharactersInUrl() throws MalformedURLException {
+        String url =
+                "jar:file:/Volumes/bigdrive/test157/jetty/base/webapps/"
+                + "Rhythmyx/WEB-INF/lib/swagger-ui-2.2.10-1.jar!/META-INF/resources/"
+                + "webjars/swagger-ui/2.2.10-1/assets/by-path//Assets/uploads/"
+                + "Screen Shot 2020-02-05 at 10.50.53 AM.png";
+
+        SwaggerUiResourceLocator locator = new SwaggerUiResourceLocator("/");
+
+        locator.locate(url);
+        
+    }
+}


[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit e46201dd9bd2b9f4dc3e0bc3b0db5e3125374295
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Feb 17 18:36:08 2020 +0000

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 057a426..971e9ed 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -8,6 +8,7 @@ B 010e9f4229db061d6b3c482ae923a0fd5651b6fe
 B 015456f5d4d18e8e0edfe900b8142b3b5b48fcbc
 B 01559f20020110407ceb142e4ec53eaddcaeb9d4
 B 01562909cf61934bd6e40a4e122cfaf3623e7dd1
+B 018d555248d9dab9d98743d7edf3dfbcd0c2ca3c
 B 01c52215559ada81f7cfbb4ff403c628b7fa2c9e
 B 0248255bb87dbcbe3b2292fec6b1159476bd78b3
 B 02662d7bece8384b265705d4704734fa55022144
@@ -80,6 +81,7 @@ B 1a1f76c5cfd7d9dfbb3334cd9ba2b4dbdf170ef7
 B 1a321e2d766087025cabd339a4e13643833c1a56
 B 1b46339f841756b35846c1389860ee615ba91ddf
 B 1bece4e52d9fde576b34883fbabe5ef07fc7db2e
+B 1bf982f9d91bd112a6266a0783408193eca0e64c
 B 1cbe0268c1c428717ad8215363ec06c08ee462b7
 B 1cfdb42724549fdef21a9d50d62cd9dbdc5d8dd3
 B 1d1694a70c22d5dff10aebdae588d3dd1aff25e1
@@ -150,6 +152,7 @@ B 2e6a14e5ea087eb599415980d21861313f333583
 B 2f193c43cfded7020733cd874c6428fe7a35ab02
 B 2fad69a02a19773bdb6ca1261bc7bc3f1864e685
 B 2fb9f9835cbd678f5c9028ea33b131b6b6a90aa0
+B 2feebc95ad5bb522864aa2b06b5e2a0e0526e550
 B 310aa9a2c0589c12ba3baa1556da193054e505c6
 B 3117e62c01ca9fa10fec395304bde3723c67e16b
 B 319093538ca614e51da87ca52df85d83093b962b
@@ -301,6 +304,7 @@ B 5a72b4170110d58fb6186fd7ce9f5339b9550f5e
 B 5b11f39743278a06fdf174e89b0178a7f9d86fbb
 B 5b2f078eda2ede0f6afb12b146869403c1c2d3fb
 B 5b8d565e424db6413d2e6ab92d2d59a63ba6bc92
+B 5bb410221e835957777f84312eda792ca55131ef
 B 5c1270a27b6b2547ed614b17f7956b1e55712a93
 B 5c142443d8a9f6e7adae5668a5b5beaa0599fb7f
 B 5c4d446b66597dde2bf70e8971112547273bbf29
@@ -423,6 +427,7 @@ B 828911c241ce808a65ed04ea1e0a021b6fdb2582
 B 8296397fd4125f91e8d56a044f4680c91aae78d6
 B 82b163f267090d62422c6416dd5ce82e0055b4ec
 B 82f8588e77e26b6fc0ea637fedcb5d8e33de21a9
+B 831c1ff4b58406be9c26f59db8acc8e7acdcff36
 B 8366b727004fc405b59542ce4c421059ecb0b554
 B 8388f9ef0aea91a98ec89a68e5e4c2c16849b983
 B 83e40c9e314cadbdb0e464d6a8828ef72f87d671
@@ -482,8 +487,10 @@ B 9893bdd40b539bb37a17933b5334fc43ff511d66
 B 98edc71f3b8690ce694327673c3e7a15d1be798a
 B 98eeb6b937f41006b4368d929f066bc61644d7c5
 B 99491e0ce0bddc0c6cf80aea4168c476b4107570
+B 9987ba3645d65d119b45913e83bf34deab7909f6
 B 9991fa7b918e8a82a172f988684258ca03874737
 B 9ad086a42f9758cb9bfbb8e66ec99d4f339c481f
+B 9ad3799645e1faeb82c4a0c361a1febd5dd0246a
 B 9beabe7ba8bcc50a2e732ce456da700a33c74bb4
 B 9bf7601d47f4ff7830f349dd5e59ef28c25e6f15
 B 9c5e79b74fa332c5b725a32122fd9de8adba8bca
@@ -601,6 +608,7 @@ B c09877e9773d5a4b5737930a348ce9f13e48df42
 B c0e7ca85c00f4ab6ce4ef87ecc6dd777d744e71b
 B c186d6ad03df4cf75fe46f25ada48870f430ddea
 B c19b382995dce13ded39d9cd5ea70a24a48db380
+B c275d73b5d87f41faf272791e7470e1ce1bc3d08
 B c2c912024f22d498e343bbd52e57a65f3fd4a1b8
 B c2d9000c1872973d4ad6e30075d320da167d3c2d
 B c2ebc2870ebd11a021277c450876bb79d0e78b6f
@@ -654,6 +662,7 @@ B cde58adaabf5f10847f18a9d37361153b0ac7cac
 B ce6419a07249005c4503bda59289054e6fc42576
 B ce8a7729a6db509d2bcb57d73a0a634c675b1230
 B ced81577a753b150e7afab30e3ddaeb44659221f
+B cf16e7b24837d6fb6d1a6a56730b34c40e464163
 B cf3ac555a69d37970325035f774f1c9a99502f35
 B cfab2ec2eced0dc0b026bc4bfbeeb18fff28e1b6
 B cfbaffccc6108173d407f705f127c8d628c0da25
@@ -755,6 +764,7 @@ B f07cdf287f5324b4d22560fbc549bbe365b6149d
 B f0924a930ef73aeb5cf33b71667c870bd444207c
 B f0b60da47e8a1430444551daf970c820101f516a
 B f14837323a9de0f9bc785215ea54879b1b6eb416
+B f18b1bc03a985b94d6f3cad0f0fbd01bd34ba82a
 B f1d8c5f4d74f96cc17c30a891760735871366538
 B f1f678bd62fa3c7b21d71368f47b4bcbad56d519
 B f207b9b61df62855ba34dc8c418bd68b909dcacc
@@ -841,6 +851,7 @@ M 402f771fa81e4c94d63f53dbc5ea77eef7b4fcb7
 M 40ecbe0ca38cd14576e967cf70bddfecdc059c28
 M 4233f9138de22fe5de555d2f176e494e62905de5
 M 427c7d40f35427a0866b6b9989d50a34fd10482b
+M 431bf666e8810c87ab5f47b0c137d329d381b1c6
 M 48869dd57d54650615ed1347d9aa44ae76e88265
 M 48c48f1c3edcca07365145df38a71ee6586070b8
 M 4a07401299848a1d9b54346b6827132cdf5ec80b
@@ -934,6 +945,7 @@ M e0957d83bb65f2ddd36e4c6a49ef1ca3b68581ca
 M e60e8ab5d7414a0dc581c5666873e1ab0413b107
 M eaa14b96ea5275ff9ee27cf937cd498ca3dcd47f
 M eadcdb008e115db7bb8e0664c20417eb7c4f0dfc
+M eb0855b8613823682cf267e1de457b8670be9b7b
 M eda37b0df9af9df3df8378c744900b75cbbac6e5
 M ee94d2d2d5a39836ef94f74892ccec2212411e6a
 M efb2c3082fe8799a9d90a696e31239551b4f1823