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
  • Method Details

    • resolveToken

      @NonNull @NonNull CompletableFuture<String> resolveToken(@NonNull T request)
      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 Resolvers
      futureCsrfTokenResolvers - Reactive CSRF Token Resolvers
      Returns:
      Returns a List of FutureCsrfTokenResolver instances containing every reactive resolver plus the imperative resolvers adapted to imperative.