Interface HttpRequestFetchMetadataRule

All Superinterfaces:
FetchMetadataRule<io.micronaut.http.HttpRequest<?>>, io.micronaut.core.order.Ordered

public interface HttpRequestFetchMetadataRule extends FetchMetadataRule<io.micronaut.http.HttpRequest<?>>
A Fetch Metadata rule for HttpRequest instances.
Since:
5.6.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    check(io.micronaut.http.HttpRequest<?> request)
    Extracts SecFetch from the request and evaluates it.
    check(io.micronaut.http.HttpRequest<?> request, @Nullable io.micronaut.http.SecFetch secFetch)
    Evaluates the request and its parsed Fetch Metadata headers.

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Method Details

    • check

      default FetchMetadataRuleResult check(io.micronaut.http.HttpRequest<?> request)
      Extracts SecFetch from the request and evaluates it. When the Fetch Metadata filter evaluates the request, it parses the headers once and this method reuses that result.
      Specified by:
      check in interface FetchMetadataRule<io.micronaut.http.HttpRequest<?>>
      Parameters:
      request - the request to evaluate
      Returns:
      the rule result
    • check

      FetchMetadataRuleResult check(io.micronaut.http.HttpRequest<?> request, @Nullable io.micronaut.http.SecFetch secFetch)
      Evaluates the request and its parsed Fetch Metadata headers.

      Each component of secFetch is null when its header is absent or carries a value Micronaut does not recognize. A null component means "not classified", not "harmless": a rule should only allow a request based on the components it actually inspects, and return FetchMetadataRuleResult.UNKNOWN when one of them is null.

      Parameters:
      request - the request to evaluate
      secFetch - parsed Fetch Metadata, or null when the request carries no Fetch Metadata header
      Returns:
      the rule result