Skip to content

Commit

Permalink
Change EnableReactiveMethodSecurity Defaults
Browse files Browse the repository at this point in the history
Closes gh-12506
  • Loading branch information
jzheaux committed Jan 10, 2023
1 parent d1fc789 commit 5b6b3d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -73,6 +73,6 @@
* used.
* @since 5.8
*/
boolean useAuthorizationManager() default false;
boolean useAuthorizationManager() default true;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -78,8 +78,7 @@ public void notPublisherPreAuthorizeFindByIdThenThrowsIllegalStateException() {
.withMessage("The returnType class java.lang.String on public abstract java.lang.String "
+ "org.springframework.security.config.annotation.method.configuration.ReactiveMessageService"
+ ".notPublisherPreAuthorizeFindById(long) must return an instance of org.reactivestreams"
+ ".Publisher (i.e. Mono / Flux) or the function must be a Kotlin coroutine "
+ "function in order to support Reactor Context");
+ ".Publisher (for example, a Mono or Flux) in order to support Reactor Context");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,7 +38,8 @@ import org.springframework.test.context.junit.jupiter.SpringExtension

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

private lateinit var delegate: KotlinReactiveMessageService

Expand Down Expand Up @@ -211,7 +212,7 @@ class KotlinEnableReactiveMethodSecurityTests {
}

@Configuration
@EnableReactiveMethodSecurity
@EnableReactiveMethodSecurity(useAuthorizationManager = false)
open class Config {
var delegate = mockk<KotlinReactiveMessageService>()

Expand Down

0 comments on commit 5b6b3d5

Please sign in to comment.