Skip to content

Commit 5b6b3d5

Browse files
committed
Change EnableReactiveMethodSecurity Defaults
Closes gh-12506
1 parent d1fc789 commit 5b6b3d5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

config/src/main/java/org/springframework/security/config/annotation/method/configuration/EnableReactiveMethodSecurity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -73,6 +73,6 @@
7373
* used.
7474
* @since 5.8
7575
*/
76-
boolean useAuthorizationManager() default false;
76+
boolean useAuthorizationManager() default true;
7777

7878
}

config/src/test/java/org/springframework/security/config/annotation/method/configuration/EnableReactiveMethodSecurityTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -78,8 +78,7 @@ public void notPublisherPreAuthorizeFindByIdThenThrowsIllegalStateException() {
7878
.withMessage("The returnType class java.lang.String on public abstract java.lang.String "
7979
+ "org.springframework.security.config.annotation.method.configuration.ReactiveMessageService"
8080
+ ".notPublisherPreAuthorizeFindById(long) must return an instance of org.reactivestreams"
81-
+ ".Publisher (i.e. Mono / Flux) or the function must be a Kotlin coroutine "
82-
+ "function in order to support Reactor Context");
81+
+ ".Publisher (for example, a Mono or Flux) in order to support Reactor Context");
8382
}
8483

8584
@Test
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,7 +38,8 @@ import org.springframework.test.context.junit.jupiter.SpringExtension
3838

3939
@ExtendWith(SpringExtension::class)
4040
@ContextConfiguration
41-
class KotlinEnableReactiveMethodSecurityTests {
41+
// no authorization manager due to https://github.com/spring-projects/spring-security/issues/12080
42+
class KotlinEnableReactiveMethodSecurityNoAuthorizationManagerTests {
4243

4344
private lateinit var delegate: KotlinReactiveMessageService
4445

@@ -211,7 +212,7 @@ class KotlinEnableReactiveMethodSecurityTests {
211212
}
212213

213214
@Configuration
214-
@EnableReactiveMethodSecurity
215+
@EnableReactiveMethodSecurity(useAuthorizationManager = false)
215216
open class Config {
216217
var delegate = mockk<KotlinReactiveMessageService>()
217218

0 commit comments

Comments
 (0)