Interface FutureCsrfTokenResolver<T>
- Type Parameters:
T
- request
- All Superinterfaces:
io.micronaut.core.order.Ordered
public interface FutureCsrfTokenResolver<T>
extends io.micronaut.core.order.Ordered
Attempts to resolve a CSRF token from the provided request.
FutureCsrfTokenResolver
is an Ordered
api. Override the Ordered.getOrder()
method to provide a custom order.- Since:
- 1.1.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NonNull List<FutureCsrfTokenResolver<T>>
of
(@NonNull List<CsrfTokenResolver<T>> resolvers, @NonNull List<FutureCsrfTokenResolver<T>> futureCsrfTokenResolvers) @NonNull CompletableFuture<String>
resolveToken
(T request) Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
resolveToken
- Parameters:
request
- The Request. Maybe an HTTP Request.- Returns:
- A CSRF token or an empty Optional if the token cannot be resolved.
-
of
@NonNull static <T> @NonNull List<FutureCsrfTokenResolver<T>> of(@NonNull @NonNull List<CsrfTokenResolver<T>> resolvers, @NonNull @NonNull List<FutureCsrfTokenResolver<T>> futureCsrfTokenResolvers) - Type Parameters:
T
- request type- Parameters:
resolvers
- Imperative CSRF Token ResolversfutureCsrfTokenResolvers
- Reactive CSRF Token Resolvers- Returns:
- Returns a List of
FutureCsrfTokenResolver
instances containing every reactive resolver plus the imperative resolvers adapted to imperative.
-