Closed as not planned
Closed as not planned
Description
Currently we're trying to migrate our R2DBC application to JDBC because the MSSQL driver seems to be completely unusable. Right now everything looks fine except user auditing information. It seems the the security context information is simply missing if you try to access the ReactiveSecurityContextHolder
from a AuditorAware
implementation which @EnableJdbcAuditing
seem to require.
To wrap our blocking calls we use this simple pattern
Mono.fromCallable { thingRepository.save(Thing()) }
.subscribeOn(Schedulers.boundedElastic())
and our JDBC configuration looks like
@Configuration(proxyBeanMethods = false)
@EnableJdbcAuditing
class JdbcConfiguration {
@Bean
fun auditorAware(): AuditorAware<String> = AuditorAware {
ReactiveSecurityContextHolder.getContext()
.map { it.authentication.name }
.defaultIfEmpty("NOTHING")
.blockOptional()
}
}
We've had a look at the reactor context and it seems that it is properly filled in our code but missing in the AuditorAware
. Do you have any suggestions how we can bridge blocking auditing with reactive security?