From 87a9cb1c12c7ec2784407ea679bc82e380743f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Sat, 24 Dec 2016 23:36:54 +0100 Subject: [PATCH] RESTRequestParameterProcessingFilter moved to annotated bean. --- .../RESTRequestParameterProcessingFilter.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java b/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java index f5274148..dd974919 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java +++ b/libresonic-main/src/main/java/org/libresonic/player/security/RESTRequestParameterProcessingFilter.java @@ -29,11 +29,13 @@ import org.libresonic.player.domain.Version; import org.libresonic.player.service.SecurityService; import org.libresonic.player.service.SettingsService; import org.libresonic.player.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.ProviderManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; @@ -51,14 +53,19 @@ import java.io.IOException; * * @author Sindre Mehus */ +@Component(value = "restRequestParameterProcessingFilter") public class RESTRequestParameterProcessingFilter implements Filter { private static final Logger LOG = Logger.getLogger(RESTRequestParameterProcessingFilter.class); private final JAXBWriter jaxbWriter = new JAXBWriter(); + @Autowired private ProviderManager authenticationManager; + @Autowired private SettingsService settingsService; + @Autowired private SecurityService securityService; + @Autowired private LoginFailureLogger loginFailureLogger; public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { @@ -185,19 +192,4 @@ public class RESTRequestParameterProcessingFilter implements Filter { public void destroy() { } - public void setAuthenticationManager(ProviderManager authenticationManager) { - this.authenticationManager = authenticationManager; - } - - public void setSettingsService(SettingsService settingsService) { - this.settingsService = settingsService; - } - - public void setSecurityService(SecurityService securityService) { - this.securityService = securityService; - } - - public void setLoginFailureLogger(LoginFailureLogger loginFailureLogger) { - this.loginFailureLogger = loginFailureLogger; - } }