Class BoundedResourceRetriever

java.lang.Object
org.mockserver.authentication.BoundedResourceRetriever

public final class BoundedResourceRetriever extends Object
Bounded ResourceRetriever for control-plane JWK-set and OIDC discovery-document fetches.

Nimbus's default RemoteJWKSet retriever uses an INFINITE connect/read timeout and NO response size limit. These fetches happen on (or feed) the control-plane auth path, so an unreachable or hostile JWKS/discovery endpoint could hang the fetch indefinitely or stream an unbounded body — a DoS / SSRF-amplification vector. This retriever applies finite connect/read timeouts and a sane response size cap so a slow or oversized endpoint fails fast instead.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Connect timeout in milliseconds for control-plane JWKS / OIDC discovery fetches.
    static final int
    Read timeout in milliseconds for control-plane JWKS / OIDC discovery fetches.
    static final int
    Maximum response body size in bytes; a real JWK set / discovery document is a few KB.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.nimbusds.jose.util.DefaultResourceRetriever
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONNECT_TIMEOUT_MILLIS

      public static final int CONNECT_TIMEOUT_MILLIS
      Connect timeout in milliseconds for control-plane JWKS / OIDC discovery fetches.
      See Also:
    • READ_TIMEOUT_MILLIS

      public static final int READ_TIMEOUT_MILLIS
      Read timeout in milliseconds for control-plane JWKS / OIDC discovery fetches.
      See Also:
    • SIZE_LIMIT_BYTES

      public static final int SIZE_LIMIT_BYTES
      Maximum response body size in bytes; a real JWK set / discovery document is a few KB.
      See Also:
  • Method Details

    • create

      public static com.nimbusds.jose.util.DefaultResourceRetriever create()