This is an automated email from the ASF dual-hosted git repository.
vavrtom pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git
The following commit(s) were added to refs/heads/main by this push:
new 19cffbcf44 QPID-8685: [Broker-J] Update to Jetty 12 (#288)
19cffbcf44 is described below
commit 19cffbcf4466066c9ff76922ddb6b7bdf08cd9fc
Author: Daniil Kirilyuk <[email protected]>
AuthorDate: Mon Jun 30 11:25:17 2025 +0200
QPID-8685: [Broker-J] Update to Jetty 12 (#288)
* QPID-8685 - [Broker-J] Update to Jetty 12
* QPID-8685: [Broker-J] Added EPL 2.0 license for jakarta.servlet-api to
LICENSE file
---------
Co-authored-by: vavrtom <[email protected]>
---
apache-qpid-broker-j/src/main/assembly/LICENSE | 284 +++++++++++++++++++++
.../dependency-verification/DEPENDENCIES_REFERENCE | 50 ++--
broker-core/pom.xml | 5 +-
.../SimpleLDAPAuthenticationManagerTest.java | 25 +-
.../manager/oauth2/OAuth2MockEndpointHolder.java | 34 ++-
broker-plugins/management-http/pom.xml | 9 +-
.../server/management/plugin/HttpManagement.java | 206 ++++++++-------
.../plugin/HttpManagementConfiguration.java | 11 +-
.../management/plugin/HttpManagementUtil.java | 3 +-
broker-plugins/websocket/pom.xml | 10 +-
.../transport/websocket/WebSocketProvider.java | 137 +++++-----
...ava-Broker-Management-Managing-Plugins-HTTP.xml | 6 +
pom.xml | 41 ++-
.../resources/config-http-management-tests.json | 3 +-
.../extensions/sasl/AuthenticationTest.java | 25 +-
systests/systests-utils/pom.xml | 4 +
.../qpid/tests/utils/OAuth2MockEndpointHolder.java | 34 ++-
17 files changed, 612 insertions(+), 275 deletions(-)
diff --git a/apache-qpid-broker-j/src/main/assembly/LICENSE
b/apache-qpid-broker-j/src/main/assembly/LICENSE
index 8b60789871..d13225c7ac 100644
--- a/apache-qpid-broker-j/src/main/assembly/LICENSE
+++ b/apache-qpid-broker-j/src/main/assembly/LICENSE
@@ -598,3 +598,287 @@ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER
DEALINGS IN THE SOFTWARE.
+
+###############################################
+
+This product bundles the jakarta.servlet-api jar which is under
+the "Eclipse Public License - v 2.0":
+
+Eclipse Public License - v 2.0
+******************************
+
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+ i) changes to the Program, and
+ ii) additions to the Program;
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ "originates" from a Contributor if it was added to the Program by
+ such Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+
+"Contributor" means any person or entity that Distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which
+are necessarily infringed by the use or sale of its Contribution alone
+or when combined with the Program.
+
+"Program" means the Contributions Distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement
+or any Secondary License (as applicable), including Contributors.
+
+"Derivative Works" shall mean any work, whether in Source Code or other
+form, that is based on (or derived from) the Program and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship.
+
+"Modified Works" shall mean any work in Source Code or other form that
+results from an addition to, deletion from, or modification of the
+contents of the Program, including, for purposes of clarity any new file
+in Source Code form that contains any contents of the Program. Modified
+Works shall not include works that contain only declarations,
+interfaces, types, classes, structures, or files of the Program solely
+in each case in order to link to, bind by name, or subclass the Program
+or Modified Works thereof.
+
+"Distribute" means the acts of a) distributing or b) making available
+in any manner that enables the transfer of a copy.
+
+"Source Code" means the form of a Program preferred for making
+modifications, including but not limited to software source code,
+documentation source, and configuration files.
+
+"Secondary License" means either the GNU General Public License,
+Version 2.0, or any later versions of that license, including any
+exceptions or additional permissions as identified by the initial
+Contributor.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if, at
+ the time the Contribution is added by the Contributor, such addition
+ of the Contribution causes such combination to be covered by the
+ Licensed Patents. The patent license shall not apply to any other
+ combinations which include the Contribution. No hardware per se is
+ licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the
+ rights and licenses granted hereunder, each Recipient hereby
+ assumes sole responsibility to secure any other intellectual
+ property rights needed, if any. For example, if a third party
+ patent license is required to allow Recipient to Distribute the
+ Program, it is Recipient's responsibility to acquire that license
+ before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has
+ sufficient copyright rights in its Contribution, if any, to grant
+ the copyright license set forth in this Agreement.
+
+ e) Notwithstanding the terms of any Secondary License, no
+ Contributor makes additional grants to any Recipient (other than
+ those set forth in this Agreement) as a result of such Recipient's
+ receipt of the Program under the terms of a Secondary License
+ (if permitted under the terms of Section 3).
+
+3. REQUIREMENTS
+
+3.1 If a Contributor Distributes the Program in any form, then:
+
+ a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including
+ warranties or conditions of title and non-infringement, and
+ implied warranties or conditions of merchantability and fitness
+ for a particular purpose;
+
+ ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special,
+ incidental and consequential damages, such as lost profits;
+
+ iii) does not attempt to limit or alter the recipients' rights
+ in the Source Code under section 3.2; and
+
+ iv) requires any subsequent distribution of the Program by any
+ party to be under a license that satisfies the requirements
+ of this section 3.
+
+3.2 When the Program is Distributed as Source Code:
+
+ a) it must be made available under this Agreement, or if the
+ Program (i) is combined with other material in a separate file or
+ files made available under a Secondary License, and (ii) the initial
+ Contributor attached to the Source Code the notice described in
+ Exhibit A of this Agreement, then the Program may be made available
+ under the terms of such Secondary Licenses, and
+
+ b) a copy of this Agreement must be included with each copy of
+ the Program.
+
+3.3 Contributors may not remove or alter any copyright, patent,
+trademark, attribution notices, disclaimers of warranty, or limitations
+of liability ("notices") contained within the Program from any copy of
+the Program which they Distribute, provided that Contributors may add
+their own appropriate notices.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities
+with respect to end users, business partners and the like. While this
+license is intended to facilitate the commercial use of the Program,
+the Contributor who includes the Program in a commercial product
+offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes
+the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and indemnify every
+other Contributor ("Indemnified Contributor") against any losses,
+damages and costs (collectively "Losses") arising from claims, lawsuits
+and other legal actions brought by a third party against the Indemnified
+Contributor to the extent caused by the acts or omissions of such
+Commercial Contributor in connection with its distribution of the Program
+in a commercial product offering. The obligations in this section do not
+apply to any claims or Losses relating to any actual or alleged
+intellectual property infringement. In order to qualify, an Indemnified
+Contributor must: a) promptly notify the Commercial Contributor in
+writing of such claim, and b) allow the Commercial Contributor to control,
+and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may
+participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those performance
+claims and warranties, and if a court requires any other Contributor to
+pay any damages as a result, the Commercial Contributor must pay
+those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
+PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
+BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
+TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
+PURPOSE. Each Recipient is solely responsible for determining the
+appropriateness of using and distributing the Program and assumes all
+risks associated with its exercise of rights under this Agreement,
+including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs
+or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
+PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
+SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other software
+or hardware) infringes such Recipient's patent(s), then such Recipient's
+rights granted under Section 2(b) shall terminate as of the date such
+litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign the
+responsibility to serve as the Agreement Steward to a suitable separate
+entity. Each new version of the Agreement will be given a distinguishing
+version number. The Program (including Contributions) may always be
+Distributed subject to the version of the Agreement under which it was
+received. In addition, after a new version of the Agreement is published,
+Contributor may elect to Distribute the Program (including its
+Contributions) under the new version.
+
+Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+receives no rights or licenses to the intellectual property of any
+Contributor under this Agreement, whether expressly, by implication,
+estoppel or otherwise. All rights in the Program not expressly granted
+under this Agreement are reserved. Nothing in this Agreement is intended
+to be enforceable by any entity that is not a Contributor or Recipient.
+No third-party beneficiary rights are created under this Agreement.
+
+Exhibit A - Form of Secondary Licenses Notice
+
+"This Source Code may also be made available under the following
+Secondary Licenses when the conditions for such availability set forth
+in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+version(s), and exceptions or additional permissions here}."
+
+ Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+
+ If it is not possible or desirable to put the notice in a particular
+ file, then You may include the notice in a location (such as a LICENSE
+ file in a relevant directory) where a recipient would be likely to
+ look for such a notice.
+
+ You may add additional accurate notices of copyright ownership.
diff --git
a/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
b/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
index c6cf4508dd..eec4934e9d 100644
---
a/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
+++
b/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
@@ -75,6 +75,13 @@ From: 'Apache Software Foundation' (http://db.apache.org/)
License: Apache 2 (http://www.apache.org/licenses/LICENSE-2.0.txt)
+From: 'Eclipse Foundation' (https://www.eclipse.org)
+
+ - Jakarta Servlet (https://projects.eclipse.org/projects/ee4j.servlet)
jakarta.servlet:jakarta.servlet-api:jar:6.0.0
+ License: EPL 2.0 (http://www.eclipse.org/legal/epl-2.0)
+ License: GPL2 w/ CPE (https://www.gnu.org/software/classpath/license.html)
+
+
From: 'FasterXML' (http://fasterxml.com/)
- Jackson-annotations (https://github.com/FasterXML/jackson)
com.fasterxml.jackson.core:jackson-annotations:jar:2.18.2
@@ -93,13 +100,6 @@ From: 'Google LLC' (http://www.google.com)
License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
-From: 'Mort Bay Consulting' (http://www.mortbay.com)
-
- - Jetty :: Jakarta Servlet API and Schemas for JPMS and OSGi
(https://eclipse.org/jetty/jetty-jakarta-servlet-api)
org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:jar:5.0.2
- License: Apache Software License - Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0)
- License: Eclipse Public License - Version 1.0
(http://www.eclipse.org/org/documents/epl-v10.php)
-
-
From: 'Oracle Corporation' (http://www.oracle.com/)
- je com.sleepycat:je:jar:7.4.5
@@ -227,67 +227,59 @@ From: 'The CometD Project' (https://cometd.org)
From: 'Webtide' (https://webtide.com)
- - Jetty :: Http Utility (https://jetty.org/jetty-http)
org.eclipse.jetty:jetty-http:jar:11.0.24
- License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
- License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
-
- - Jetty :: IO Utility (https://jetty.org/jetty-io)
org.eclipse.jetty:jetty-io:jar:11.0.24
- License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
- License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
-
- - Jetty :: Rewrite Handler (https://jetty.org/jetty-rewrite)
org.eclipse.jetty:jetty-rewrite:jar:11.0.24
+ - Core :: HTTP (https://jetty.org/jetty-core/jetty-http)
org.eclipse.jetty:jetty-http:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Security (https://jetty.org/jetty-security)
org.eclipse.jetty:jetty-security:jar:11.0.24
+ - Core :: IO (https://jetty.org/jetty-core/jetty-io)
org.eclipse.jetty:jetty-io:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Server Core (https://jetty.org/jetty-server)
org.eclipse.jetty:jetty-server:jar:11.0.24
+ - Core :: Rewrite (https://jetty.org/jetty-core/jetty-rewrite)
org.eclipse.jetty:jetty-rewrite:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Servlet Handling (https://jetty.org/jetty-servlet)
org.eclipse.jetty:jetty-servlet:jar:11.0.24
+ - Core :: Security (https://jetty.org/jetty-core/jetty-security)
org.eclipse.jetty:jetty-security:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Utility Servlets and Filters (https://jetty.org/jetty-servlets)
org.eclipse.jetty:jetty-servlets:jar:11.0.24
+ - Core :: Server (https://jetty.org/jetty-core/jetty-server)
org.eclipse.jetty:jetty-server:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Utilities (https://jetty.org/jetty-util)
org.eclipse.jetty:jetty-util:jar:11.0.24
+ - Core :: Sessions (https://jetty.org/jetty-core/jetty-session)
org.eclipse.jetty:jetty-session:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Webapp Application Support (https://jetty.org/jetty-webapp)
org.eclipse.jetty:jetty-webapp:jar:11.0.24
+ - Core :: Utilities (https://jetty.org/jetty-core/jetty-util)
org.eclipse.jetty:jetty-util:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: XML utilities (https://jetty.org/jetty-xml)
org.eclipse.jetty:jetty-xml:jar:11.0.24
+ - EE10 :: Servlet (https://jetty.org/jetty-ee10/jetty-ee10-servlet)
org.eclipse.jetty.ee10:jetty-ee10-servlet:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: Core :: Common
(https://jetty.org/websocket-parent/websocket-core-common)
org.eclipse.jetty.websocket:websocket-core-common:jar:11.0.24
+ - EE10 :: Websocket :: Jetty Server
(https://jetty.org/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-server)
org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-server:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: Core :: Server
(https://jetty.org/websocket-parent/websocket-core-server)
org.eclipse.jetty.websocket:websocket-core-server:jar:11.0.24
+ - EE10 :: Websocket :: Servlet
(https://jetty.org/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-servlet)
org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: org.eclipse.jetty.websocket :: API
(https://jetty.org/websocket-parent/websocket-jetty-api)
org.eclipse.jetty.websocket:websocket-jetty-api:jar:11.0.24
+ - Core :: Websocket :: Common
(https://jetty.org/jetty-core/jetty-websocket/jetty-websocket-core-common)
org.eclipse.jetty.websocket:jetty-websocket-core-common:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: org.eclipse.jetty.websocket :: Common
(https://jetty.org/websocket-parent/websocket-jetty-common)
org.eclipse.jetty.websocket:websocket-jetty-common:jar:11.0.24
+ - Core :: Websocket :: Server
(https://jetty.org/jetty-core/jetty-websocket/jetty-websocket-core-server)
org.eclipse.jetty.websocket:jetty-websocket-core-server:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: org.eclipse.jetty.websocket :: Server
(https://jetty.org/websocket-parent/websocket-jetty-server)
org.eclipse.jetty.websocket:websocket-jetty-server:jar:11.0.24
+ - Core :: Websocket :: Jetty API
(https://jetty.org/jetty-core/jetty-websocket/jetty-websocket-jetty-api)
org.eclipse.jetty.websocket:jetty-websocket-jetty-api:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
- - Jetty :: Websocket :: Servlet
(https://jetty.org/websocket-parent/websocket-servlet)
org.eclipse.jetty.websocket:websocket-servlet:jar:11.0.24
+ - Core :: Websocket :: Jetty Common
(https://jetty.org/jetty-core/jetty-websocket/jetty-websocket-jetty-common)
org.eclipse.jetty.websocket:jetty-websocket-jetty-common:jar:12.0.22
License: Eclipse Public License - Version 2.0
(https://www.eclipse.org/legal/epl-2.0/)
License: Apache Software License - Version 2.0
(https://www.apache.org/licenses/LICENSE-2.0)
diff --git a/broker-core/pom.xml b/broker-core/pom.xml
index 402f654087..80bb26a496 100644
--- a/broker-core/pom.xml
+++ b/broker-core/pom.xml
@@ -80,13 +80,12 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
- <version>${jetty-version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-servlet</artifactId>
<scope>test</scope>
</dependency>
diff --git
a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerTest.java
b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerTest.java
index 866ca8fb52..58b3e4bf53 100644
---
a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerTest.java
+++
b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerTest.java
@@ -151,7 +151,7 @@ public class SimpleLDAPAuthenticationManagerTest extends
UnitTestBase
public static final SystemPropertySetter SYSTEM_PROPERTY_SETTER = new
SystemPropertySetter();
private SimpleLDAPAuthenticationManager<?> _authenticationProvider;
- private SimpleKdcServer kerbyServer;
+ private static SimpleKdcServer kerbyServer;
@BeforeEach
public void setUp()
@@ -387,16 +387,19 @@ public class SimpleLDAPAuthenticationManagerTest extends
UnitTestBase
final LdapServer ldapServer = LDAP.getLdapServer();
final int port = ldapServer.getPort() + 1;
- kerbyServer = new SimpleKdcServer();
- kerbyServer.setKdcHost("localhost");
- kerbyServer.setKdcRealm("QPID.ORG");
- kerbyServer.setAllowTcp(true);
- kerbyServer.setAllowUdp(false);
- kerbyServer.setKdcTcpPort(port);
-
kerbyServer.setWorkDir(FileSystems.getDefault().getPath("target").toFile());
-
kerbyServer.getKdcConfig().setBoolean(KdcConfigKey.PA_ENC_TIMESTAMP_REQUIRED,
false);
- kerbyServer.init();
- kerbyServer.start();
+ if (kerbyServer == null)
+ {
+ kerbyServer = new SimpleKdcServer();
+ kerbyServer.setKdcHost("localhost");
+ kerbyServer.setKdcRealm("QPID.ORG");
+ kerbyServer.setAllowTcp(true);
+ kerbyServer.setAllowUdp(false);
+ kerbyServer.setKdcTcpPort(port);
+
kerbyServer.setWorkDir(FileSystems.getDefault().getPath("target").toFile());
+
kerbyServer.getKdcConfig().setBoolean(KdcConfigKey.PA_ENC_TIMESTAMP_REQUIRED,
false);
+ kerbyServer.init();
+ kerbyServer.start();
+ }
final String krb5confPath = createKrb5Conf(port);
SYSTEM_PROPERTY_SETTER.setSystemProperty("java.security.krb5.conf",
krb5confPath);
diff --git
a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2MockEndpointHolder.java
b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2MockEndpointHolder.java
index 33be9fd4b9..88d12b7602 100644
---
a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2MockEndpointHolder.java
+++
b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2MockEndpointHolder.java
@@ -30,20 +30,20 @@ import java.util.Map;
import javax.net.ssl.SSLEngine;
+import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.AbstractHandler;
-import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.apache.qpid.server.configuration.CommonProperties;
@@ -91,7 +91,10 @@ class OAuth2MockEndpointHolder
}
};
sslContextFactory.setKeyStorePassword(keyStorePassword);
-
sslContextFactory.setKeyStoreResource(Resource.newResource(keyStorePath));
+ try (final ResourceFactory.Closeable resourceFactory =
ResourceFactory.closeable())
+ {
+
sslContextFactory.setKeyStoreResource(resourceFactory.newResource(keyStorePath));
+ }
sslContextFactory.setKeyStoreType(keyStoreType);
// override default jetty excludes as valid IBM JDK are excluded
@@ -109,18 +112,20 @@ class OAuth2MockEndpointHolder
_connector = new ServerConnector(_server, sslContextFactory, new
HttpConnectionFactory(httpsConfig));
_connector.setPort(0);
_connector.setReuseAddress(true);
- _server.setHandler(new AbstractHandler()
+
+ final ServletContextHandler servletContextHandler = new
ServletContextHandler();
+ servletContextHandler.setContextPath("/");
+ _server.setHandler(servletContextHandler);
+
+ servletContextHandler.addServlet(new HttpServlet()
{
@Override
- public void handle(String target, Request baseRequest,
HttpServletRequest request,
- HttpServletResponse response) throws IOException
+ public void doGet(final HttpServletRequest request, final
HttpServletResponse response) throws IOException
{
- baseRequest.setHandled(true);
-
try
{
final OAuth2MockEndpoint
- mockEndpoint =
_endpoints.get(request.getPathInfo());
+ mockEndpoint =
_endpoints.get(request.getServletPath());
assertNotNull(mockEndpoint, String.format("Could not find
mock endpoint for request path '%s'",
request.getPathInfo()));
mockEndpoint.handleRequest(request, response);
@@ -132,7 +137,14 @@ class OAuth2MockEndpointHolder
.getBytes(OAuth2AuthenticationProviderImplTest.UTF8));
}
}
- });
+
+ @Override
+ public void doPost(final HttpServletRequest request, final
HttpServletResponse response) throws IOException
+ {
+ doGet(request, response);
+ }
+
+ }, "/");
_server.addConnector(_connector);
}
diff --git a/broker-plugins/management-http/pom.xml
b/broker-plugins/management-http/pom.xml
index 785898af46..7a94066431 100644
--- a/broker-plugins/management-http/pom.xml
+++ b/broker-plugins/management-http/pom.xml
@@ -53,13 +53,8 @@
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlets</artifactId>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-servlet</artifactId>
</dependency>
<dependency>
diff --git
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
index 89d56fc226..f650ed5ae9 100644
---
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
+++
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
@@ -21,12 +21,10 @@
package org.apache.qpid.server.management.plugin;
import java.io.IOException;
-import java.io.StringWriter;
import java.io.Writer;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
@@ -51,6 +49,10 @@ import jakarta.servlet.MultipartConfigElement;
import jakarta.servlet.http.HttpServletRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.eclipse.jetty.ee10.servlet.ErrorPageErrorHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHandler;
+import org.eclipse.jetty.http.HttpFields;
+import org.eclipse.jetty.http.UriCompliance;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.ssl.SslHandshakeListener;
import org.eclipse.jetty.rewrite.handler.CompactPathRule;
@@ -60,16 +62,16 @@ import org.eclipse.jetty.server.DetectorConnectionFactory;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.NetworkConnector;
+import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
-import org.eclipse.jetty.server.handler.ErrorHandler;
-import org.eclipse.jetty.servlet.FilterHolder;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.servlets.CrossOriginFilter;
+import org.eclipse.jetty.ee10.servlet.FilterHolder;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHolder;
+import org.eclipse.jetty.server.handler.CrossOriginHandler;
import org.eclipse.jetty.util.annotation.Name;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.ExecutorThreadPool;
@@ -151,7 +153,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
private static final String JSESSIONID_COOKIE_PREFIX = "JSESSIONID_";
private static final String[] STATIC_FILE_TYPES = { "*.js", "*.css",
"*.html", "*.png", "*.gif", "*.jpg",
- "*.jpeg", "*.json",
"*.txt", "*.xsl", "*.svg" };
+ "*.jpeg", "*.json", "*.txt", "*.xsl", "*.svg" };
private Server _server;
@@ -171,13 +173,13 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
private int _sessionTimeout;
@ManagedAttributeField
- public String _corsAllowOrigins;
+ public Set<String> _corsAllowOrigins;
@ManagedAttributeField
public Set<String> _corsAllowMethods;
@ManagedAttributeField
- public String _corsAllowHeaders;
+ public Set<String> _corsAllowHeaders;
@ManagedAttributeField
public Set<String> _allowedResponseHeaders;
@@ -188,6 +190,9 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
@ManagedAttributeField
private boolean _compressResponses;
+ @ManagedAttributeField
+ private boolean _useLegacyUriCompliance;
+
private final Map<HttpPort<?>, ServerConnector> _portConnectorMap = new
ConcurrentHashMap<>();
private final Map<HttpPort<?>, SslContextFactory.Server>
_sslContextFactoryMap = new ConcurrentHashMap<>();
private final BrokerChangeListener _brokerChangeListener = new
BrokerChangeListener();
@@ -278,7 +283,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
}
@Override
- public String getCorsAllowOrigins()
+ public Set<String> getCorsAllowOrigins()
{
return _corsAllowOrigins;
}
@@ -290,7 +295,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
}
@Override
- public String getCorsAllowHeaders()
+ public Set<String> getCorsAllowHeaders()
{
return _corsAllowHeaders;
}
@@ -324,14 +329,23 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
}
final ContextHandlerCollection contextCollection = new
ContextHandlerCollection();
+
final RewriteHandler rewriteHandler = new RewriteHandler();
rewriteHandler.setHandler(contextCollection);
rewriteHandler.addRule(new CompactPathRule());
- final ServletContextHandler root = new
ServletContextHandler(rewriteHandler,"/", ServletContextHandler.SESSIONS);
+ final CrossOriginHandler corsHandler = new CrossOriginHandler();
+ corsHandler.setHandler(rewriteHandler);
+ corsHandler.setAllowedOriginPatterns(getCorsAllowOrigins());
+ corsHandler.setAllowedMethods(getCorsAllowMethods());
+ corsHandler.setAllowedHeaders(getCorsAllowHeaders());
+ corsHandler.setAllowCredentials(getCorsAllowCredentials());
+
+ final ServletContextHandler root = new ServletContextHandler("/",
ServletContextHandler.SESSIONS);
+ root.setHandler(corsHandler);
server.setHandler(root);
- final ErrorHandler errorHandler = new ErrorHandler()
+ final ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler()
{
@Override
protected void writeErrorPageBody(HttpServletRequest request,
Writer writer, int code, String message, boolean showStacks)
@@ -354,14 +368,6 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
root.getServletContext().setAttribute(HttpManagementUtil.ATTR_MANAGEMENT_CONFIGURATION,
this);
root.addFilter(new FilterHolder(new ExceptionHandlingFilter()), "/*",
EnumSet.allOf(DispatcherType.class));
-
- final FilterHolder corsFilter = new FilterHolder(new
CrossOriginFilter());
- corsFilter.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM,
getCorsAllowOrigins());
- corsFilter.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM,
String.join(",", getCorsAllowMethods()));
- corsFilter.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM,
getCorsAllowHeaders());
- corsFilter.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM,
String.valueOf(getCorsAllowCredentials()));
- root.addFilter(corsFilter, "/*", EnumSet.of(DispatcherType.REQUEST));
-
root.addFilter(new FilterHolder(new MethodFilter()), "/*",
EnumSet.of(DispatcherType.REQUEST));
addFiltersAndServletsForRest(root);
@@ -374,6 +380,12 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
root.getSessionHandler().getSessionCookieConfig().setHttpOnly(true);
root.getSessionHandler().setMaxInactiveInterval(getSessionTimeout());
+ if (_useLegacyUriCompliance)
+ {
+ server.getContainedBeans(ServletHandler.class)
+ .forEach(handler -> handler.setDecodeAmbiguousURIs(true));
+ }
+
return server;
}
@@ -416,9 +428,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
root.addFilter(restAuthorizationFilter, "/" + path,
EnumSet.of(DispatcherType.REQUEST));
root.addFilter(restAuthorizationFilter, "/" + path + "/*",
EnumSet.of(DispatcherType.REQUEST));
}
-
});
-
}
private void addFiltersAndServletsForUserInterfaces(final
ServletContextHandler root)
@@ -481,22 +491,22 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
@Override
public int getBoundPort(final HttpPort httpPort)
{
- final NetworkConnector c = _portConnectorMap.get(httpPort);
- return c != null ? c.getLocalPort() : -1;
+ final NetworkConnector networkConnector =
_portConnectorMap.get(httpPort);
+ return networkConnector != null ? networkConnector.getLocalPort() : -1;
}
@Override
public int getNumberOfAcceptors(final HttpPort httpPort)
{
- final ServerConnector c = _portConnectorMap.get(httpPort);
- return c != null ? c.getAcceptors() : -1;
+ final ServerConnector serverConnector =
_portConnectorMap.get(httpPort);
+ return serverConnector != null ? serverConnector.getAcceptors() : -1;
}
@Override
public int getNumberOfSelectors(final HttpPort httpPort)
{
- final ServerConnector c = _portConnectorMap.get(httpPort);
- return c != null ? c.getSelectorManager().getSelectorCount() : -1;
+ final ServerConnector serverConnector =
_portConnectorMap.get(httpPort);
+ return serverConnector != null ?
serverConnector.getSelectorManager().getSelectorCount() : -1;
}
@Override
@@ -510,26 +520,26 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
public boolean updateSSLContext(final HttpPort httpPort)
{
final SslContextFactory.Server sslContextFactory =
getSslContextFactory(httpPort);
- if (sslContextFactory != null)
+ if (sslContextFactory == null)
{
- try
- {
- final SSLContext sslContext = createSslContext(httpPort);
- sslContextFactory.reload(f ->
- {
- final SslContextFactory.Server server =
(SslContextFactory.Server) f;
- server.setSslContext(sslContext);
- server.setNeedClientAuth(httpPort.getNeedClientAuth());
- server.setWantClientAuth(httpPort.getWantClientAuth());
- });
- return true;
- }
- catch (Exception e)
+ return false;
+ }
+ try
+ {
+ final SSLContext sslContext = createSslContext(httpPort);
+ sslContextFactory.reload(sslContextFactory1 ->
{
- throw new IllegalConfigurationException("Unexpected exception
on reload of ssl context factory", e);
- }
+ final SslContextFactory.Server server =
(SslContextFactory.Server) sslContextFactory1;
+ server.setSslContext(sslContext);
+ server.setNeedClientAuth(httpPort.getNeedClientAuth());
+ server.setWantClientAuth(httpPort.getWantClientAuth());
+ });
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalConfigurationException("Unexpected exception on
reload of ssl context factory", e);
}
- return false;
}
private SslContextFactory.Server getSslContextFactory(final HttpPort
httpPort)
@@ -550,30 +560,41 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
final HttpConnectionFactory httpConnectionFactory = new
HttpConnectionFactory();
httpConnectionFactory.getHttpConfiguration().setSendServerVersion(false);
httpConnectionFactory.getHttpConfiguration().setSendXPoweredBy(false);
- HttpConfiguration.Customizer requestAttributeCustomizer = (connector,
httpConfiguration, request) ->
-
HttpManagementUtil.getPortAttributeAction(port).performAction(request);
+ HttpConfiguration.Customizer requestAttributeCustomizer = (Request
request, HttpFields.Mutable responseHeaders) ->
+ {
+
HttpManagementUtil.getPortAttributeAction(port).performAction(request);
+ return request;
+ };
httpConnectionFactory.getHttpConfiguration().addCustomizer(requestAttributeCustomizer);
httpConnectionFactory.getHttpConfiguration().addCustomizer(new
SecureRequestCustomizer());
+ if (_useLegacyUriCompliance)
+ {
+ final Set<UriCompliance.Violation> violations =
Set.of(UriCompliance.Violation.AMBIGUOUS_PATH_SEPARATOR,
+ UriCompliance.Violation.AMBIGUOUS_PATH_ENCODING);
+ final UriCompliance uriCompliance = UriCompliance.from(violations);
+
httpConnectionFactory.getHttpConfiguration().setUriCompliance(uriCompliance);
+ }
+
ConnectionFactory[] connectionFactories;
Collection<Transport> transports = port.getTransports();
SslContextFactory.Server sslContextFactory = null;
if (!transports.contains(Transport.SSL))
{
- connectionFactories = new
ConnectionFactory[]{httpConnectionFactory};
+ connectionFactories = new ConnectionFactory[]{
httpConnectionFactory };
}
else if (transports.contains(Transport.SSL))
{
sslContextFactory = createSslContextFactory(port);
- ConnectionFactory sslConnectionFactory =
+ ConnectionFactory.Detecting sslConnectionFactory =
new SslConnectionFactory(sslContextFactory,
httpConnectionFactory.getProtocol());
if (port.getTransports().contains(Transport.TCP))
{
- sslConnectionFactory = new
DetectorConnectionFactory((ConnectionFactory.Detecting) sslConnectionFactory);
+ sslConnectionFactory = new
DetectorConnectionFactory(sslConnectionFactory);
}
- connectionFactories = new
ConnectionFactory[]{sslConnectionFactory, httpConnectionFactory};
+ connectionFactories = new ConnectionFactory[]{
sslConnectionFactory, httpConnectionFactory };
}
else
{
@@ -581,13 +602,12 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
}
final ServerConnector connector = new ServerConnector(server,
- new
QBBTrackingThreadPool(port.getThreadPoolMaximum(),
-
port.getThreadPoolMinimum()),
- null,
- null,
-
port.getDesiredNumberOfAcceptors(),
-
port.getDesiredNumberOfSelectors(),
- connectionFactories)
+ new QBBTrackingThreadPool(port.getThreadPoolMaximum(),
port.getThreadPoolMinimum()),
+ null,
+ null,
+ port.getDesiredNumberOfAcceptors(),
+ port.getDesiredNumberOfSelectors(),
+ connectionFactories)
{
@Override
public void open() throws IOException
@@ -608,7 +628,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
connector.setAcceptQueueSize(port.getAcceptBacklogSize());
final String bindingAddress = port.getBindingAddress();
- if (bindingAddress != null && !bindingAddress.trim().equals("") &&
!bindingAddress.trim().equals("*"))
+ if (bindingAddress != null && !bindingAddress.trim().isEmpty() &&
!bindingAddress.trim().equals("*"))
{
connector.setHost(bindingAddress.trim());
}
@@ -622,19 +642,15 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
public void handshakeFailed(final Event event, final Throwable
failure)
{
final SSLEngine sslEngine = event.getSSLEngine();
+ final String hostname = sslEngine.getPeerHost();
+ final int port = sslEngine.getPeerPort();
if (LOGGER.isDebugEnabled())
{
- LOGGER.info("TLS handshake failed: host='{}', port={}",
- sslEngine.getPeerHost(),
- sslEngine.getPeerPort(),
- failure);
+ LOGGER.info("TLS handshake failed: host='{}',
port={}", hostname, port, failure);
}
else
{
- LOGGER.info("TLS handshake failed: host='{}', port={}:
{}",
- sslEngine.getPeerHost(),
- sslEngine.getPeerPort(),
- String.valueOf(failure));
+ LOGGER.info("TLS handshake failed: host='{}', port={}:
{}", hostname, port, String.valueOf(failure));
}
}
});
@@ -686,12 +702,8 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
sslParameters.setUseCipherSuitesOrder(true);
sslEngine.setSSLParameters(sslParameters);
}
- SSLUtil.updateEnabledCipherSuites(sslEngine,
-
port.getTlsCipherSuiteAllowList(),
-
port.getTlsCipherSuiteDenyList());
- SSLUtil.updateEnabledTlsProtocols(sslEngine,
-
port.getTlsProtocolAllowList(),
-
port.getTlsProtocolDenyList());
+ SSLUtil.updateEnabledCipherSuites(sslEngine,
port.getTlsCipherSuiteAllowList(), port.getTlsCipherSuiteDenyList());
+ SSLUtil.updateEnabledTlsProtocols(sslEngine,
port.getTlsProtocolAllowList(), port.getTlsProtocolDenyList());
}
};
factory.setSslContext(createSslContext(port));
@@ -816,8 +828,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
private void logOperationalShutdownMessage(final int localPort)
{
-
getBroker().getEventLogger().message(ManagementConsoleMessages.SHUTTING_DOWN(Protocol.HTTP.name(),
-
localPort));
+
getBroker().getEventLogger().message(ManagementConsoleMessages.SHUTTING_DOWN(Protocol.HTTP.name(),
localPort));
}
private Collection<HttpPort<?>> getEligibleHttpPorts(final
Collection<Port<?>> ports)
@@ -825,9 +836,8 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
final Collection<HttpPort<?>> httpPorts = new HashSet<>();
for (final Port<?> port : ports)
{
- if (State.ACTIVE == port.getDesiredState() &&
- State.ERRORED != port.getState() &&
- port.getProtocols().contains(Protocol.HTTP))
+ if (State.ACTIVE == port.getDesiredState() && State.ERRORED !=
port.getState() &&
+ port.getProtocols().contains(Protocol.HTTP))
{
httpPorts.add((HttpPort<?>) port);
}
@@ -859,6 +869,12 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
return _httpBasicAuthenticationEnabled;
}
+ @Override
+ public boolean isUseLegacyUriCompliance()
+ {
+ return _useLegacyUriCompliance;
+ }
+
@Override
public boolean isCompressResponses()
{
@@ -875,7 +891,7 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
@SuppressWarnings("unused")
public static Set<String> getAllAvailableCorsMethodCombinations()
{
- final List<String> methods = Arrays.asList("OPTIONS", "HEAD", "GET",
"POST", "PUT", "DELETE");
+ final List<String> methods = List.of("OPTIONS", "HEAD", "GET", "POST",
"PUT", "DELETE");
final Set<Set<String>> combinations = new HashSet<>();
final int n = methods.size();
assert n < 31 : "Too many combination to calculate";
@@ -884,8 +900,10 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
final Set<String> currentCombination = new HashSet<>();
// each bit in the variable i represents an item of the sequence
// if the bit is set the item should appear in this particular
combination
- for (int index = 0; index < n; ++index) {
- if ((i & (1 << index)) != 0) {
+ for (int index = 0; index < n; ++index)
+ {
+ if ((i & (1 << index)) != 0)
+ {
currentCombination.add(methods.get(index));
}
}
@@ -894,12 +912,11 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
final Set<String> combinationsAsString = new
HashSet<>(combinations.size());
ObjectMapper mapper = new ObjectMapper();
- for(Set<String> combination : combinations)
+ for (Set<String> combination : combinations)
{
- try(StringWriter writer = new StringWriter())
+ try
{
- mapper.writeValue(writer, combination);
- combinationsAsString.add(writer.toString());
+
combinationsAsString.add(mapper.writeValueAsString(combination));
}
catch (IOException e)
{
@@ -921,20 +938,13 @@ public class HttpManagement extends
AbstractPluginAdapter<HttpManagement> implem
super.validateChange(proxyForValidation, changedAttributes);
HttpManagementConfiguration<?> updated =
(HttpManagementConfiguration<?>)proxyForValidation;
- if(changedAttributes.contains(HttpManagement.NAME))
+ if (changedAttributes.contains(HttpManagement.NAME) &&
!getName().equals(updated.getName()))
{
- if(!getName().equals(updated.getName()))
- {
- throw new IllegalConfigurationException("Changing the name of
http management plugin is not allowed");
- }
+ throw new IllegalConfigurationException("Changing the name of http
management plugin is not allowed");
}
- if (changedAttributes.contains(TIME_OUT))
+ if (changedAttributes.contains(TIME_OUT) &&
updated.getSessionTimeout() < 0)
{
- int value = updated.getSessionTimeout();
- if (value < 0)
- {
- throw new IllegalConfigurationException("Only positive integer
value can be specified for the session time out attribute");
- }
+ throw new IllegalConfigurationException("Only positive integer
value can be specified for the session time out attribute");
}
}
diff --git
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java
index 846a72a212..e05a1c0aa0 100644
---
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java
+++
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java
@@ -47,17 +47,20 @@ public interface HttpManagementConfiguration<X extends
HttpManagementConfigurati
@ManagedAttribute( defaultValue = "false" )
boolean isHttpBasicAuthenticationEnabled();
+ @ManagedAttribute( defaultValue = "false" )
+ boolean isUseLegacyUriCompliance();
+
@ManagedAttribute( defaultValue = "600", description = "The maximum time
interval, in seconds, that Web Management will keep the session open between
client accesses.")
int getSessionTimeout();
- @ManagedAttribute( defaultValue = "" )
- String getCorsAllowOrigins();
+ @ManagedAttribute( defaultValue = "[]" )
+ Set<String> getCorsAllowOrigins();
@ManagedAttribute( defaultValue = "[\"HEAD\",\"GET\",\"POST\"]",
validValues =
{"org.apache.qpid.server.management.plugin.HttpManagement#getAllAvailableCorsMethodCombinations()"}
)
Set<String> getCorsAllowMethods();
- @ManagedAttribute( defaultValue =
"Content-Type,Accept,Origin,X-Requested-With,X-Range" )
- String getCorsAllowHeaders();
+ @ManagedAttribute( defaultValue =
"[\"Content-Type\",\"Accept\",\"Origin\",\"X-Requested-With\",\"X-Range\"]" )
+ Set<String> getCorsAllowHeaders();
@ManagedAttribute( defaultValue = "[\"Access-Control-Allow-Credentials\",
\"Access-Control-Allow-Origin\", "
+ "\"Cache-Control\", \"Content-Encoding\", \"Content-Disposition\",
\"Content-Length\", \"Content-Type\", "
diff --git
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
index 8524458c25..b0bafdb687 100644
---
a/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
+++
b/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
@@ -45,6 +45,7 @@ import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSessionBindingEvent;
import jakarta.servlet.http.HttpSessionBindingListener;
+import org.eclipse.jetty.server.Request;
import
org.apache.qpid.server.management.plugin.servlet.ServletConnectionPrincipal;
import org.apache.qpid.server.management.plugin.session.LoginLogoutReporter;
@@ -98,7 +99,7 @@ public class HttpManagementUtil
return name + "." + getPort(request).getId();
}
- static Action<HttpServletRequest> getPortAttributeAction(Port<?> port)
+ static Action<Request> getPortAttributeAction(Port<?> port)
{
return request -> request.setAttribute(ATTR_PORT, port);
}
diff --git a/broker-plugins/websocket/pom.xml b/broker-plugins/websocket/pom.xml
index eabc450359..05d54faa2f 100644
--- a/broker-plugins/websocket/pom.xml
+++ b/broker-plugins/websocket/pom.xml
@@ -48,14 +48,8 @@
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jetty-server</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-client</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.eclipse.jetty.ee10.websocket</groupId>
+ <artifactId>jetty-ee10-websocket-jetty-server</artifactId>
</dependency>
</dependencies>
diff --git
a/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
b/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
index 342215a963..72fd6c2f66 100644
---
a/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
+++
b/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.server.transport.websocket;
-import java.io.IOException;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.security.Principal;
@@ -40,31 +39,32 @@ import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
-import jakarta.servlet.Servlet;
-import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
+import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketCreator;
+import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer;
+import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServlet;
+import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServletFactory;
import org.eclipse.jetty.io.ssl.SslHandshakeListener;
+import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.ThreadPool;
+import org.eclipse.jetty.websocket.api.Callback;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
-import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
+import org.eclipse.jetty.websocket.api.annotations.OnWebSocketOpen;
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
-import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest;
-import org.eclipse.jetty.websocket.server.JettyWebSocketServlet;
-import org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory;
-import
org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -130,7 +130,7 @@ class WebSocketProvider implements AcceptingTransport
_server = new Server(new QBBTrackingThreadPool());
final ServerConnector connector;
- HttpConnectionFactory httpConnectionFactory = new
HttpConnectionFactory();
+ final HttpConnectionFactory httpConnectionFactory = new
HttpConnectionFactory();
httpConnectionFactory.getHttpConfiguration().setSendServerVersion(false);
httpConnectionFactory.getHttpConfiguration().setSendXPoweredBy(false);
@@ -146,7 +146,7 @@ class WebSocketProvider implements AcceptingTransport
@Override
public void handshakeFailed(final Event event, final Throwable
failure)
{
- SSLEngine sslEngine = event.getSSLEngine();
+ final SSLEngine sslEngine = event.getSSLEngine();
if (LOGGER.isDebugEnabled())
{
LOGGER.info("TLS handshake failed: host='{}', port={}",
@@ -169,9 +169,9 @@ class WebSocketProvider implements AcceptingTransport
throw new IllegalArgumentException("Unexpected transport on port "
+ _port.getName() + ":" + _transport);
}
- String bindingAddress = _port.getBindingAddress();
+ final String bindingAddress = _port.getBindingAddress();
- if (bindingAddress != null && !bindingAddress.trim().equals("") &&
!bindingAddress.trim().equals("*"))
+ if (bindingAddress != null && !bindingAddress.trim().isEmpty() &&
!"*".equals(bindingAddress.trim()))
{
connector.setHost(bindingAddress.trim());
}
@@ -179,48 +179,56 @@ class WebSocketProvider implements AcceptingTransport
connector.setPort(_port.getPort());
_server.addConnector(connector);
- final Servlet websocketServlet = new JettyWebSocketServlet()
+ final JettyWebSocketCreator jettyWebSocketCreator = (request,
response) ->
+ {
+ response.setAcceptedSubProtocol(AMQP_WEBSOCKET_SUBPROTOCOL);
+ return new AmqpWebSocket(request.getCertificates());
+ };
+
+ final JettyWebSocketServlet websocketServlet = new
JettyWebSocketServlet()
{
@Override
public void configure(final JettyWebSocketServletFactory factory)
{
factory.setMaxBinaryMessageSize(0L);
- factory.setCreator((req, resp) ->
- {
- resp.setAcceptedSubProtocol(AMQP_WEBSOCKET_SUBPROTOCOL);
- return new AmqpWebSocket();
- });
+ factory.setCreator(jettyWebSocketCreator);
}
};
- final ContextHandlerCollection handlers = new
ContextHandlerCollection();
final ServletContextHandler servletContextHandler = new
ServletContextHandler();
+ servletContextHandler.setContextPath("/");
servletContextHandler.addServlet(new ServletHolder(websocketServlet),
"");
-
JettyWebSocketServletContainerInitializer.configure(servletContextHandler,
null);
- handlers.addHandler(new AbstractHandler()
+ servletContextHandler.setServer(_server);
+
+ WebSocketServerComponents.ensureWebSocketComponents(_server,
servletContextHandler);
+
JettyWebSocketServerContainer.ensureContainer(servletContextHandler.getServletContext())
+ .addMapping("/", jettyWebSocketCreator);
+
+ final ContextHandlerCollection handlers = new
ContextHandlerCollection();
+ handlers.addHandler(servletContextHandler);
+ handlers.addHandler(new Handler.Abstract()
{
@Override
- public void handle(final String target,
- final Request baseRequest,
- final HttpServletRequest request,
- final HttpServletResponse response)
+ public boolean handle(final Request request,
+ final Response response,
+ final org.eclipse.jetty.util.Callback
callback)
{
- if (response.isCommitted() || baseRequest.isHandled())
+ if (response.isCommitted())
{
- return;
+ return false;
}
- baseRequest.setHandled(true);
+ callback.succeeded();
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
+ return true;
}
});
- handlers.addHandler(servletContextHandler);
_server.setHandler(handlers);
try
{
_server.start();
}
- catch(RuntimeException e)
+ catch (RuntimeException e)
{
throw e;
}
@@ -245,10 +253,9 @@ class WebSocketProvider implements AcceptingTransport
port.getTlsProtocolAllowList(),
port.getTlsProtocolDenyList());
- if (port.getTlsCipherSuiteAllowList() != null
- && !port.getTlsCipherSuiteAllowList().isEmpty())
+ if (port.getTlsCipherSuiteAllowList() != null &&
!port.getTlsCipherSuiteAllowList().isEmpty())
{
- SSLParameters sslParameters = sslEngine.getSSLParameters();
+ final SSLParameters sslParameters =
sslEngine.getSSLParameters();
sslParameters.setUseCipherSuitesOrder(true);
sslEngine.setSSLParameters(sslParameters);
}
@@ -292,9 +299,9 @@ class WebSocketProvider implements AcceptingTransport
{
try
{
- _sslContextFactory.reload(f ->
+ _sslContextFactory.reload(sslContextFactory ->
{
- final SslContextFactory.Server server =
(SslContextFactory.Server) f;
+ final SslContextFactory.Server server =
(SslContextFactory.Server) sslContextFactory;
server.setSslContext(_port.getSSLContext());
server.setNeedClientAuth(_port.getNeedClientAuth());
server.setWantClientAuth(_port.getWantClientAuth());
@@ -324,34 +331,34 @@ class WebSocketProvider implements AcceptingTransport
@WebSocket
public class AmqpWebSocket
{
+ final X509Certificate[] _certificates;
private volatile QpidByteBuffer _netInputBuffer;
private volatile MultiVersionProtocolEngine _protocolEngine;
private volatile ConnectionWrapper _connectionWrapper;
private volatile boolean _unexpectedByteBufferSizeReported;
- AmqpWebSocket()
+ AmqpWebSocket(final X509Certificate[] certificates)
{
_netInputBuffer =
QpidByteBuffer.allocateDirect(_broker.getNetworkBufferSize());
+ _certificates = certificates;
}
- @OnWebSocketConnect @SuppressWarnings("unused")
+ @OnWebSocketOpen
+ @SuppressWarnings("unused")
public void onWebSocketConnect(final Session session)
{
- final SocketAddress localAddress = session.getLocalAddress();
- final SocketAddress remoteAddress = session.getRemoteAddress();
+ final SocketAddress localAddress = session.getLocalSocketAddress();
+ final SocketAddress remoteAddress =
session.getRemoteSocketAddress();
_protocolEngine = _factory.newProtocolEngine(remoteAddress);
// Let AMQP do timeout handling
session.setIdleTimeout(Duration.ZERO);
_connectionWrapper = new ConnectionWrapper(session, localAddress,
remoteAddress, _protocolEngine, _server.getThreadPool());
- if (session.getUpgradeRequest() instanceof
JettyServerUpgradeRequest)
+
+ if (_certificates != null && _certificates.length > 0)
{
- JettyServerUpgradeRequest upgradeRequest =
(JettyServerUpgradeRequest) session.getUpgradeRequest();
- if (upgradeRequest.getCertificates() != null &&
upgradeRequest.getCertificates().length > 0)
- {
-
_connectionWrapper.setPeerCertificate(upgradeRequest.getCertificates()[0]);
- }
+ _connectionWrapper.setPeerCertificate(_certificates[0]);
}
_protocolEngine.setNetworkConnection(_connectionWrapper);
_protocolEngine.setWorkListener(object ->
_server.getThreadPool().execute(() -> _connectionWrapper.doWork()));
@@ -359,8 +366,9 @@ class WebSocketProvider implements AcceptingTransport
_idleTimeoutChecker.wakeup();
}
- @OnWebSocketMessage @SuppressWarnings("unused")
- public void onWebSocketBinary(Session sess, final byte[] payload, int
offset, final int len)
+ @OnWebSocketMessage
+ @SuppressWarnings("unused")
+ public void onWebSocketBinary(ByteBuffer payload, boolean last,
Callback callback)
{
synchronized (_connectionWrapper)
{
@@ -369,17 +377,21 @@ class WebSocketProvider implements AcceptingTransport
{
_protocolEngine.setIOThread(Thread.currentThread());
Iterator<Runnable> iter =
_protocolEngine.processPendingIterator();
- while(iter.hasNext())
+ while (iter.hasNext())
{
iter.next().run();
}
+ byte[] bytes = new byte[payload.remaining()];
+ payload.get(bytes);
+ int len = bytes.length;
+ int offset = 0;
int lastRead;
int remaining = len;
do
{
int chunkLen = Math.min(remaining,
_netInputBuffer.remaining());
- _netInputBuffer.put(payload, offset, chunkLen);
+ _netInputBuffer.put(bytes, offset, chunkLen);
remaining -= chunkLen;
offset += chunkLen;
@@ -458,7 +470,8 @@ class WebSocketProvider implements AcceptingTransport
sess.close();
}
- @OnWebSocketClose @SuppressWarnings("unused")
+ @OnWebSocketClose
+ @SuppressWarnings("unused")
public void onWebSocketClose(final int statusCode, final String reason)
{
if (_protocolEngine != null)
@@ -649,20 +662,12 @@ class WebSocketProvider implements AcceptingTransport
tmp.dispose();
offset += remaining;
}
- if(size > 0)
+ if (size > 0)
{
- try
- {
- _connection.getRemote().sendBytes(ByteBuffer.wrap(data));
- if (LOGGER.isDebugEnabled())
- {
- LOGGER.debug("Written {} byte(s)", data.length);
- }
- }
- catch (IOException e)
+ _connection.sendBinary(ByteBuffer.wrap(data), Callback.NOOP);
+ if (LOGGER.isDebugEnabled())
{
- LOGGER.info("Exception on write: {}", e.getMessage());
- close();
+ LOGGER.debug("Written {} byte(s)", data.length);
}
}
}
@@ -758,4 +763,4 @@ class WebSocketProvider implements AcceptingTransport
notifyAll();
}
}
-}
\ No newline at end of file
+}
diff --git
a/doc/java-broker/src/docbkx/management/managing/Java-Broker-Management-Managing-Plugins-HTTP.xml
b/doc/java-broker/src/docbkx/management/managing/Java-Broker-Management-Managing-Plugins-HTTP.xml
index 389951222d..15c11dac25 100644
---
a/doc/java-broker/src/docbkx/management/managing/Java-Broker-Management-Managing-Plugins-HTTP.xml
+++
b/doc/java-broker/src/docbkx/management/managing/Java-Broker-Management-Managing-Plugins-HTTP.xml
@@ -48,6 +48,12 @@
<para><emphasis>Session timeout</emphasis> is the timeout
in seconds to close
the HTTP session. It is set to 10 minutes by
default.</para>
</listitem>
+ <listitem>
+ <para><emphasis>Use Legacy URI Compliance</emphasis>. It
is set to false
+ (disabled) by default.</para>
+ <para>For more information see
+
https://jetty.org/docs/jetty/12/programming-guide/server/compliance.html#uri</para>
+ </listitem>
<listitem>
<para><emphasis>CORS Allow Origins</emphasis> is a comma
separated list of origins that are allowed to access the REST API. Set to '*'
to allow all origins. Default is empty, meaning CORS is disabled.</para>
</listitem>
diff --git a/pom.xml b/pom.xml
index 88b59923bf..a8f97027a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,7 @@
<fasterxml-jackson-version>2.18.2</fasterxml-jackson-version>
<fasterxml-jackson-databind-version>2.18.2</fasterxml-jackson-databind-version>
<slf4j-version>2.0.16</slf4j-version>
- <jetty-version>11.0.24</jetty-version>
+ <jetty-version>12.0.22</jetty-version>
<!-- dependency version numbers -->
<hikari-cp-version>6.2.1</hikari-cp-version>
@@ -630,13 +630,13 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-servlet</artifactId>
<version>${jetty-version}</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlets</artifactId>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-servlets</artifactId>
<version>${jetty-version}</version>
</dependency>
<dependency>
@@ -645,17 +645,36 @@
<version>${jetty-version}</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jetty-server</artifactId>
+ <groupId>org.eclipse.jetty.ee10.websocket</groupId>
+ <artifactId>jetty-ee10-websocket-jetty-server</artifactId>
+ <version>${jetty-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-annotations</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee10.websocket</groupId>
+ <artifactId>jetty-ee10-websocket-jakarta-server</artifactId>
<version>${jetty-version}</version>
<exclusions>
<exclusion>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-client</artifactId>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-annotations</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-webapp</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.jetty.ee10.websocket</groupId>
+ <artifactId>jetty-ee10-websocket-servlet</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-annotations</artifactId>
+ <artifactId>jetty-alpn-client</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -1656,7 +1675,7 @@
<licenseMerge>The MIT License|MIT License|MIT
license|MIT</licenseMerge>
<licenseMerge>BSD License|New BSD|New BSD License|BSD
3-Clause|BSD-3-Clause|BSD Licence 3|BSD License 3|The BSD License</licenseMerge>
<licenseMerge>Eclipse Public License - Version 1.0|Eclipse
Public License - v 1.0|Eclipse Public License, Version 1.0|Eclipse Public
License 1.0|MPL 2.0 or EPL 1.0</licenseMerge>
- <licenseMerge>Eclipse Public License - Version 2.0|Eclipse
Public License - v 2.0|Eclipse Public License, Version 2.0|Eclipse Public
License 2.0|Eclipse Public License v2.0|MPL 2.0 or EPL 2.0|EPL
2.0</licenseMerge>
+ <licenseMerge>Eclipse Public License - Version 2.0|Eclipse
Public License - v 2.0|Eclipse Public License, Version 2.0|Eclipse Public
License 2.0|Eclipse Public License v. 2.0|Eclipse Public License v2.0|MPL 2.0
or EPL 2.0|EPL 2.0</licenseMerge>
<licenseMerge>Academic Free License v2.1|AFL-2.1</licenseMerge>
<licenseMerge>COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
(CDDL) Version 1.0|CDDL + GPLv2 with classpath exception</licenseMerge>
</licenseMerges>
diff --git
a/systests/qpid-systests-http-management/src/main/resources/config-http-management-tests.json
b/systests/qpid-systests-http-management/src/main/resources/config-http-management-tests.json
index e29cd96371..36e9fd2982 100644
---
a/systests/qpid-systests-http-management/src/main/resources/config-http-management-tests.json
+++
b/systests/qpid-systests-http-management/src/main/resources/config-http-management-tests.json
@@ -119,7 +119,8 @@
{
"type": "MANAGEMENT-HTTP",
"name": "httpManagement",
- "httpBasicAuthenticationEnabled": true
+ "httpBasicAuthenticationEnabled": true,
+ "useLegacyUriCompliance": true
}
],
"virtualhostnodes": []
diff --git
a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/sasl/AuthenticationTest.java
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/sasl/AuthenticationTest.java
index ea22b19af9..b205ab5e5d 100644
---
a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/sasl/AuthenticationTest.java
+++
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/sasl/AuthenticationTest.java
@@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.io.IOException;
-import java.io.OutputStream;
+import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
@@ -48,16 +48,14 @@ import javax.jms.Session;
import javax.jms.TemporaryQueue;
import javax.naming.NamingException;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
+import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.ContextHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
+import org.eclipse.jetty.util.Callback;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterAll;
@@ -117,7 +115,7 @@ public class AuthenticationTest extends JmsTestBase
private static final String USER_PASSWORD = "user";
private static final Server CRL_SERVER = new Server();
- private static final HandlerCollection HANDLERS = new HandlerCollection();
+ private static final Handler.Sequence HANDLERS = new Handler.Sequence();
private static final String CRL_TEMPLATE = "http://localhost:%d/%s";
@@ -839,7 +837,7 @@ public class AuthenticationTest extends JmsTestBase
return DataUrlUtils.getDataUrlForBytes(Files.readAllBytes(file));
}
- private static class CrlServerHandler extends AbstractHandler
+ private static class CrlServerHandler extends Handler.Abstract
{
final Path crlPath;
@@ -849,15 +847,12 @@ public class AuthenticationTest extends JmsTestBase
}
@Override
- public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
- throws IOException
+ public boolean handle(final Request request, final Response response,
final Callback callback) throws Exception
{
final byte[] crlBytes = Files.readAllBytes(crlPath);
- response.setStatus(HttpServletResponse.SC_OK);
- try (final OutputStream responseBody = response.getOutputStream())
- {
- responseBody.write(crlBytes);
- }
+ response.setStatus(200);
+ response.write(true, ByteBuffer.wrap(crlBytes), callback);
+ return true;
}
}
}
diff --git a/systests/systests-utils/pom.xml b/systests/systests-utils/pom.xml
index 2bcf8e8b82..fc93b2c750 100644
--- a/systests/systests-utils/pom.xml
+++ b/systests/systests-utils/pom.xml
@@ -60,6 +60,10 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-servlet</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git
a/systests/systests-utils/src/main/java/org/apache/qpid/tests/utils/OAuth2MockEndpointHolder.java
b/systests/systests-utils/src/main/java/org/apache/qpid/tests/utils/OAuth2MockEndpointHolder.java
index dd54318588..2a4af4bd6c 100644
---
a/systests/systests-utils/src/main/java/org/apache/qpid/tests/utils/OAuth2MockEndpointHolder.java
+++
b/systests/systests-utils/src/main/java/org/apache/qpid/tests/utils/OAuth2MockEndpointHolder.java
@@ -24,6 +24,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -32,8 +33,10 @@ import javax.net.ssl.SSLEngine;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
@@ -42,6 +45,7 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.apache.qpid.server.configuration.CommonProperties;
@@ -93,7 +97,10 @@ public class OAuth2MockEndpointHolder
}
};
sslContextFactory.setKeyStorePassword(keyStorePassword);
-
sslContextFactory.setKeyStoreResource(Resource.newResource(keyStorePath));
+ try (final ResourceFactory.Closeable resourceFactory =
ResourceFactory.closeable())
+ {
+
sslContextFactory.setKeyStoreResource(resourceFactory.newResource(keyStorePath));
+ }
sslContextFactory.setKeyStoreType(keyStoreType);
// override default jetty excludes as valid IBM JDK are excluded
@@ -111,20 +118,20 @@ public class OAuth2MockEndpointHolder
_connector = new ServerConnector(_server, sslContextFactory, new
HttpConnectionFactory(httpsConfig));
_connector.setPort(0);
_connector.setReuseAddress(true);
- _server.setHandler(new AbstractHandler()
+
+ final ServletContextHandler servletContextHandler = new
ServletContextHandler();
+ servletContextHandler.setContextPath("/");
+ _server.setHandler(servletContextHandler);
+
+ servletContextHandler.addServlet(new HttpServlet()
{
@Override
- public void handle(final String target,
- final Request baseRequest,
- final HttpServletRequest request,
- final HttpServletResponse response) throws
IOException
+ public void doGet(final HttpServletRequest request, final
HttpServletResponse response) throws IOException
{
- baseRequest.setHandled(true);
-
try
{
final OAuth2MockEndpoint
- mockEndpoint =
_endpoints.get(request.getPathInfo());
+ mockEndpoint =
_endpoints.get(request.getServletPath());
assertNotNull(mockEndpoint, String.format("Could not find
mock endpoint for request path '%s'",
request.getPathInfo()));
mockEndpoint.handleRequest(request, response);
@@ -136,7 +143,14 @@ public class OAuth2MockEndpointHolder
.getBytes(UTF_8));
}
}
- });
+
+ @Override
+ public void doPost(final HttpServletRequest request, final
HttpServletResponse response) throws IOException
+ {
+ doGet(request, response);
+ }
+
+ }, "/");
_server.addConnector(_connector);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]