Package org.bremersee.security.core
Class ReactiveUserContextCaller
- java.lang.Object
-
- org.bremersee.security.core.ReactiveUserContextCaller
-
@Validated public class ReactiveUserContextCaller extends Object
The reactive user context caller.- Author:
- Christian Bremer
-
-
Field Summary
Fields Modifier and Type Field Description static Supplier<reactor.core.publisher.Mono<Set<String>>>
EMPTY_GROUPS_SUPPLIER
The constant EMPTY_GROUPS_SUPPLIER.static Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>>
EMPTY_USER_CONTEXT_SUPPLIER
The constant EMPTY_USER_CONTEXT_SUPPLIER.static Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>>
FORBIDDEN_SUPPLIER
The constant FORBIDDEN_SUPPLIER.
-
Constructor Summary
Constructors Constructor Description ReactiveUserContextCaller()
Instantiates a new reactive user context caller.ReactiveUserContextCaller(Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Instantiates a new reactive user context caller.ReactiveUserContextCaller(Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Instantiates a new reactive user context caller.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> reactor.core.publisher.Flux<R>
manyWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function)
Many with user context flux.static <R> reactor.core.publisher.Flux<R>
manyWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function, Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Many with user context flux.static <R> reactor.core.publisher.Flux<R>
manyWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function, Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Many with user context flux.<R> reactor.core.publisher.Mono<R>
oneWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function)
One with user context mono.static <R> reactor.core.publisher.Mono<R>
oneWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function, Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
One with user context mono.static <R> reactor.core.publisher.Mono<R>
oneWithUserContext(@NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function, Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
One with user context mono.
-
-
-
Field Detail
-
EMPTY_GROUPS_SUPPLIER
public static final Supplier<reactor.core.publisher.Mono<Set<String>>> EMPTY_GROUPS_SUPPLIER
The constant EMPTY_GROUPS_SUPPLIER.
-
EMPTY_USER_CONTEXT_SUPPLIER
public static final Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> EMPTY_USER_CONTEXT_SUPPLIER
The constant EMPTY_USER_CONTEXT_SUPPLIER.
-
FORBIDDEN_SUPPLIER
public static final Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> FORBIDDEN_SUPPLIER
The constant FORBIDDEN_SUPPLIER.
-
-
Constructor Detail
-
ReactiveUserContextCaller
public ReactiveUserContextCaller()
Instantiates a new reactive user context caller.
-
ReactiveUserContextCaller
public ReactiveUserContextCaller(@Nullable Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Instantiates a new reactive user context caller.- Parameters:
groupsSupplier
- the groups supplierunauthenticatedSupplier
- the unauthenticated supplier
-
ReactiveUserContextCaller
public ReactiveUserContextCaller(@Nullable Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Instantiates a new reactive user context caller.- Parameters:
groupsFn
- the groups fnunauthenticatedSupplier
- the unauthenticated supplier
-
-
Method Detail
-
oneWithUserContext
public <R> reactor.core.publisher.Mono<R> oneWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function)
One with user context mono.- Type Parameters:
R
- the type parameter- Parameters:
function
- the function- Returns:
- the mono
-
oneWithUserContext
public static <R> reactor.core.publisher.Mono<R> oneWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function, @Nullable Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
One with user context mono.- Type Parameters:
R
- the type parameter- Parameters:
function
- the functiongroupsFn
- the groups fnunauthenticatedSupplier
- the unauthenticated supplier- Returns:
- the mono
-
oneWithUserContext
public static <R> reactor.core.publisher.Mono<R> oneWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends reactor.core.publisher.Mono<R>> function, @Nullable Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
One with user context mono.- Type Parameters:
R
- the type parameter- Parameters:
function
- the functiongroupsSupplier
- the groups supplierunauthenticatedSupplier
- the unauthenticated supplier- Returns:
- the mono
-
manyWithUserContext
public <R> reactor.core.publisher.Flux<R> manyWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function)
Many with user context flux.- Type Parameters:
R
- the type parameter- Parameters:
function
- the function- Returns:
- the flux
-
manyWithUserContext
public static <R> reactor.core.publisher.Flux<R> manyWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function, @Nullable Function<org.springframework.security.core.Authentication,reactor.core.publisher.Mono<Set<String>>> groupsFn, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Many with user context flux.- Type Parameters:
R
- the type parameter- Parameters:
function
- the functiongroupsFn
- the groups fnunauthenticatedSupplier
- the unauthenticated supplier- Returns:
- the flux
-
manyWithUserContext
public static <R> reactor.core.publisher.Flux<R> manyWithUserContext(@NotNull @NotNull Function<org.bremersee.security.core.UserContext,? extends org.reactivestreams.Publisher<R>> function, @Nullable Supplier<reactor.core.publisher.Mono<Set<String>>> groupsSupplier, @Nullable Supplier<reactor.core.publisher.Mono<org.bremersee.security.core.UserContext>> unauthenticatedSupplier)
Many with user context flux.- Type Parameters:
R
- the type parameter- Parameters:
function
- the functiongroupsSupplier
- the groups supplierunauthenticatedSupplier
- the unauthenticated supplier- Returns:
- the flux
-
-