Upgrade wso2 tomcat version

remotes/1725333865317989910/tmp_refs/heads/master
tcdlpds 9 months ago
parent fdf5c62204
commit e67630feeb

@ -287,11 +287,11 @@
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId> <artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>

@ -54,11 +54,11 @@
<artifactId>testng</artifactId> <artifactId>testng</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -72,11 +72,11 @@
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -72,11 +72,11 @@
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -72,11 +72,11 @@
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -72,11 +72,11 @@
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -398,11 +398,11 @@
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId> <artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>

@ -64,11 +64,11 @@
<artifactId>scannotation</artifactId> <artifactId>scannotation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -174,11 +174,11 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>

@ -33,8 +33,6 @@ import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response; import org.apache.catalina.connector.Response;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.coyote.InputBuffer;
import org.apache.tomcat.util.buf.ByteChunk;
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
@ -42,7 +40,12 @@ import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.*; import java.util.ArrayList;
import java.util.Base64;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
public class BSTAuthenticator implements WebappAuthenticator { public class BSTAuthenticator implements WebappAuthenticator {
@ -146,30 +149,27 @@ public class BSTAuthenticator implements WebappAuthenticator {
private String getBSTHeader(Request request) throws IOException, XMLStreamException { private String getBSTHeader(Request request) throws IOException, XMLStreamException {
org.apache.coyote.Request coyoteReq = request.getCoyoteRequest(); org.apache.coyote.Request coyoteReq = request.getCoyoteRequest();
InputBuffer buf = coyoteReq.getInputBuffer(); String securityHeader = coyoteReq.getHeader("Security");
ByteChunk bc = new ByteChunk();
buf.doRead(bc, coyoteReq); if (securityHeader == null || securityHeader.isEmpty()) {
try (InputStream is = new ByteArrayInputStream(getUTF8Bytes(bc.toString()))) { return null;
}
// Process the "Security" header value as needed
try (InputStream is = new ByteArrayInputStream(getUTF8Bytes(securityHeader))) {
XMLStreamReader reader = StAXUtils.createXMLStreamReader(is); XMLStreamReader reader = StAXUtils.createXMLStreamReader(is);
StAXBuilder builder = new StAXSOAPModelBuilder(reader); StAXBuilder builder = new StAXSOAPModelBuilder(reader);
SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement(); SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
envelope.build(); envelope.build();
SOAPHeader header = envelope.getHeader(); SOAPHeader header = envelope.getHeader();
Iterator headerEls = header.getChildrenWithLocalName("Security"); Iterator headerEls = header.getChildrenWithLocalName("BinarySecurityToken");
if (!headerEls.hasNext()) { if (!headerEls.hasNext()) {
return null; return null;
} }
OMElement securityHeader = (OMElement) headerEls.next(); OMElement bstHeader = (OMElement) headerEls.next();
Iterator securityHeaderEls = securityHeader.getChildrenWithLocalName("BinarySecurityToken");
if (!securityHeaderEls.hasNext()) {
return null;
}
OMElement bstHeader = (OMElement) securityHeaderEls.next();
bstHeader.build(); bstHeader.build();
return bstHeader.getText(); return bstHeader.getText();
} }
} }
} }

@ -930,8 +930,9 @@
<!-- End of API Management dependencies --> <!-- End of API Management dependencies -->
<!-- Tomcat dependencies --> <!-- Tomcat dependencies -->
<!-- https://mvnrepository.com/artifact/org.wso2.orbit.org.apache.tomcat/tomcat -->
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId> <artifactId>tomcat</artifactId>
<version>${orbit.version.tomcat}</version> <version>${orbit.version.tomcat}</version>
<exclusions> <exclusions>
@ -961,6 +962,37 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>org.wso2.tomcat</groupId>-->
<!-- <artifactId>tomcat</artifactId>-->
<!-- <version>${orbit.version.tomcat}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat</groupId>-->
<!-- <artifactId>tomcat-dbcp</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat</groupId>-->
<!-- <artifactId>tomcat-jasper</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat</groupId>-->
<!-- <artifactId>tomcat-websocket-api</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat.embed</groupId>-->
<!-- <artifactId>tomcat-embed-core</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat.embed</groupId>-->
<!-- <artifactId>tomcat-embed-jasper</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.apache.tomcat.embed</groupId>-->
<!-- <artifactId>tomcat-embed-websocket</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.tomcat.ext</artifactId> <artifactId>org.wso2.carbon.tomcat.ext</artifactId>
@ -997,11 +1029,17 @@
<artifactId>jdbc-pool</artifactId> <artifactId>jdbc-pool</artifactId>
<version>${tomcat.jdbc.pooling.version}</version> <version>${tomcat.jdbc.pooling.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.wso2.orbit.org.apache.tomcat/tomcat-servlet-api -->
<dependency> <dependency>
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
<version>${orbit.version.tomcat.servlet.api}</version> <version>9.0.71.wso2v1</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>org.wso2.tomcat</groupId>-->
<!-- <artifactId>tomcat-servlet-api</artifactId>-->
<!-- <version>${orbit.version.tomcat.servlet.api}</version>-->
<!-- </dependency>-->
<!-- End of Tomcat dependencies --> <!-- End of Tomcat dependencies -->
<!-- Carbon Identity dependencies --> <!-- Carbon Identity dependencies -->
@ -2014,7 +2052,7 @@
<eclipse.osgi.version>3.8.1.v20120830-144521</eclipse.osgi.version> <eclipse.osgi.version>3.8.1.v20120830-144521</eclipse.osgi.version>
<!-- Tomcat --> <!-- Tomcat -->
<orbit.version.tomcat>7.0.93.wso2v1</orbit.version.tomcat> <orbit.version.tomcat>9.0.71.wso2v1</orbit.version.tomcat>
<orbit.version.tomcat.servlet.api>7.0.93.wso2v1</orbit.version.tomcat.servlet.api> <orbit.version.tomcat.servlet.api>7.0.93.wso2v1</orbit.version.tomcat.servlet.api>
<tomcat.jdbc.pooling.version>7.0.34.wso2v2</tomcat.jdbc.pooling.version> <tomcat.jdbc.pooling.version>7.0.34.wso2v2</tomcat.jdbc.pooling.version>

Loading…
Cancel
Save