ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1810339 - in /webservices/wss4j/trunk/ws-security-web: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/wss4j/ src/main/java/org/apache/wss4j/web/
Date Mon, 02 Oct 2017 12:23:58 GMT
Author: coheigea
Date: Mon Oct  2 12:23:57 2017
New Revision: 1810339

URL: http://svn.apache.org/viewvc?rev=1810339&view=rev
Log:
WSS-614 org.apache.ws.security.transform.STRTransformProvider leak. This closes #8.

I've created a new module that has a ServletContextListener,
WssServletContextListener. This WssServletContextListener calls
WSSConfig.cleanUp() method when contextDestroyed() is invoked.
I´ve made it in a different module so it could be included in web
applications.

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>

Added:
    webservices/wss4j/trunk/ws-security-web/
    webservices/wss4j/trunk/ws-security-web/pom.xml
    webservices/wss4j/trunk/ws-security-web/src/
    webservices/wss4j/trunk/ws-security-web/src/main/
    webservices/wss4j/trunk/ws-security-web/src/main/java/
    webservices/wss4j/trunk/ws-security-web/src/main/java/org/
    webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/
    webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/
    webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/
    webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/WssServletContextListener.java

Added: webservices/wss4j/trunk/ws-security-web/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-web/pom.xml?rev=1810339&view=auto
==============================================================================
--- webservices/wss4j/trunk/ws-security-web/pom.xml (added)
+++ webservices/wss4j/trunk/ws-security-web/pom.xml Mon Oct  2 12:23:57 2017
@@ -0,0 +1,86 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.wss4j</groupId>
+		<artifactId>wss4j-parent</artifactId>
+		<relativePath>../parent/pom.xml</relativePath>
+		<version>2.2.1-SNAPSHOT</version>
+	</parent>
+	<artifactId>wss4j-ws-security-web</artifactId>
+	<name>Apache WSS4J web WS-Security</name>
+
+	<build>
+		<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
+		<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+		<resources>
+			<resource>
+				<directory>src/main/java</directory>
+				<excludes>
+					<exclude>**/*.java</exclude>
+				</excludes>
+			</resource>
+			<resource>
+				<directory>src/main/resources</directory>
+				<includes>
+					<include>**/*</include>
+				</includes>
+			</resource>
+		</resources>
+		<testResources>
+			<testResource>
+				<directory>src/test/java</directory>
+				<excludes>
+					<exclude>**/*.java</exclude>
+				</excludes>
+			</testResource>
+			<testResource>
+				<directory>src/test/resources</directory>
+				<includes>
+					<include>**/*</include>
+				</includes>
+			</testResource>
+		</testResources>
+
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.wss4j</groupId>
+			<artifactId>wss4j-ws-security-dom</artifactId>
+			<version>${project.version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>3.0.1</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
+</project>

Added: webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/WssServletContextListener.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/WssServletContextListener.java?rev=1810339&view=auto
==============================================================================
--- webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/WssServletContextListener.java
(added)
+++ webservices/wss4j/trunk/ws-security-web/src/main/java/org/apache/wss4j/web/WssServletContextListener.java
Mon Oct  2 12:23:57 2017
@@ -0,0 +1,25 @@
+package org.apache.wss4j.web;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
+
+import org.apache.wss4j.dom.engine.WSSConfig;
+
+/**
+ * ServletContextListener that cleans up WSS4J security providers at context
+ * destruction.
+ */
+@WebListener
+public class WssServletContextListener implements ServletContextListener {
+
+  @Override
+  public void contextDestroyed(ServletContextEvent servletContextEvent) {
+    WSSConfig.cleanUp();
+  }
+
+  @Override
+  public void contextInitialized(ServletContextEvent servletContextEvent) {
+  }
+
+}



Mime
View raw message