Skip to content

Commit

Permalink
moved spring-security-web-jsonview module to spring-security-core (eu…
Browse files Browse the repository at this point in the history
…genp#10015)

* moved spring-security-web-jsonview module to spring-security-core

* removed deleted module from project build
  • Loading branch information
amit2103 authored Sep 14, 2020
1 parent 7b56a91 commit f47741a
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 318 deletions.
1 change: 0 additions & 1 deletion spring-security-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<module>spring-security-web-boot-2</module>
<module>spring-security-web-mvc-custom</module>
<module>spring-security-web-digest-auth</module>
<module>spring-security-web-jsonview</module>
<module>spring-security-ldap</module>
<module>spring-security-web-login</module>
<module>spring-security-web-persisted-remember-me</module>
Expand Down
1 change: 1 addition & 0 deletions spring-security-modules/spring-security-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This module contains articles about core Spring Security
- [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy)
- [Deny Access on Missing @PreAuthorize to Spring Controller Methods](https://www.baeldung.com/spring-deny-access)
- [Spring Security: Check If a User Has a Role in Java](https://www.baeldung.com/spring-security-check-user-role)
- [Filtering Jackson JSON Output Based on Spring Security Role](https://www.baeldung.com/spring-security-role-filter-json)

### Build the Project

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.baeldung.filterresponse;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class App {

public static void main(String[] args) {
SpringApplication.run(App.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.spring;
package com.baeldung.filterresponse.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
Expand All @@ -12,12 +12,10 @@
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;

@Configuration
@EnableWebMvc
@EnableWebSecurity
@ComponentScan("com.baeldung")
@ComponentScan("com.baeldung.filterresponse")
public class AppConfig extends WebSecurityConfigurerAdapter implements WebMvcConfigurer {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.baeldung.spring;
package com.baeldung.filterresponse.config;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

import com.baeldung.controller.View;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJacksonValue;
Expand All @@ -11,9 +14,7 @@
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.AbstractMappingJacksonResponseBodyAdvice;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import com.baeldung.filterresponse.controller.View;

@RestControllerAdvice
public class SecurityJsonViewControllerAdvice extends AbstractMappingJacksonResponseBodyAdvice {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.baeldung.controller;
package com.baeldung.filterresponse.controller;

import java.util.Arrays;
import java.util.Collection;

import com.baeldung.model.Item;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import com.baeldung.filterresponse.model.Item;

@RestController
public class ItemsController {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.baeldung.controller;
package com.baeldung.filterresponse.controller;

import com.baeldung.spring.AppConfig.Role;

import java.util.HashMap;
import java.util.Map;

import com.baeldung.filterresponse.config.AppConfig.Role;

public class View {

public static final Map<Role, Class> MAPPING = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.baeldung.model;
package com.baeldung.filterresponse.model;

import com.baeldung.controller.View;
import com.baeldung.filterresponse.controller.View;
import com.fasterxml.jackson.annotation.JsonView;

public class Item {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.baeldung.security;
package com.baeldung.filterresponse;

import com.baeldung.spring.AppConfig;
import com.baeldung.filterresponse.config.AppConfig;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Before;
Expand Down
13 changes: 0 additions & 13 deletions spring-security-modules/spring-security-web-jsonview/.gitignore

This file was deleted.

This file was deleted.

206 changes: 0 additions & 206 deletions spring-security-modules/spring-security-web-jsonview/pom.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit f47741a

Please sign in to comment.