HADOOP-11837. AuthenticationFilter should destroy SignerSecretProvider in Tomcat deployments. Contributed by Bowen Zhang.
This commit is contained in:
parent
76e7264e8d
commit
c6b5203cfd
@ -187,6 +187,7 @@ public class AuthenticationFilter implements Filter {
|
|||||||
private long validity;
|
private long validity;
|
||||||
private String cookieDomain;
|
private String cookieDomain;
|
||||||
private String cookiePath;
|
private String cookiePath;
|
||||||
|
private boolean isInitializedByTomcat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Initializes the authentication filter and signer secret provider.</p>
|
* <p>Initializes the authentication filter and signer secret provider.</p>
|
||||||
@ -252,6 +253,7 @@ protected void initializeSecretProvider(FilterConfig filterConfig)
|
|||||||
secretProvider = constructSecretProvider(
|
secretProvider = constructSecretProvider(
|
||||||
filterConfig.getServletContext(),
|
filterConfig.getServletContext(),
|
||||||
config, false);
|
config, false);
|
||||||
|
isInitializedByTomcat = true;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new ServletException(ex);
|
throw new ServletException(ex);
|
||||||
}
|
}
|
||||||
@ -380,6 +382,10 @@ public void destroy() {
|
|||||||
authHandler.destroy();
|
authHandler.destroy();
|
||||||
authHandler = null;
|
authHandler = null;
|
||||||
}
|
}
|
||||||
|
if (secretProvider != null && isInitializedByTomcat) {
|
||||||
|
secretProvider.destroy();
|
||||||
|
secretProvider = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1248,6 +1248,9 @@ Release 2.7.0 - UNRELEASED
|
|||||||
HADOOP-11815. HttpServer2 should destroy SignerSecretProvider when it
|
HADOOP-11815. HttpServer2 should destroy SignerSecretProvider when it
|
||||||
stops. (Rohith via wheat9)
|
stops. (Rohith via wheat9)
|
||||||
|
|
||||||
|
HADOOP-11837. AuthenticationFilter should destroy SignerSecretProvider in
|
||||||
|
Tomcat deployments. (Bowen Zhang via wheat9)
|
||||||
|
|
||||||
Release 2.6.1 - UNRELEASED
|
Release 2.6.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
Loading…
Reference in New Issue
Block a user