mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 13:32:30 +00:00
SEC-957: logger.debug without guard causing massive performance hit
http://jira.springframework.org/browse/SEC-957. Added debug logging guard as requested.
This commit is contained in:
parent
09cf90258f
commit
bb457e1d07
@ -45,7 +45,7 @@ import java.security.cert.X509Certificate;
|
||||
*
|
||||
* @author Luke Taylor
|
||||
* @deprecated superceded by the preauth provider. Use the X.509 authentication support in org.springframework.security.ui.preauth.x509 instead
|
||||
* or namespace support via the <x509 /> element.
|
||||
* or namespace support via the <x509 /> element.
|
||||
* @version $Id$
|
||||
*/
|
||||
public class X509AuthenticationProvider implements AuthenticationProvider, InitializingBean, MessageSourceAware {
|
||||
@ -61,7 +61,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi
|
||||
|
||||
//~ Methods ========================================================================================================
|
||||
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(userCache, "An x509UserCache must be set");
|
||||
Assert.notNull(x509AuthoritiesPopulator, "An X509AuthoritiesPopulator must be set");
|
||||
Assert.notNull(this.messages, "A message source must be set");
|
||||
@ -101,7 +101,9 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi
|
||||
UserDetails user = userCache.getUserFromCache(clientCertificate);
|
||||
|
||||
if (user == null) {
|
||||
logger.debug("Authenticating with certificate " + clientCertificate);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Authenticating with certificate " + clientCertificate);
|
||||
}
|
||||
user = x509AuthoritiesPopulator.getUserDetails(clientCertificate);
|
||||
userCache.putUserInCache(clientCertificate, user);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user