mirror of
https://gitee.com/dcren/initializr.git
synced 2025-11-28 09:22:41 +08:00
Add support for Reactive security
Closes gh-460
This commit is contained in:
@@ -53,7 +53,8 @@ class SpringSecurityTestRequestPostProcessor implements ProjectRequestPostProces
|
|||||||
|
|
||||||
private boolean hasSpringSecurity(ProjectRequest request) {
|
private boolean hasSpringSecurity(ProjectRequest request) {
|
||||||
return request.getResolvedDependencies().stream()
|
return request.getResolvedDependencies().stream()
|
||||||
.anyMatch(d -> "security".equals(d.getId()));
|
.anyMatch(d -> "security".equals(d.getId())
|
||||||
|
|| "security-reactive".equals(d.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAtLeastAfter(ProjectRequest request, Version version) {
|
private boolean isAtLeastAfter(ProjectRequest request, Version version) {
|
||||||
|
|||||||
@@ -113,6 +113,11 @@ initializr:
|
|||||||
description: Authenticating a User with LDAP
|
description: Authenticating a User with LDAP
|
||||||
- rel: reference
|
- rel: reference
|
||||||
href: http://docs.spring.io/spring-boot/docs/{bootVersion}/reference/htmlsingle/#boot-features-security
|
href: http://docs.spring.io/spring-boot/docs/{bootVersion}/reference/htmlsingle/#boot-features-security
|
||||||
|
- name: Reactive Security
|
||||||
|
id: security-reactive
|
||||||
|
description: Secure your reactive application via spring-security-webflux
|
||||||
|
versionRange: 2.0.0.M5
|
||||||
|
weight: 90
|
||||||
- name: Aspects
|
- name: Aspects
|
||||||
id: aop
|
id: aop
|
||||||
description: Create your own Aspects using Spring AOP and AspectJ
|
description: Create your own Aspects using Spring AOP and AspectJ
|
||||||
|
|||||||
@@ -29,15 +29,23 @@ public class SpringSecurityTestRequestPostProcessorTests
|
|||||||
extends AbstractRequestPostProcessorTests {
|
extends AbstractRequestPostProcessorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void securityTestIsAdded() {
|
public void securityTestIsAddedWithSecurity() {
|
||||||
ProjectRequest request = createProjectRequest("security");
|
ProjectRequest request = createProjectRequest("security");
|
||||||
Dependency springSecurityTest = Dependency.withId(
|
|
||||||
"spring-security-test", "org.springframework.security", "spring-security-test");
|
|
||||||
springSecurityTest.setScope(Dependency.SCOPE_TEST);
|
|
||||||
generateMavenPom(request)
|
generateMavenPom(request)
|
||||||
.hasSpringBootStarterDependency("security")
|
.hasSpringBootStarterDependency("security")
|
||||||
.hasSpringBootStarterTest()
|
.hasSpringBootStarterTest()
|
||||||
.hasDependency(springSecurityTest)
|
.hasDependency(springSecurityTest())
|
||||||
|
.hasDependenciesCount(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void securityTestIsAddedWithSecurityReactive() {
|
||||||
|
ProjectRequest request = createProjectRequest("security-reactive");
|
||||||
|
request.setBootVersion("2.0.0.BUILD-SNAPSHOT");
|
||||||
|
generateMavenPom(request)
|
||||||
|
.hasSpringBootStarterDependency("security-reactive")
|
||||||
|
.hasSpringBootStarterTest()
|
||||||
|
.hasDependency(springSecurityTest())
|
||||||
.hasDependenciesCount(3);
|
.hasDependenciesCount(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,4 +68,12 @@ public class SpringSecurityTestRequestPostProcessorTests
|
|||||||
.hasDependenciesCount(2);
|
.hasDependenciesCount(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static Dependency springSecurityTest() {
|
||||||
|
Dependency dependency = Dependency.withId("spring-security-test",
|
||||||
|
"org.springframework.security", "spring-security-test");
|
||||||
|
dependency.setScope(Dependency.SCOPE_TEST);
|
||||||
|
return dependency;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user