Merge pull request #8921 from dupirefr/team/JAVA-961-standardize_packages_in_spring_security_modules-part_2
[JAVA-961] standardize packages in spring security modules - Part 2
This commit is contained in:
commit
1807233610
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.acl;
|
||||
package com.baeldung.acl;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.acl.config;
|
||||
package com.baeldung.acl.config;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.acl.config;
|
||||
package com.baeldung.acl.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.acl.config;
|
||||
package com.baeldung.acl.config;
|
||||
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -8,9 +8,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@EnableJpaRepositories(basePackages = "org.baeldung.acl.persistence.dao")
|
||||
@PropertySource("classpath:org.baeldung.acl.datasource.properties")
|
||||
@EntityScan(basePackages={ "org.baeldung.acl.persistence.entity" })
|
||||
@EnableJpaRepositories(basePackages = "com.baeldung.acl.persistence.dao")
|
||||
@PropertySource("classpath:com.baeldung.acl.datasource.properties")
|
||||
@EntityScan(basePackages={ "com.baeldung.acl.persistence.entity" })
|
||||
public class JPAPersistenceConfig {
|
||||
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.acl.persistence.dao;
|
||||
package com.baeldung.acl.persistence.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.acl.persistence.entity.NoticeMessage;
|
||||
import com.baeldung.acl.persistence.entity.NoticeMessage;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.security.access.prepost.PostAuthorize;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.acl.persistence.entity;
|
||||
package com.baeldung.acl.persistence.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
|
@ -4,7 +4,7 @@ INSERT INTO acl_sid (id, principal, sid) VALUES
|
|||
(3, 0, 'ROLE_EDITOR');
|
||||
|
||||
INSERT INTO acl_class (id, class) VALUES
|
||||
(1, 'org.baeldung.acl.persistence.entity.NoticeMessage');
|
||||
(1, 'com.baeldung.acl.persistence.entity.NoticeMessage');
|
||||
|
||||
INSERT INTO system_message(id,content) VALUES
|
||||
(1,'First Level Message'),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.acl.Application;
|
||||
import com.baeldung.acl.Application;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
@ -1,12 +1,12 @@
|
|||
package org.baeldung.acl;
|
||||
package com.baeldung.acl;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.acl.persistence.dao.NoticeMessageRepository;
|
||||
import org.baeldung.acl.persistence.entity.NoticeMessage;
|
||||
import com.baeldung.acl.persistence.dao.NoticeMessageRepository;
|
||||
import com.baeldung.acl.persistence.entity.NoticeMessage;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -39,7 +39,7 @@ public class SpringACLIntegrationTest extends AbstractJUnit4SpringContextTests{
|
|||
private static String EDITTED_CONTENT = "EDITED";
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.acl.*")
|
||||
@ComponentScan("com.baeldung.acl.*")
|
||||
public static class SpringConfig {
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.config;
|
||||
package com.baeldung.config;
|
||||
|
||||
import org.baeldung.security.DummyUserDetailsService;
|
||||
import com.baeldung.security.DummyUserDetailsService;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.FileSystemResource;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.userdetails.User;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.controller;
|
||||
package com.baeldung.controller;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.Arrays;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
|
@ -1,5 +1,6 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import com.baeldung.SampleLDAPApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.baeldung.web.interceptor.LoggerInterceptor;
|
||||
import org.baeldung.web.interceptor.SessionTimerInterceptor;
|
||||
import org.baeldung.web.interceptor.UserInterceptor;
|
||||
import com.baeldung.web.interceptor.LoggerInterceptor;
|
||||
import com.baeldung.web.interceptor.SessionTimerInterceptor;
|
||||
import com.baeldung.web.interceptor.UserInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -16,7 +16,7 @@ import org.springframework.web.servlet.view.JstlView;
|
|||
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.web.controller")
|
||||
@ComponentScan("com.baeldung.web.controller")
|
||||
public class MvcConfig implements WebMvcConfigurer {
|
||||
|
||||
public MvcConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
@ -1,6 +1,7 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler;
|
||||
import com.baeldung.security.MySimpleUrlAuthenticationSuccessHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.baeldung.web.dto.Foo;
|
||||
import com.baeldung.web.dto.Foo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.http.HttpStatus;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.dto;
|
||||
package com.baeldung.web.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import org.slf4j.Logger;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
</http>
|
||||
|
||||
<beans:bean id="myAuthenticationSuccessHandler" class="org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler"/>
|
||||
<beans:bean id="myAuthenticationSuccessHandler" class="com.baeldung.security.MySimpleUrlAuthenticationSuccessHandler"/>
|
||||
|
||||
<authentication-manager id="authenticationManager">
|
||||
<authentication-provider>
|
||||
|
@ -33,8 +33,7 @@
|
|||
</authentication-provider>
|
||||
</authentication-manager>
|
||||
|
||||
<!-- <mvc:interceptors>
|
||||
<bean id="loggerInterceptor" class="org.baeldung.web.interceptor.LoggerInterceptor" />
|
||||
<!-- <mvc:interceptors>
|
||||
<bean id="loggerInterceptor" class="com.baeldung.web.interceptor.LoggerInterceptor" />
|
||||
</mvc:interceptors> -->
|
||||
|
||||
</beans:beans>
|
|
@ -20,7 +20,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import org.baeldung.spring.SecSecurityConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.spring.SecSecurityConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.security.csrf;
|
||||
package com.baeldung.security.csrf;
|
||||
|
||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
|
||||
import org.baeldung.web.dto.Foo;
|
||||
import com.baeldung.web.dto.Foo;
|
||||
import org.junit.Before;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.security.csrf;
|
||||
package com.baeldung.security.csrf;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.security.csrf;
|
||||
package com.baeldung.security.csrf;
|
||||
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.security.spring.SecurityWithCsrfConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.security.spring.SecurityWithCsrfConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security.spring;
|
||||
package com.baeldung.security.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.security.spring;
|
||||
package com.baeldung.security.spring;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security.spring;
|
||||
package com.baeldung.security.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security.spring;
|
||||
package com.baeldung.security.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,12 +1,12 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.web.interceptor;
|
||||
package com.baeldung.web.interceptor;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.security.spring.SecurityWithoutCsrfConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.basic;
|
||||
package com.baeldung.basic;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.client;
|
||||
package com.baeldung.client;
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.client.AuthCache;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
|
@ -7,7 +7,7 @@ import org.apache.http.client.CredentialsProvider;
|
|||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.baeldung.client.HttpComponentsClientHttpRequestFactoryDigestAuth;
|
||||
import com.baeldung.client.HttpComponentsClientHttpRequestFactoryDigestAuth;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ImportResource;
|
|||
|
||||
@Configuration
|
||||
@ImportResource({ "classpath:webSecurityConfig.xml" })
|
||||
@ComponentScan("org.baeldung.security")
|
||||
@ComponentScan("com.baeldung.security")
|
||||
public class SecSecurityConfig {
|
||||
|
||||
public SecSecurityConfig() {
|
|
@ -16,7 +16,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.spring.ClientConfig;
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import org.baeldung.spring.SecSecurityConfig;
|
||||
import com.baeldung.spring.ClientConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.spring.SecSecurityConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.client;
|
||||
package com.baeldung.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import org.apache.http.HttpResponse;
|
|||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.baeldung.spring.ClientConfig;
|
||||
import com.baeldung.spring.ClientConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -23,7 +23,7 @@
|
|||
<session-management session-fixation-protection="none"/>
|
||||
</http>
|
||||
|
||||
<beans:bean name="customLogoutSuccessHandler" class="org.baeldung.security.CustomLogoutSuccessHandler"/>
|
||||
<beans:bean name="customLogoutSuccessHandler" class="com.baeldung.security.CustomLogoutSuccessHandler"/>
|
||||
|
||||
<authentication-manager>
|
||||
<authentication-provider>
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
</http>
|
||||
|
||||
<beans:bean name="customLogoutSuccessHandler" class="org.baeldung.security.CustomLogoutSuccessHandler"/>
|
||||
<beans:bean name="customLogoutSuccessHandler" class="com.baeldung.security.CustomLogoutSuccessHandler"/>
|
||||
|
||||
<beans:bean name="customAccessDeniedHandler" class="org.baeldung.security.CustomAccessDeniedHandler" />
|
||||
<beans:bean name="customAccessDeniedHandler" class="com.baeldung.security.CustomAccessDeniedHandler" />
|
||||
|
||||
<beans:bean id="authenticationFailureHandler" name="customAuthenticationFaiureHandler" class="org.baeldung.security.CustomAuthenticationFailureHandler"/>
|
||||
<beans:bean id="authenticationFailureHandler" name="customAuthenticationFaiureHandler" class="com.baeldung.security.CustomAuthenticationFailureHandler"/>
|
||||
|
||||
<authentication-manager>
|
||||
<authentication-provider>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
|
||||
<context:component-scan base-package="org.baeldung.controller" />
|
||||
<context:component-scan base-package="com.baeldung.controller" />
|
||||
|
||||
</beans>
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.controller;
|
||||
package com.baeldung.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
/**
|
||||
* Simple enum of Security Roles available.
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.service;
|
||||
package com.baeldung.service;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.baeldung.security.SecurityRole;
|
||||
import com.baeldung.security.SecurityRole;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.User;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.web.servlet.view.JstlView;
|
|||
* Spring Web Configuration.
|
||||
*/
|
||||
@EnableWebMvc
|
||||
@ComponentScan("org.baeldung")
|
||||
@ComponentScan("com.baeldung")
|
||||
@Configuration
|
||||
public class MvcConfig extends WebMvcConfigurerAdapter {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
|
@ -19,7 +19,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import org.baeldung.spring.PersistenceConfig;
|
||||
import org.baeldung.spring.SecurityConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.spring.PersistenceConfig;
|
||||
import com.baeldung.spring.SecurityConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -13,7 +13,7 @@ public final class MetricRegistrySingleton {
|
|||
public static final MetricRegistry metrics = new MetricRegistry();
|
||||
|
||||
static {
|
||||
Logger logger = LoggerFactory.getLogger("org.baeldung.monitoring");
|
||||
Logger logger = LoggerFactory.getLogger("com.baeldung.monitoring");
|
||||
final Slf4jReporter reporter = Slf4jReporter.forRegistry(metrics).outputTo(logger).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build();
|
||||
reporter.start(5, TimeUnit.MINUTES);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
@ -60,7 +60,7 @@
|
|||
|
||||
<!-- <filter>
|
||||
<filter-name>SessionFilter</filter-name>
|
||||
<filter-class>org.baeldung.security.SessionFilter</filter-class>
|
||||
<filter-class>com.baeldung.security.SessionFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>SessionFilter</filter-name>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
|
@ -15,7 +15,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.spring.MvcConfig;
|
||||
import org.baeldung.spring.SecSecurityConfig;
|
||||
import com.baeldung.spring.MvcConfig;
|
||||
import com.baeldung.spring.SecSecurityConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.basic;
|
||||
package com.baeldung.basic;
|
||||
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.client;
|
||||
package com.baeldung.client;
|
||||
|
||||
import java.net.URI;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.client;
|
||||
package com.baeldung.client;
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.client.spring;
|
||||
package com.baeldung.client.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.client")
|
||||
@ComponentScan("com.baeldung.client")
|
||||
public class ClientConfig {
|
||||
|
||||
public ClientConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.filter;
|
||||
package com.baeldung.filter;
|
||||
|
||||
import org.springframework.web.filter.GenericFilterBean;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.filter;
|
||||
package com.baeldung.filter;
|
||||
|
||||
import org.baeldung.security.RestAuthenticationEntryPoint;
|
||||
import com.baeldung.security.RestAuthenticationEntryPoint;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ImportResource;
|
|||
|
||||
@Configuration
|
||||
@ImportResource({ "classpath:webSecurityConfig.xml" })
|
||||
@ComponentScan("org.baeldung.security")
|
||||
@ComponentScan("com.baeldung.security")
|
||||
public class SecSecurityConfig {
|
||||
|
||||
public SecSecurityConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring;
|
||||
package com.baeldung.spring;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ComponentScan("org.baeldung.web")
|
||||
@ComponentScan("com.baeldung.web")
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
public WebConfig() {
|
|
@ -1,9 +1,9 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.baeldung.web.dto.Bar;
|
||||
import com.baeldung.web.dto.Bar;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.http.HttpHeaders;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.web.controller;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import org.baeldung.web.dto.Foo;
|
||||
import com.baeldung.web.dto.Foo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.dto;
|
||||
package com.baeldung.web.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.web.dto;
|
||||
package com.baeldung.web.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -23,6 +23,6 @@
|
|||
|
||||
<global-method-security pre-post-annotations="enabled"/>
|
||||
|
||||
<beans:bean id="myBasicAuthenticationEntryPoint" class="org.baeldung.basic.MyBasicAuthenticationEntryPoint" />
|
||||
<beans:bean id="myBasicAuthenticationEntryPoint" class="com.baeldung.basic.MyBasicAuthenticationEntryPoint" />
|
||||
|
||||
</beans:beans>
|
|
@ -12,7 +12,7 @@
|
|||
</context-param>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>org.baeldung.spring</param-value>
|
||||
<param-value>com.baeldung.spring</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.config;
|
||||
package com.baeldung.config;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class MainWebAppInitializer implements WebApplicationInitializer {
|
|||
|
||||
// Create the 'root' Spring application context
|
||||
final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
|
||||
root.scan("org.baeldung.config.parent");
|
||||
root.scan("com.baeldung.config.parent");
|
||||
// root.getEnvironment().setDefaultProfiles("embedded");
|
||||
|
||||
// Manages the lifecycle of the root application context
|
||||
|
@ -38,7 +38,7 @@ public class MainWebAppInitializer implements WebApplicationInitializer {
|
|||
|
||||
// Handles requests into the application
|
||||
final AnnotationConfigWebApplicationContext childWebApplicationContext = new AnnotationConfigWebApplicationContext();
|
||||
childWebApplicationContext.scan("org.baeldung.config.child");
|
||||
childWebApplicationContext.scan("com.baeldung.config.child");
|
||||
final ServletRegistration.Dynamic appServlet = sc.addServlet("api", new DispatcherServlet(childWebApplicationContext));
|
||||
appServlet.setLoadOnStartup(1);
|
||||
final Set<String> mappingConflicts = appServlet.addMapping("/");
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.config.child;
|
||||
package com.baeldung.config.child;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.config.child;
|
||||
package com.baeldung.config.child;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import org.thymeleaf.templateresolver.ITemplateResolver;
|
|||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ComponentScan("org.baeldung.web")
|
||||
@ComponentScan("com.baeldung.web")
|
||||
//@ImportResource({ "classpath:prop.xml" })
|
||||
//@PropertySource("classpath:foo.properties")
|
||||
public class WebConfig implements WebMvcConfigurer {
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.config.parent;
|
||||
package com.baeldung.config.parent;
|
||||
|
||||
import org.baeldung.security.CustomAuthenticationProvider;
|
||||
import com.baeldung.security.CustomAuthenticationProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
|
|||
@Configuration
|
||||
//@ImportResource({ "classpath:webSecurityConfig.xml" })
|
||||
@EnableWebSecurity
|
||||
@ComponentScan("org.baeldung.security")
|
||||
@ComponentScan("com.baeldung.security")
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Autowired
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.config.parent;
|
||||
package com.baeldung.config.parent;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.context.annotation.PropertySource;
|
|||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.service")
|
||||
@ComponentScan("com.baeldung.service")
|
||||
// @ImportResource({ "classpath:prop.xml" })
|
||||
@PropertySource("classpath:foo.properties")
|
||||
public class ServiceConfig {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.security;
|
||||
package com.baeldung.security;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.service;
|
||||
package com.baeldung.service;
|
||||
|
||||
import org.baeldung.web.dto.Foo;
|
||||
import com.baeldung.web.dto.Foo;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue