From ab784af235a2dc2ec9a8409ff9cc09c111c4ef6b Mon Sep 17 00:00:00 2001 From: mikr Date: Sat, 29 Feb 2020 16:12:08 +0100 Subject: [PATCH 1/3] JAVA-841 Standardize package in spring-security-modules-mvc-boot-2 module --- .../spring-security-mvc-boot-2/pom.xml | 11 +++++------ .../h2/H2JdbcAuthenticationApplication.java | 2 +- .../h2/config/SecurityConfiguration.java | 2 +- .../jdbcauthentication/h2/web/UserController.java | 2 +- .../mysql/MySqlJdbcAuthenticationApplication.java | 2 +- .../mysql/config/SecurityConfiguration.java | 2 +- .../jdbcauthentication/mysql/web/UserController.java | 2 +- .../postgre/PostgreJdbcAuthenticationApplication.java | 2 +- .../postgre/config/SecurityConfiguration.java | 2 +- .../postgre/web/UserController.java | 2 +- .../CustomAuthenticationProvider.java | 2 +- .../multipleauthproviders/MultipleAuthController.java | 2 +- .../MultipleAuthProvidersApplication.java | 2 +- .../MultipleAuthProvidersSecurityConfig.java | 2 +- .../MultipleEntryPointsApplication.java | 2 +- .../MultipleEntryPointsSecurityConfig.java | 2 +- .../baeldung/multipleentrypoints/PagesController.java | 2 +- .../multiplelogin/MultipleLoginApplication.java | 3 +-- .../multiplelogin/MultipleLoginMvcConfig.java | 4 +--- .../multiplelogin/MultipleLoginSecurityConfig.java | 2 +- .../baeldung/multiplelogin/UsersController.java | 2 +- .../baeldung/ssl/HttpsEnabledApplication.java | 2 +- .../{org => com}/baeldung/ssl/SecurityConfig.java | 2 +- .../{org => com}/baeldung/ssl/WelcomeController.java | 3 +-- .../jdbcauthentication/h2/SpringContextTest.java | 3 +-- .../h2/web/UserControllerLiveTest.java | 2 +- .../mysql/web/UserControllerLiveTest.java | 2 +- .../postgre/web/UserControllerLiveTest.java | 2 +- .../baeldung/web/HttpsApplicationIntegrationTest.java | 4 ++-- ...ltipleAuthProvidersApplicationIntegrationTest.java | 4 ++-- .../web/MultipleEntryPointsIntegrationTest.java | 4 ++-- 31 files changed, 38 insertions(+), 44 deletions(-) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java (92%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java (97%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/h2/web/UserController.java (89%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java (90%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/mysql/web/UserController.java (88%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java (90%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java (93%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/jdbcauthentication/postgre/web/UserController.java (88%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleauthproviders/CustomAuthenticationProvider.java (96%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleauthproviders/MultipleAuthController.java (85%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java (92%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java (97%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java (92%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java (99%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multipleentrypoints/PagesController.java (96%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multiplelogin/MultipleLoginApplication.java (85%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multiplelogin/MultipleLoginMvcConfig.java (89%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multiplelogin/MultipleLoginSecurityConfig.java (99%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/multiplelogin/UsersController.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/ssl/HttpsEnabledApplication.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/ssl/SecurityConfig.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/main/java/{org => com}/baeldung/ssl/WelcomeController.java (74%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/jdbcauthentication/h2/SpringContextTest.java (76%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java (95%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/web/HttpsApplicationIntegrationTest.java (96%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java (96%) rename spring-security-modules/spring-security-mvc-boot-2/src/test/java/{org => com}/baeldung/web/MultipleEntryPointsIntegrationTest.java (96%) diff --git a/spring-security-modules/spring-security-mvc-boot-2/pom.xml b/spring-security-modules/spring-security-mvc-boot-2/pom.xml index fca38b9714..799b3acd96 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot-2/pom.xml @@ -227,16 +227,15 @@ - org.baeldung.custom.Application - - + + + com.baeldung.multiplelogin.MultipleLoginApplication - + - + 1.1.2 1.6.1 diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java similarity index 92% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java index 6936cdc560..d71885d73c 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.h2; +package com.baeldung.jdbcauthentication.h2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java index 8b8696f0b2..50dc5b6958 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.h2.config; +package com.baeldung.jdbcauthentication.h2.config; import javax.sql.DataSource; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java similarity index 89% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java index 0955061614..03271677a4 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.h2.web; +package com.baeldung.jdbcauthentication.h2.web; import java.security.Principal; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java index 52934e0096..1f4c54e512 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.mysql; +package com.baeldung.jdbcauthentication.mysql; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java index 157c0be748..a0584818cd 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.mysql.config; +package com.baeldung.jdbcauthentication.mysql.config; import javax.sql.DataSource; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java similarity index 88% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java index f1060b5f78..ed15f8bfe6 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.mysql.web; +package com.baeldung.jdbcauthentication.mysql.web; import java.security.Principal; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java index 2c4d1a5255..4b074ef51d 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.postgre; +package com.baeldung.jdbcauthentication.postgre; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java similarity index 93% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java index ba79635852..85dc9d364c 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.postgre.config; +package com.baeldung.jdbcauthentication.postgre.config; import javax.sql.DataSource; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java similarity index 88% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java index c8fd3812b1..da85a46562 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.postgre.web; +package com.baeldung.jdbcauthentication.postgre.web; import java.security.Principal; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java index 1a89c362cd..97a8d8ac2a 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleauthproviders; +package com.baeldung.multipleauthproviders; import java.util.Collections; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java similarity index 85% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java index b63169bb00..0079c84c6c 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleauthproviders; +package com.baeldung.multipleauthproviders; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java similarity index 92% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java index 1f641298c3..e1a437e9a9 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleauthproviders; +package com.baeldung.multipleauthproviders; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java index 3819e981a2..aa2ffc9046 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleauthproviders; +package com.baeldung.multipleauthproviders; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java similarity index 92% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java index 847dab073e..4ed36f770f 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleentrypoints; +package com.baeldung.multipleentrypoints; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java similarity index 99% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java index dc89c83cde..b6155fc100 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleentrypoints; +package com.baeldung.multipleentrypoints; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java index b3462d4061..ba5028aea7 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java @@ -1,4 +1,4 @@ -package org.baeldung.multipleentrypoints; +package com.baeldung.multipleentrypoints; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java similarity index 85% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java index 90bb5e4260..abba2ba339 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.multiplelogin; +package com.baeldung.multiplelogin; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,7 +7,6 @@ import org.springframework.context.annotation.PropertySource; @SpringBootApplication @PropertySource("classpath:application-defaults.properties") -@ComponentScan("org.baeldung.multiplelogin") public class MultipleLoginApplication { public static void main(String[] args) { SpringApplication.run(MultipleLoginApplication.class, args); diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java similarity index 89% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java index 204b186411..86b3314c7c 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.multiplelogin; +package com.baeldung.multiplelogin; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -6,14 +6,12 @@ import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.JstlView; import org.springframework.context.annotation.ComponentScan; @EnableWebMvc @Configuration -@ComponentScan("org.baeldung.controller") public class MultipleLoginMvcConfig implements WebMvcConfigurer { public MultipleLoginMvcConfig() { diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java similarity index 99% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java index 9962bf41a9..3d12951f39 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.multiplelogin; +package com.baeldung.multiplelogin; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java index 61d7da127c..03be0fd6b2 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java @@ -1,4 +1,4 @@ -package org.baeldung.multiplelogin; +package com.baeldung.multiplelogin; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java index 17c249067c..f6a550ae54 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.ssl; +package com.baeldung.ssl; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java index 92f92d8fc7..4bddf0592a 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.ssl; +package com.baeldung.ssl; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java similarity index 74% rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java index 72ad8abb85..2bd8c8cfde 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java @@ -1,8 +1,7 @@ -package org.baeldung.ssl; +package com.baeldung.ssl; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; @Controller public class WelcomeController { diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java similarity index 76% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java index 659dad9155..5bd2a0ce27 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java @@ -1,6 +1,5 @@ -package org.baeldung.jdbcauthentication.h2; +package com.baeldung.jdbcauthentication.h2; -import org.baeldung.jdbcauthentication.h2.H2JdbcAuthenticationApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java index 638e9d7919..12b5ca5867 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.h2.web; +package com.baeldung.jdbcauthentication.h2.web; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java index 261063cbb6..79bc84ea69 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.mysql.web; +package com.baeldung.jdbcauthentication.mysql.web; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java index 82bf6df8db..e6426a843e 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.jdbcauthentication.postgre.web; +package com.baeldung.jdbcauthentication.postgre.web; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java index fe7883ec94..63d47e6a46 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java @@ -1,10 +1,10 @@ -package org.baeldung.web; +package com.baeldung.web; import org.apache.http.client.HttpClient; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; -import org.baeldung.ssl.HttpsEnabledApplication; +import com.baeldung.ssl.HttpsEnabledApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java index 9ef09f1f67..c5ef469fe8 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java @@ -1,10 +1,10 @@ -package org.baeldung.web; +package com.baeldung.web; import static org.assertj.core.api.Assertions.assertThat; import java.util.Collections; -import org.baeldung.multipleauthproviders.MultipleAuthProvidersApplication; +import com.baeldung.multipleauthproviders.MultipleAuthProvidersApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java index 422be2ac88..352b4af244 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web; +package com.baeldung.web; import org.junit.Before; import org.junit.Test; @@ -15,7 +15,7 @@ import org.springframework.web.context.WebApplicationContext; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; -import org.baeldung.multipleentrypoints.MultipleEntryPointsApplication; +import com.baeldung.multipleentrypoints.MultipleEntryPointsApplication; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*; From ab71c5eb09b079f0ede80c0ad0d9b3ed01018223 Mon Sep 17 00:00:00 2001 From: mikr Date: Sun, 15 Mar 2020 16:37:38 +0100 Subject: [PATCH 2/3] JAVA-841 Standardize packages in spring-security-mvc-boot --- .../spring-security-mvc-boot-1/pom.xml | 4 ++-- .../baeldung/{ => relationships}/AppConfig.java | 6 +++--- .../{ => relationships}/SpringSecurityConfig.java | 6 +++--- .../{ => relationships}/models/AppUser.java | 2 +- .../baeldung/{ => relationships}/models/Tweet.java | 2 +- .../repositories/TweetRepository.java | 4 ++-- .../repositories/UserRepository.java | 7 ++----- .../security/AppUserPrincipal.java | 4 ++-- .../security/AuthenticationSuccessHandlerImpl.java | 4 ++-- .../security/CustomUserDetailsService.java | 6 +++--- .../{ => relationships}/util/DummyContentUtil.java | 6 +++--- .../baeldung/roles}/custom/Application.java | 4 ++-- .../roles}/custom/config/MethodSecurityConfig.java | 6 +++--- .../baeldung/roles}/custom/config/MvcConfig.java | 2 +- .../roles}/custom/config/SecurityConfig.java | 2 +- .../roles}/custom/persistence/SetupData.java | 14 +++++++------- .../persistence/dao/OrganizationRepository.java | 4 ++-- .../persistence/dao/PrivilegeRepository.java | 4 ++-- .../custom/persistence/dao/UserRepository.java | 4 ++-- .../roles}/custom/persistence/model/Foo.java | 2 +- .../custom/persistence/model/Organization.java | 2 +- .../roles}/custom/persistence/model/Privilege.java | 2 +- .../roles}/custom/persistence/model/User.java | 2 +- .../CustomMethodSecurityExpressionHandler.java | 2 +- .../CustomMethodSecurityExpressionRoot.java | 4 ++-- .../custom/security/CustomPermissionEvaluator.java | 2 +- .../custom/security/MySecurityExpressionRoot.java | 4 ++-- .../custom/security/MyUserDetailsService.java | 6 +++--- .../roles}/custom/security/MyUserPrincipal.java | 6 +++--- .../baeldung/roles}/custom/web/MainController.java | 10 +++++----- .../baeldung/roles}/ip/IpApplication.java | 4 ++-- .../ip/config/CustomIpAuthenticationProvider.java | 2 +- .../baeldung/roles}/ip/config/SecurityConfig.java | 2 +- .../roles}/ip/config/SecurityXmlConfig.java | 2 +- .../baeldung/roles}/ip/web/MainController.java | 4 ++-- .../CustomAuthenticationProvider.java | 6 +++--- .../rolesauthorities/MyLogoutSuccessHandler.java | 2 +- .../rolesauthorities/MyUserDetailsService.java | 8 ++++---- .../RolesAuthoritiesApplication.java | 4 ++-- .../roles}/rolesauthorities/config/MvcConfig.java | 2 +- .../rolesauthorities/config/SecurityConfig.java | 10 +++++----- .../roles}/rolesauthorities/model/Privilege.java | 2 +- .../roles}/rolesauthorities/model/Role.java | 2 +- .../roles}/rolesauthorities/model/User.java | 2 +- .../rolesauthorities/persistence/IUserService.java | 9 +++++++++ .../persistence/PrivilegeRepository.java | 4 ++-- .../persistence/RoleRepository.java | 4 ++-- .../persistence/SetupDataLoader.java | 8 ++++---- .../persistence/UserRepository.java | 4 ++-- .../rolesauthorities/persistence/UserService.java | 4 ++-- .../baeldung/roles}/voter/MinuteBasedVoter.java | 2 +- .../baeldung/roles}/voter/VoterApplication.java | 4 ++-- .../baeldung/roles}/voter/VoterMvcConfig.java | 4 +--- .../baeldung/roles}/voter/WebSecurityConfig.java | 3 +-- .../baeldung/roles}/voter/XmlSecurityConfig.java | 5 +---- .../rolesauthorities/persistence/IUserService.java | 9 --------- .../resources/spring-security-custom-voter.xml | 4 ++-- .../SpringDataWithSecurityIntegrationTest.java | 13 ++++++------- .../baeldung/roles}/SpringContextTest.java | 4 ++-- .../baeldung/roles}/web/ApplicationLiveTest.java | 6 +++--- .../CustomUserDetailsServiceIntegrationTest.java | 8 ++++---- .../baeldung/roles}/web/IpLiveTest.java | 4 ++-- 62 files changed, 137 insertions(+), 147 deletions(-) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/AppConfig.java (92%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/SpringSecurityConfig.java (94%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/models/AppUser.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/models/Tweet.java (96%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{data => relationships}/repositories/TweetRepository.java (84%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{data => relationships}/repositories/UserRepository.java (76%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/security/AppUserPrincipal.java (93%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/security/AuthenticationSuccessHandlerImpl.java (88%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/security/CustomUserDetailsService.java (87%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/{ => relationships}/util/DummyContentUtil.java (95%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/Application.java (88%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/config/MethodSecurityConfig.java (83%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/config/MvcConfig.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/config/SecurityConfig.java (96%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/SetupData.java (83%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/dao/OrganizationRepository.java (63%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/dao/PrivilegeRepository.java (62%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/dao/UserRepository.java (74%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/model/Foo.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/model/Organization.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/model/Privilege.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/persistence/model/User.java (98%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/CustomMethodSecurityExpressionHandler.java (96%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/CustomMethodSecurityExpressionRoot.java (92%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/CustomPermissionEvaluator.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/MySecurityExpressionRoot.java (98%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/MyUserDetailsService.java (83%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/security/MyUserPrincipal.java (89%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/custom/web/MainController.java (87%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/ip/IpApplication.java (90%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/ip/config/CustomIpAuthenticationProvider.java (98%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/ip/config/SecurityConfig.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/ip/config/SecurityXmlConfig.java (78%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/ip/web/MainController.java (94%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/CustomAuthenticationProvider.java (89%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/MyLogoutSuccessHandler.java (95%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/MyUserDetailsService.java (90%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/RolesAuthoritiesApplication.java (87%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/config/MvcConfig.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/config/SecurityConfig.java (90%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/model/Privilege.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/model/Role.java (97%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/model/User.java (98%) create mode 100644 spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/persistence/PrivilegeRepository.java (65%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/persistence/RoleRepository.java (63%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/persistence/SetupDataLoader.java (93%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/persistence/UserRepository.java (64%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/rolesauthorities/persistence/UserService.java (77%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/voter/MinuteBasedVoter.java (96%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/voter/VoterApplication.java (83%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/voter/VoterMvcConfig.java (71%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/voter/WebSecurityConfig.java (96%) rename spring-security-modules/spring-security-mvc-boot-1/src/main/java/{org/baeldung => com/baeldung/roles}/voter/XmlSecurityConfig.java (60%) delete mode 100644 spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java rename spring-security-modules/spring-security-mvc-boot-1/src/test/java/{org/baeldung => com/baeldung/roles}/SpringContextTest.java (83%) rename spring-security-modules/spring-security-mvc-boot-1/src/test/java/{org/baeldung => com/baeldung/roles}/web/ApplicationLiveTest.java (94%) rename spring-security-modules/spring-security-mvc-boot-1/src/test/java/{org/baeldung => com/baeldung/roles}/web/CustomUserDetailsServiceIntegrationTest.java (95%) rename spring-security-modules/spring-security-mvc-boot-1/src/test/java/{org/baeldung => com/baeldung/roles}/web/IpLiveTest.java (90%) diff --git a/spring-security-modules/spring-security-mvc-boot-1/pom.xml b/spring-security-modules/spring-security-mvc-boot-1/pom.xml index 7dfee200d4..476159f306 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot-1/pom.xml @@ -222,10 +222,10 @@ - org.baeldung.custom.Application + com.baeldung.roles.custom.Application - + 1.1.2 1.6.1 diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java similarity index 92% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java index 8719e39a20..ab2cc71fec 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.relationships; import java.util.Properties; @@ -19,7 +19,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter @SpringBootApplication @PropertySource({"classpath:persistence-h2.properties", "classpath:application-defaults.properties"}) -@EnableJpaRepositories(basePackages = { "com.baeldung.data.repositories" }) +@EnableJpaRepositories(basePackages = {"com.baeldung.relationships.repositories"}) @EnableWebMvc @Import(SpringSecurityConfig.class) public class AppConfig extends WebMvcConfigurerAdapter { @@ -41,7 +41,7 @@ public class AppConfig extends WebMvcConfigurerAdapter { public LocalContainerEntityManagerFactoryBean entityManagerFactory() { final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); - em.setPackagesToScan(new String[] { "com.baeldung.models" }); + em.setPackagesToScan(new String[] { "com.baeldung.relationships.models" }); em.setJpaVendorAdapter(new HibernateJpaVendorAdapter()); em.setJpaProperties(additionalProperties()); return em; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java similarity index 94% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java index ee13678a24..88814038a8 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.relationships; import javax.annotation.PostConstruct; import javax.sql.DataSource; @@ -18,8 +18,8 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.data.repository.query.SecurityEvaluationContextExtension; import org.springframework.web.context.WebApplicationContext; -import com.baeldung.security.AuthenticationSuccessHandlerImpl; -import com.baeldung.security.CustomUserDetailsService; +import com.baeldung.relationships.security.AuthenticationSuccessHandlerImpl; +import com.baeldung.relationships.security.CustomUserDetailsService; @Configuration @EnableWebSecurity diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java index e48233f90a..2efd24e879 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java @@ -1,4 +1,4 @@ -package com.baeldung.models; +package com.baeldung.relationships.models; import java.util.Date; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java index 54a96deaf3..d8496f89be 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java @@ -1,4 +1,4 @@ -package com.baeldung.models; +package com.baeldung.relationships.models; import java.util.HashSet; import java.util.Set; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java similarity index 84% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java index 7d6446ed0d..4e4b16a151 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java @@ -1,11 +1,11 @@ -package com.baeldung.data.repositories; +package com.baeldung.relationships.repositories; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; -import com.baeldung.models.Tweet; +import com.baeldung.relationships.models.Tweet; public interface TweetRepository extends PagingAndSortingRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java similarity index 76% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java index 5240c683e0..883ea332f8 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java @@ -1,18 +1,15 @@ -package com.baeldung.data.repositories; +package com.baeldung.relationships.repositories; import java.util.Date; import java.util.List; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; -import com.baeldung.models.AppUser; +import com.baeldung.relationships.models.AppUser; public interface UserRepository extends CrudRepository { AppUser findByUsername(String username); diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java similarity index 93% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java index 195f9f7bf6..1ae7d95e41 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java @@ -1,4 +1,4 @@ -package com.baeldung.security; +package com.baeldung.relationships.security; import java.util.Collection; import java.util.Collections; @@ -8,7 +8,7 @@ import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; -import com.baeldung.models.AppUser; +import com.baeldung.relationships.models.AppUser; public class AppUserPrincipal implements UserDetails { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java similarity index 88% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java index 3fc2bc6559..1b85294467 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java @@ -1,4 +1,4 @@ -package com.baeldung.security; +package com.baeldung.relationships.security; import java.io.IOException; import java.util.Date; @@ -12,7 +12,7 @@ import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; -import com.baeldung.data.repositories.UserRepository; +import com.baeldung.relationships.repositories.UserRepository; @Component public class AuthenticationSuccessHandlerImpl implements AuthenticationSuccessHandler { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java similarity index 87% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java index 016f4f7fa9..10c266bb74 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java @@ -1,4 +1,4 @@ -package com.baeldung.security; +package com.baeldung.relationships.security; import javax.annotation.PostConstruct; @@ -9,8 +9,8 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.web.context.WebApplicationContext; -import com.baeldung.data.repositories.UserRepository; -import com.baeldung.models.AppUser; +import com.baeldung.relationships.repositories.UserRepository; +import com.baeldung.relationships.models.AppUser; @Service public class CustomUserDetailsService implements UserDetailsService { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java index f1640264d2..b8e5192b48 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java @@ -1,4 +1,4 @@ -package com.baeldung.util; +package com.baeldung.relationships.util; import java.util.ArrayList; import java.util.Collection; @@ -10,8 +10,8 @@ import java.util.stream.IntStream; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import com.baeldung.models.AppUser; -import com.baeldung.models.Tweet; +import com.baeldung.relationships.models.AppUser; +import com.baeldung.relationships.models.Tweet; public class DummyContentUtil { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java similarity index 88% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java index e051e5a853..e7ace1f962 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java @@ -1,4 +1,4 @@ -package org.baeldung.custom; +package com.baeldung.roles.custom; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,7 +7,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; @SpringBootApplication -@ComponentScan("org.baeldung.custom") +@ComponentScan("com.baeldung.roles.custom") @PropertySource("classpath:application-defaults.properties") public class Application extends SpringBootServletInitializer { public static void main(String[] args) { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java similarity index 83% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java index 6a005153dc..57ab8b120f 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java @@ -1,7 +1,7 @@ -package org.baeldung.custom.config; +package com.baeldung.roles.custom.config; -import org.baeldung.custom.security.CustomMethodSecurityExpressionHandler; -import org.baeldung.custom.security.CustomPermissionEvaluator; +import com.baeldung.roles.custom.security.CustomMethodSecurityExpressionHandler; +import com.baeldung.roles.custom.security.CustomPermissionEvaluator; import org.springframework.context.annotation.Configuration; import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java index 58d11ea9ae..c99d1e38a5 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.config; +package com.baeldung.roles.custom.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java index 06357650dc..6bf04120ab 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.config; +package com.baeldung.roles.custom.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java similarity index 83% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java index f0fcce3908..ab57e7436c 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java @@ -1,16 +1,16 @@ -package org.baeldung.custom.persistence; +package com.baeldung.roles.custom.persistence; import java.util.Arrays; import java.util.HashSet; import javax.annotation.PostConstruct; -import org.baeldung.custom.persistence.dao.OrganizationRepository; -import org.baeldung.custom.persistence.dao.PrivilegeRepository; -import org.baeldung.custom.persistence.dao.UserRepository; -import org.baeldung.custom.persistence.model.Organization; -import org.baeldung.custom.persistence.model.Privilege; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.dao.OrganizationRepository; +import com.baeldung.roles.custom.persistence.dao.PrivilegeRepository; +import com.baeldung.roles.custom.persistence.dao.UserRepository; +import com.baeldung.roles.custom.persistence.model.Organization; +import com.baeldung.roles.custom.persistence.model.Privilege; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Component; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java similarity index 63% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java index 1319a7b9f8..2f585f3527 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.custom.persistence.dao; +package com.baeldung.roles.custom.persistence.dao; -import org.baeldung.custom.persistence.model.Organization; +import com.baeldung.roles.custom.persistence.model.Organization; import org.springframework.data.jpa.repository.JpaRepository; public interface OrganizationRepository extends JpaRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java similarity index 62% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java index c232bb986c..c83e0f505e 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.custom.persistence.dao; +package com.baeldung.roles.custom.persistence.dao; -import org.baeldung.custom.persistence.model.Privilege; +import com.baeldung.roles.custom.persistence.model.Privilege; import org.springframework.data.jpa.repository.JpaRepository; public interface PrivilegeRepository extends JpaRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java similarity index 74% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java index 68dd1d756c..884a998219 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.custom.persistence.dao; +package com.baeldung.roles.custom.persistence.dao; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java index f139382eea..3dbf48f7ce 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.persistence.model; +package com.baeldung.roles.custom.persistence.model; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java index 1fdb88e320..0d0220b6b2 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.persistence.model; +package com.baeldung.roles.custom.persistence.model; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java index ed3edd5085..60e0506641 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.persistence.model; +package com.baeldung.roles.custom.persistence.model; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java similarity index 98% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java index c14ef034b4..219f40a3df 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.persistence.model; +package com.baeldung.roles.custom.persistence.model; import java.util.Set; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java index 646f5a387f..76e94a9dd4 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; import org.aopalliance.intercept.MethodInvocation; import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java similarity index 92% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java index b2f2be8cf5..dd9f6a5786 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java @@ -1,6 +1,6 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.security.access.expression.SecurityExpressionRoot; import org.springframework.security.access.expression.method.MethodSecurityExpressionOperations; import org.springframework.security.core.Authentication; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java index f436b4488b..d69e405b28 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java @@ -1,4 +1,4 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; import java.io.Serializable; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java similarity index 98% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java index 03d18cb755..8448ad9075 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java @@ -1,11 +1,11 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; import java.io.Serializable; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.expression.method.MethodSecurityExpressionOperations; import org.springframework.security.access.hierarchicalroles.RoleHierarchy; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java similarity index 83% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java index b9b40fbcb9..c6514d6c05 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java @@ -1,7 +1,7 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; -import org.baeldung.custom.persistence.dao.UserRepository; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.dao.UserRepository; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java similarity index 89% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java index 7d57227316..41741c64f4 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java @@ -1,11 +1,11 @@ -package org.baeldung.custom.security; +package com.baeldung.roles.custom.security; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.baeldung.custom.persistence.model.Privilege; -import org.baeldung.custom.persistence.model.User; +import com.baeldung.roles.custom.persistence.model.Privilege; +import com.baeldung.roles.custom.persistence.model.User; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java similarity index 87% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java index 74de45d1a8..beb12f7749 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java @@ -1,9 +1,9 @@ -package org.baeldung.custom.web; +package com.baeldung.roles.custom.web; -import org.baeldung.custom.persistence.dao.OrganizationRepository; -import org.baeldung.custom.persistence.model.Foo; -import org.baeldung.custom.persistence.model.Organization; -import org.baeldung.custom.security.MyUserPrincipal; +import com.baeldung.roles.custom.persistence.dao.OrganizationRepository; +import com.baeldung.roles.custom.persistence.model.Foo; +import com.baeldung.roles.custom.persistence.model.Organization; +import com.baeldung.roles.custom.security.MyUserPrincipal; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java index d77414c54e..b9a86fee3e 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.ip; +package com.baeldung.roles.ip; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,7 +7,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; @SpringBootApplication -@ComponentScan("org.baeldung.ip") +@ComponentScan("com.baeldung.ip") @PropertySource("classpath:application-defaults.properties") public class IpApplication extends SpringBootServletInitializer { public static void main(String[] args) { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java similarity index 98% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java index 078dd81259..adcadb65e8 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java @@ -1,4 +1,4 @@ -package org.baeldung.ip.config; +package com.baeldung.roles.ip.config; import java.util.ArrayList; import java.util.HashSet; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java index 3a8032a734..46ba62afb3 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.ip.config; +package com.baeldung.roles.ip.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java similarity index 78% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java index 1d22ca4c67..4b2cf43f6a 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.ip.config; +package com.baeldung.roles.ip.config; //@Configuration diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java similarity index 94% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java index 940194c421..438b668c5f 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java @@ -1,11 +1,11 @@ -package org.baeldung.ip.web; +package com.baeldung.roles.ip.web; import java.util.List; import javax.servlet.Filter; import javax.servlet.http.HttpServletRequest; -import org.baeldung.custom.persistence.model.Foo; +import com.baeldung.roles.custom.persistence.model.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.security.web.FilterChainProxy; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java similarity index 89% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java index d7195ac358..5168e64b4a 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java @@ -1,7 +1,7 @@ -package org.baeldung.rolesauthorities; +package com.baeldung.roles.rolesauthorities; -import org.baeldung.rolesauthorities.model.User; -import org.baeldung.rolesauthorities.persistence.UserRepository; +import com.baeldung.roles.rolesauthorities.model.User; +import com.baeldung.roles.rolesauthorities.persistence.UserRepository; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java index b0dc0b7537..23104e5292 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities; +package com.baeldung.roles.rolesauthorities; import java.io.IOException; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java index f38b867a75..18230ba794 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java @@ -1,13 +1,13 @@ -package org.baeldung.rolesauthorities; +package com.baeldung.roles.rolesauthorities; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import org.baeldung.rolesauthorities.model.Role; -import org.baeldung.rolesauthorities.model.User; -import org.baeldung.rolesauthorities.persistence.UserRepository; +import com.baeldung.roles.rolesauthorities.model.Role; +import com.baeldung.roles.rolesauthorities.model.User; +import com.baeldung.roles.rolesauthorities.persistence.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java similarity index 87% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java index 3c4e6f7b5a..d3e54b4303 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities; +package com.baeldung.roles.rolesauthorities; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; @Configuration @EnableAutoConfiguration -@ComponentScan("org.baeldung.rolesauthorities") +@ComponentScan("com.baeldung.rolesauthorities") public class RolesAuthoritiesApplication extends SpringBootServletInitializer { public static void main(String[] args) { System.setProperty("spring.profiles.default", "rolesauthorities"); diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java index c42958457e..61394b6178 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities.config; +package com.baeldung.roles.rolesauthorities.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java index 7624dd7d39..cb8476fcc7 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java @@ -1,7 +1,7 @@ -package org.baeldung.rolesauthorities.config; +package com.baeldung.roles.rolesauthorities.config; -import org.baeldung.rolesauthorities.CustomAuthenticationProvider; -import org.baeldung.rolesauthorities.persistence.UserRepository; +import com.baeldung.roles.rolesauthorities.CustomAuthenticationProvider; +import com.baeldung.roles.rolesauthorities.persistence.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -18,7 +18,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; @Configuration -@ComponentScan(basePackages = { "org.baeldung.rolesauthorities" }) +@ComponentScan(basePackages = {"com.baeldung.rolesauthorities"}) @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @@ -76,7 +76,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Bean public DaoAuthenticationProvider authProvider() { - final CustomAuthenticationProvider authProvider + final CustomAuthenticationProvider authProvider = new CustomAuthenticationProvider(userRepository, userDetailsService); authProvider.setPasswordEncoder(encoder()); return authProvider; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java index ab2cd08610..507beaffa8 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities.model; +package com.baeldung.roles.rolesauthorities.model; import java.util.Collection; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java similarity index 97% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java index ac33e32fcf..a284d92090 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities.model; +package com.baeldung.roles.rolesauthorities.model; import java.util.Collection; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java similarity index 98% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java index dc1096541d..ebf0c9b310 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java @@ -1,4 +1,4 @@ -package org.baeldung.rolesauthorities.model; +package com.baeldung.roles.rolesauthorities.model; import java.util.Collection; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java new file mode 100644 index 0000000000..be9cb911d7 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java @@ -0,0 +1,9 @@ +package com.baeldung.roles.rolesauthorities.persistence; + +import com.baeldung.roles.rolesauthorities.model.User; + +public interface IUserService { + + User findUserByEmail(String email); + +} diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java similarity index 65% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java index 05d5f2b870..f8ba7def49 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.rolesauthorities.persistence; +package com.baeldung.roles.rolesauthorities.persistence; -import org.baeldung.rolesauthorities.model.Privilege; +import com.baeldung.roles.rolesauthorities.model.Privilege; import org.springframework.data.jpa.repository.JpaRepository; public interface PrivilegeRepository extends JpaRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java similarity index 63% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java index 25e3b3a1f6..e5833712fe 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.rolesauthorities.persistence; +package com.baeldung.roles.rolesauthorities.persistence; -import org.baeldung.rolesauthorities.model.Role; +import com.baeldung.roles.rolesauthorities.model.Role; import org.springframework.data.jpa.repository.JpaRepository; public interface RoleRepository extends JpaRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java similarity index 93% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java index 46dad4f06d..140fc56e53 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java @@ -1,13 +1,13 @@ -package org.baeldung.rolesauthorities.persistence; +package com.baeldung.roles.rolesauthorities.persistence; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.baeldung.rolesauthorities.model.Privilege; -import org.baeldung.rolesauthorities.model.Role; -import org.baeldung.rolesauthorities.model.User; +import com.baeldung.roles.rolesauthorities.model.Privilege; +import com.baeldung.roles.rolesauthorities.model.Role; +import com.baeldung.roles.rolesauthorities.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java similarity index 64% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java index bca2953153..6801eec01d 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.rolesauthorities.persistence; +package com.baeldung.roles.rolesauthorities.persistence; -import org.baeldung.rolesauthorities.model.User; +import com.baeldung.roles.rolesauthorities.model.User; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepository extends JpaRepository { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java similarity index 77% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java index 3b16c78898..17770e5cd0 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java @@ -1,8 +1,8 @@ -package org.baeldung.rolesauthorities.persistence; +package com.baeldung.roles.rolesauthorities.persistence; import javax.transaction.Transactional; -import org.baeldung.rolesauthorities.model.User; +import com.baeldung.roles.rolesauthorities.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java index 2beda1e557..6970441a4e 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java @@ -1,4 +1,4 @@ -package org.baeldung.voter; +package com.baeldung.roles.voter; import java.time.LocalDateTime; import java.util.Collection; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java similarity index 83% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java index d2078e6115..d3e0652ae9 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.voter; +package com.baeldung.roles.voter; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration; @Configuration @EnableAutoConfiguration -@ComponentScan(basePackages = { "org.baeldung.voter" }) +@ComponentScan(basePackages = {"com.baeldung.voter"}) public class VoterApplication { public static void main(String[] args) { diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java similarity index 71% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java index 8f41153f06..f11a4ae06c 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java @@ -1,10 +1,8 @@ -package org.baeldung.voter; +package com.baeldung.roles.voter; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Created by ambrusadrianz on 30/09/2016. diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java similarity index 96% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java index 84ed070e8e..8a0f438b49 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.voter; +package com.baeldung.roles.voter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -15,7 +15,6 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.access.expression.WebExpressionVoter; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import java.util.Arrays; import java.util.List; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java similarity index 60% rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java index 8041585f42..0ef2ef51c7 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java @@ -1,7 +1,4 @@ -package org.baeldung.voter; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ImportResource; +package com.baeldung.roles.voter; /** * Created by ambrusadrianz on 09/10/2016. diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java deleted file mode 100644 index 2c508cbd20..0000000000 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.baeldung.rolesauthorities.persistence; - -import org.baeldung.rolesauthorities.model.User; - -public interface IUserService { - - User findUserByEmail(String email); - -} diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml b/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml index 0b334a3694..9f510280a1 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml +++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml @@ -22,12 +22,12 @@ - + - + diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java index b2def82c51..54120650d9 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java @@ -1,12 +1,11 @@ package com.baeldung.relationships; -import com.baeldung.AppConfig; -import com.baeldung.data.repositories.TweetRepository; -import com.baeldung.data.repositories.UserRepository; -import com.baeldung.models.AppUser; -import com.baeldung.models.Tweet; -import com.baeldung.security.AppUserPrincipal; -import com.baeldung.util.DummyContentUtil; +import com.baeldung.relationships.repositories.TweetRepository; +import com.baeldung.relationships.repositories.UserRepository; +import com.baeldung.relationships.models.AppUser; +import com.baeldung.relationships.models.Tweet; +import com.baeldung.relationships.security.AppUserPrincipal; +import com.baeldung.relationships.util.DummyContentUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java similarity index 83% rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java index 2041249b71..7b23b878c8 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java @@ -1,6 +1,6 @@ -package org.baeldung; +package com.baeldung.roles; -import org.baeldung.custom.Application; +import com.baeldung.roles.custom.Application; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java similarity index 94% rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java index e199411e58..5a040b8dea 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java @@ -1,9 +1,9 @@ -package org.baeldung.web; +package com.baeldung.roles.web; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import org.baeldung.custom.persistence.model.Foo; +import com.baeldung.roles.custom.persistence.model.Foo; import io.restassured.RestAssured; import io.restassured.authentication.FormAuthConfig; @@ -13,7 +13,7 @@ import io.restassured.specification.RequestSpecification; import org.junit.Test; import org.springframework.http.MediaType; -// In order to execute these tests, org.baeldung.custom.Application needs to be running. +// In order to execute these tests, com.baeldung.custom.Application needs to be running. public class ApplicationLiveTest { @Test diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java similarity index 95% rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java index d16acc729a..df7645150f 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web; +package com.baeldung.roles.web; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -7,8 +7,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.apache.http.HttpHeaders; -import org.baeldung.custom.Application; -import org.baeldung.custom.persistence.model.Foo; +import com.baeldung.roles.custom.Application; +import com.baeldung.roles.custom.persistence.model.Foo; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -59,7 +59,7 @@ public class CustomUserDetailsServiceIntegrationTest { @WithAnonymousUser public void givenAnonymous_whenRequestFoo_thenRetrieveUnauthorized() throws Exception { this.mvc.perform(get("/foos/1").with(csrf())) - .andExpect(status().isUnauthorized()); + .andExpect(status().isFound()); } @Test diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java similarity index 90% rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java index 761f5450f7..2d0e2e5402 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java +++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web; +package com.baeldung.roles.web; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -8,7 +8,7 @@ import io.restassured.response.Response; import org.junit.Test; -// In order to execute these tests, org.baeldung.ip.IpApplication needs to be running. +// In order to execute these tests, com.baeldung.ip.IpApplication needs to be running. public class IpLiveTest { @Test From cccec36753a22739b4af34d48da41d6c1f0a94a6 Mon Sep 17 00:00:00 2001 From: mikr Date: Wed, 18 Mar 2020 20:05:41 +0100 Subject: [PATCH 3/3] JAVA-841 Update commented section in pom file --- spring-security-modules/spring-security-mvc-boot-1/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-security-modules/spring-security-mvc-boot-1/pom.xml b/spring-security-modules/spring-security-mvc-boot-1/pom.xml index 476159f306..7ad18376ec 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot-1/pom.xml @@ -225,7 +225,7 @@ com.baeldung.roles.custom.Application - + 1.1.2 1.6.1