Class EndpointRequest.EndpointRequestMatcher

java.lang.Object
org.springframework.boot.security.servlet.ApplicationContextRequestMatcher<org.springframework.web.context.WebApplicationContext>
org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.EndpointRequestMatcher
All Implemented Interfaces:
org.springframework.security.web.util.matcher.RequestMatcher
Enclosing class:
EndpointRequest

public static final class EndpointRequest.EndpointRequestMatcher extends ApplicationContextRequestMatcher<org.springframework.web.context.WebApplicationContext>
The request matcher used to match against actuator endpoints.
Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher

    org.springframework.security.web.util.matcher.RequestMatcher.MatchResult
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.security.web.util.matcher.RequestMatcher
    createDelegate(org.springframework.web.context.WebApplicationContext context, org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory)
     
    excluding(Class<?>... endpoints)
     
    excluding(String... endpoints)
     
     
    protected final List<org.springframework.security.web.util.matcher.RequestMatcher>
    getDelegateMatchers(org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory, RequestMatcherProvider matcherProvider, Set<String> paths, @Nullable org.springframework.http.HttpMethod httpMethod)
     
    protected org.springframework.boot.actuate.endpoint.EndpointId
     
    protected List<org.springframework.security.web.util.matcher.RequestMatcher>
    getLinksMatchers(org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory, RequestMatcherProvider matcherProvider, String basePath)
     
    getRequestMatcherProvider(org.springframework.web.context.WebApplicationContext context)
     
    protected final boolean
    hasWebServerNamespace(org.springframework.context.ApplicationContext applicationContext, org.springframework.boot.actuate.endpoint.web.WebServerNamespace webServerNamespace)
     
    protected boolean
    ignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext)
    Returns if the WebApplicationContext should be ignored and not used for matching.
    protected boolean
    ignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext, org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType managementPortType)
     
    protected final void
    initialized(Supplier<org.springframework.web.context.WebApplicationContext> context)
    Method that can be implemented by subclasses that wish to initialize items the first time that the matcher is called.
    protected final boolean
    matches(jakarta.servlet.http.HttpServletRequest request, Supplier<org.springframework.web.context.WebApplicationContext> context)
    Decides whether the rule implemented by the strategy matches the supplied request.
     
    protected String
    toString(List<Object> endpoints, String emptyValue)
     
    withHttpMethod(org.springframework.http.HttpMethod httpMethod)
    Restricts the matcher to only consider requests with a particular HTTP method.

    Methods inherited from class org.springframework.boot.security.servlet.ApplicationContextRequestMatcher

    matches

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher

    matcher
  • Method Details

    • excluding

      public EndpointRequest.EndpointRequestMatcher excluding(Class<?>... endpoints)
    • excluding

      public EndpointRequest.EndpointRequestMatcher excluding(String... endpoints)
    • excludingLinks

      public EndpointRequest.EndpointRequestMatcher excludingLinks()
    • withHttpMethod

      public EndpointRequest.EndpointRequestMatcher withHttpMethod(org.springframework.http.HttpMethod httpMethod)
      Restricts the matcher to only consider requests with a particular HTTP method.
      Parameters:
      httpMethod - the HTTP method to include
      Returns:
      a copy of the matcher further restricted to only match requests with the specified HTTP method
      Since:
      3.5.0
    • createDelegate

      protected org.springframework.security.web.util.matcher.RequestMatcher createDelegate(org.springframework.web.context.WebApplicationContext context, org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ignoreApplicationContext

      protected boolean ignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext)
      Description copied from class: ApplicationContextRequestMatcher
      Returns if the WebApplicationContext should be ignored and not used for matching. If this method returns true then the context will not be used and the matches method will return false.
      Overrides:
      ignoreApplicationContext in class ApplicationContextRequestMatcher<org.springframework.web.context.WebApplicationContext>
      Parameters:
      applicationContext - the candidate web application context
      Returns:
      if the application context should be ignored
    • ignoreApplicationContext

      protected boolean ignoreApplicationContext(org.springframework.web.context.WebApplicationContext applicationContext, org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType managementPortType)
    • hasWebServerNamespace

      protected final boolean hasWebServerNamespace(org.springframework.context.ApplicationContext applicationContext, org.springframework.boot.actuate.endpoint.web.WebServerNamespace webServerNamespace)
    • initialized

      protected final void initialized(Supplier<org.springframework.web.context.WebApplicationContext> context)
      Description copied from class: ApplicationContextRequestMatcher
      Method that can be implemented by subclasses that wish to initialize items the first time that the matcher is called. This method will be called only once and only if ApplicationContextRequestMatcher.ignoreApplicationContext(WebApplicationContext) returns false. Note that the supplied context will be based on the first request sent to the matcher.
      Overrides:
      initialized in class ApplicationContextRequestMatcher<org.springframework.web.context.WebApplicationContext>
      Parameters:
      context - a supplier for the initialized context (may throw an exception)
      See Also:
    • matches

      protected final boolean matches(jakarta.servlet.http.HttpServletRequest request, Supplier<org.springframework.web.context.WebApplicationContext> context)
      Description copied from class: ApplicationContextRequestMatcher
      Decides whether the rule implemented by the strategy matches the supplied request.
      Specified by:
      matches in class ApplicationContextRequestMatcher<org.springframework.web.context.WebApplicationContext>
      Parameters:
      request - the source request
      context - a supplier for the initialized context (may throw an exception)
      Returns:
      if the request matches
    • getDelegateMatchers

      protected final List<org.springframework.security.web.util.matcher.RequestMatcher> getDelegateMatchers(org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory, RequestMatcherProvider matcherProvider, Set<String> paths, @Nullable org.springframework.http.HttpMethod httpMethod)
    • getLinksMatchers

      protected List<org.springframework.security.web.util.matcher.RequestMatcher> getLinksMatchers(org.springframework.boot.security.autoconfigure.actuate.servlet.EndpointRequest.RequestMatcherFactory requestMatcherFactory, RequestMatcherProvider matcherProvider, String basePath)
    • getRequestMatcherProvider

      protected RequestMatcherProvider getRequestMatcherProvider(org.springframework.web.context.WebApplicationContext context)
    • toString

      protected String toString(List<Object> endpoints, String emptyValue)
    • getEndpointId

      protected org.springframework.boot.actuate.endpoint.EndpointId getEndpointId(Object source)