You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@EnableReactiveMethodSecurity causes premature initialization of the ObservationRegistry and prevents it from being post-processed.
The preAuthorizeInterceptor bean defined in ReactiveAuthorizationManagerMethodSecurityConfiguration is an Advisor so it's created very early by the AOP infrastructure. It injects an ObjectProvider<ObservationRegistry> which should delay the creation of the ObservationRegistry. Unfortunately, this provider is passed into ReactiveAuthorizationManagerMethodSecurityConfiguration#manager which immediately calls getIfAvailable(). As a result the ObservationRegistry is created very early as part of setting up the AOP infrastructure and this prevents it from being post-processed.
@cse050 The fix will be in Spring Security 6.0.3 (check the milestone of this issue) which has not yet been released. Spring Security 6.0.3 is due to be released on April 17 which means it should be in Spring Boot 3.0.6
Describe the bug
@EnableReactiveMethodSecurity
causes premature initialization of theObservationRegistry
and prevents it from being post-processed.The
preAuthorizeInterceptor
bean defined inReactiveAuthorizationManagerMethodSecurityConfiguration
is anAdvisor
so it's created very early by the AOP infrastructure. It injects anObjectProvider<ObservationRegistry>
which should delay the creation of theObservationRegistry
. Unfortunately, this provider is passed intoReactiveAuthorizationManagerMethodSecurityConfiguration#manager
which immediately callsgetIfAvailable()
. As a result theObservationRegistry
is created very early as part of setting up the AOP infrastructure and this prevents it from being post-processed.To Reproduce
See the sample provided in spring-projects/spring-boot#34366.
Expected behavior
@EnableReactiveMethodSecurity
does not prevent theObservationRegistry
from being post-processed.Sample
See the sample provided in spring-projects/spring-boot#34366.
The text was updated successfully, but these errors were encountered: