simter-reactive-context

Simter reactive context api

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

tech.simter.reactive
ArtifactId

ArtifactId

simter-reactive-context
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

simter-reactive-context
Simter reactive context api
Project URL

Project URL

https://github.com/simter/simter-reactive-context
Project Organization

Project Organization

simter
Source Code Management

Source Code Management

https://github.com/simter/simter-reactive-context.git

Download simter-reactive-context

How to add to project

<!-- https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-context/ -->
<dependency>
    <groupId>tech.simter.reactive</groupId>
    <artifactId>simter-reactive-context</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-context/
implementation 'tech.simter.reactive:simter-reactive-context:1.1.0'
// https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-context/
implementation ("tech.simter.reactive:simter-reactive-context:1.1.0")
'tech.simter.reactive:simter-reactive-context:jar:1.1.0'
<dependency org="tech.simter.reactive" name="simter-reactive-context" rev="1.1.0">
  <artifact name="simter-reactive-context" type="jar" />
</dependency>
@Grapes(
@Grab(group='tech.simter.reactive', module='simter-reactive-context', version='1.1.0')
)
libraryDependencies += "tech.simter.reactive" % "simter-reactive-context" % "1.1.0"
[tech.simter.reactive/simter-reactive-context "1.1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
tech.simter : simter-exception jar 1.1.0
io.projectreactor : reactor-core jar
org.jetbrains.kotlin : kotlin-stdlib jar

test (2)

Group / Artifact Type Version
io.projectreactor : reactor-test jar
org.junit.jupiter : junit-jupiter jar

Project Modules

There are no modules declared in this project.

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
tech.simter.reactive

Versions

Version
1.1.0
1.0.0