Skip to content

Commit

Permalink
Merge 2.0.x into 2.x
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol committed Nov 23, 2023
2 parents 227b8ea + e7a2b24 commit ebd344c
Show file tree
Hide file tree
Showing 31 changed files with 1,405 additions and 60 deletions.
17 changes: 5 additions & 12 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,22 @@ The project maintains the following source code repositories:
* https://github.com/eclipse-ee4j/tyrus

## Third-party Content
The following non-EPL 2.0 code is distributed in Tyrus bundles:
This project leverages the following third party content:

jakarta.activation 2.0
* License: BSD-3-Clause
* Copyright (c) 2018 Oracle and/or its affiliates

jakarta.enterprise.cdi-api Version 3.0.0
jakarta.enterprise.cdi-api Version 4.0.1
* License: Apache License, 2.0
* Copyright 2010, Red Hat, Inc., and individual contributors

jakarta.inject Version: 2.0
jakarta.inject Version: 2.0.1
* License: Apache License, 2.0
* Copyright (C) 2009 The JSR-330 Expert Group

jakarta.xml.bind-api Version: 3.0
* License: BSD-3-Clause
* Copyright (c) 2017, 2018 Oracle and/or its affiliates

jline (2.14.5)
jline Version: 2.14.5
* License: BSD-3-Clause
* Project: https://github.com/jline/jline2
* Source: https://github.com/jline/jline2


## Cryptography

Content may contain encryption software. The country in which you are currently
Expand Down
4 changes: 2 additions & 2 deletions archetypes/echo/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<version>3.3.1</version>
<configuration>
<escapeString>\</escapeString>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
<version>${maven.war.plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin}</version>
<inherited>true</inherited>
<configuration>
<source>${java.version}</source>
Expand Down Expand Up @@ -66,9 +67,11 @@
</dependency>
</dependencies>
<properties>
<websocket-api.version>2.1.0</websocket-api.version>
<websocket-api.version>2.1.1</websocket-api.version>
<java.version>11</java.version>
<tyrus.version>${project.version}</tyrus.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.plugin>3.11.0</maven.compiler.plugin>
<maven.war.plugin.version>3.4.0</maven.war.plugin.version>
</properties>
</project>
4 changes: 2 additions & 2 deletions bom/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -24,7 +24,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
<version>1.0.7</version>
<version>1.0.9</version>
</parent>

<groupId>org.glassfish.tyrus</groupId>
Expand Down
1 change: 1 addition & 0 deletions bundles/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/examples-assembly.xml</descriptor>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -295,6 +295,8 @@ public ClientUpgradeInfo processResponse(final UpgradeResponse upgradeResponse,
LocalizationMessages.HANDSHAKE_HTTP_RETRY_AFTER_MESSAGE(), delay));
return UPGRADE_INFO_FAILED;
default:
((ClientEndpointConfig) endpointWrapper.getEndpointConfig()).getConfigurator().afterResponse(upgradeResponse);

clientEngineState = TyrusClientEngineState.FAILED;
HandshakeException e = new HandshakeException(
upgradeResponse.getStatus(),
Expand Down
11 changes: 11 additions & 0 deletions containers/glassfish/cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>${inject.api.version}</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -199,7 +199,7 @@ public boolean isUserInRole(String role) {
final WebSocketEngine.UpgradeInfo upgradeInfo = engine.upgrade(requestContext, tyrusUpgradeResponse);
switch (upgradeInfo.getStatus()) {
case HANDSHAKE_FAILED:
appendTraceHeaders(httpServletResponse, tyrusUpgradeResponse);
appendAllHeaders(httpServletResponse, tyrusUpgradeResponse);
httpServletResponse.sendError(tyrusUpgradeResponse.getStatus());
break;
case NOT_APPLICABLE:
Expand All @@ -222,9 +222,7 @@ public boolean isUserInRole(String role) {
}

httpServletResponse.setStatus(tyrusUpgradeResponse.getStatus());
for (Map.Entry<String, List<String>> entry : tyrusUpgradeResponse.getHeaders().entrySet()) {
httpServletResponse.addHeader(entry.getKey(), Utils.getHeaderFromList(entry.getValue()));
}
appendAllHeaders(httpServletResponse, tyrusUpgradeResponse);

httpServletResponse.flushBuffer();
LOGGER.fine("Handshake Complete");
Expand Down Expand Up @@ -270,6 +268,13 @@ private static void appendTraceHeaders(HttpServletResponse httpServletResponse,
}
}

private static void appendAllHeaders(HttpServletResponse httpServletResponse, TyrusUpgradeResponse
tyrusUpgradeResponse) {
for (Map.Entry<String, List<String>> entry : tyrusUpgradeResponse.getHeaders().entrySet()) {
httpServletResponse.addHeader(entry.getKey(), Utils.getHeaderFromList(entry.getValue()));
}
}

private synchronized JAXBContext getWsadlJaxbContext() throws JAXBException {
if (wsadlJaxbContext == null) {
wsadlJaxbContext = JAXBContext.newInstance(Application.class.getPackage().getName());
Expand Down
14 changes: 13 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -111,6 +111,18 @@
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>${activation.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -401,8 +401,21 @@ public Map<String, Object> getProperties() {
}

response.getHeaders().putAll(debugContext.getTracingHeaders());
return new SuccessfulUpgradeInfo(endpointWrapper, protocolHandler, incomingBufferSize, request, response,
extensionContext, debugContext);
switch (response.getStatus()) {
case 101:
case 300:
case 301:
case 302:
case 303:
case 307:
case 308:
case 401:
case 503:
return new SuccessfulUpgradeInfo(endpointWrapper, protocolHandler, incomingBufferSize, request, response,
extensionContext, debugContext);
default:
return new NoConnectionUpgradeInfo(UpgradeStatus.HANDSHAKE_FAILED);
}
}

response.setStatus(500);
Expand Down
4 changes: 2 additions & 2 deletions ext/client-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.14.5</version>
<version>${jline.version}</version>
</dependency>
</dependencies>

Expand Down
Loading

0 comments on commit ebd344c

Please sign in to comment.