simter-reactive-context
Simter reactive system-context. This package just has one tool class SystemContext. All the unit test is in the class SystemContextTest. Run test by mvn test
.
The base technique is from reactor's official document "Adding a Context to a Reactive Sequence".
SystemContext functions
fun getAuthenticatedUser() : Mono<Optional<User>>
fun hasAnyRole(vararg roles: String) : Mono<Boolean>
fun hasAllRole(vararg roles: String) : Mono<Boolean>
fun verifyHasAnyRole(vararg roles: String): Mono<Void>
fun verifyHasAllRole(vararg roles: String): Mono<Void>
Installation
<dependency>
<groupId>tech.simter.reactive</groupId>
<artifactId>simter-reactive-context</artifactId>
<version>1.0.0</version>
</dependency>
Requirement
- Maven 3.6+
- Kotlin 1.3+
- Reactor 3+
Build
mvn clean package