diff --git a/.woodpecker.yml b/.woodpecker.yml index dfe15e5..90b1f4a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,6 +1,19 @@ -# .woodpecker.yml comment +# .woodpecker.yml pipeline: build: image: maven:3-jdk-11 commands: - mvn clean package -P db-mariadb + deploy: + image: appleboy/drone-ssh + settings: + host: + - bstly.de + username: bstlboard + key: + from_secret: deploy_key + port: 222 + script: + - + when: + event: tag \ No newline at end of file diff --git a/pom.xml b/pom.xml index 87724b8..b121700 100644 --- a/pom.xml +++ b/pom.xml @@ -10,14 +10,14 @@ UTF-8 11 - 2.17.2 - 1.4.0 + 2.19.0 + 1.5.0 org.springframework.boot spring-boot-starter-parent - 2.6.6 + 2.7.6 diff --git a/src/main/java/de/bstly/board/businesslogic/SearchManager.java b/src/main/java/de/bstly/board/businesslogic/SearchManager.java index 790fd6b..305126e 100644 --- a/src/main/java/de/bstly/board/businesslogic/SearchManager.java +++ b/src/main/java/de/bstly/board/businesslogic/SearchManager.java @@ -40,10 +40,6 @@ public class SearchManager implements SmartInitializingSingleton { private SettingsManager settingsManager; private SearchSession searchSession; - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ /* * @see org.springframework.beans.factory.SmartInitializingSingleton# * afterSingletonsInstantiated() diff --git a/src/main/java/de/bstly/board/businesslogic/UserManager.java b/src/main/java/de/bstly/board/businesslogic/UserManager.java index 2a0e82c..a492f0a 100644 --- a/src/main/java/de/bstly/board/businesslogic/UserManager.java +++ b/src/main/java/de/bstly/board/businesslogic/UserManager.java @@ -55,122 +55,6 @@ public class UserManager implements UserDetailsService, SmartInitializingSinglet @Value("${admin.password:}") private String adminPassword; - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ /* * @see org.springframework.security.core.userdetails.UserDetailsService# * loadUserByUsername(java.lang.String) @@ -200,122 +84,6 @@ public class UserManager implements UserDetailsService, SmartInitializingSinglet return userDetails; } - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ /* * @see org.springframework.beans.factory.SmartInitializingSingleton# * afterSingletonsInstantiated() diff --git a/src/main/java/de/bstly/board/security/SecurityConfig.java b/src/main/java/de/bstly/board/security/SecurityConfig.java index 644b1b1..dc124ce 100755 --- a/src/main/java/de/bstly/board/security/SecurityConfig.java +++ b/src/main/java/de/bstly/board/security/SecurityConfig.java @@ -14,8 +14,8 @@ import org.springframework.http.HttpStatus; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.argon2.Argon2PasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.HttpStatusEntryPoint; import org.springframework.security.web.authentication.RememberMeServices; import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; @@ -37,7 +37,7 @@ import de.bstly.board.businesslogic.UserManager; */ @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { +public class SecurityConfig { @Autowired private UserManager localUserManager; @@ -50,18 +50,15 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Value("${loginTargetUrl:/}") private String loginTargetUrl; - /* - * @see org.springframework.security.config.annotation.web.configuration. - * WebSecurityConfigurerAdapter#configure(org.springframework.security.config. - * annotation.web.builders.HttpSecurity) + /** + * Security filter chain. + * + * @param http the http + * @return the security filter chain + * @throws Exception the exception */ - /* - * @see org.springframework.security.config.annotation.web.configuration. - * WebSecurityConfigurerAdapter#configure(org.springframework.security.config. - * annotation.web.builders.HttpSecurity) - */ - @Override - protected void configure(HttpSecurity http) throws Exception { + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { oAuth2AuthenticationSuccessHandler.setDefaultTargetUrl(loginTargetUrl); oAuth2AuthenticationSuccessHandler.setRememberMeServices(rememberMeServices()); @@ -90,6 +87,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .oauth2Login().successHandler(oAuth2AuthenticationSuccessHandler) .failureHandler(new SimpleUrlAuthenticationFailureHandler(loginUrl + "?externalError")) .loginPage("/login"); + + return http.build(); } /**