@Override protected RequestMatcher createDelegate(WebApplicationContext context, RequestMatcherFactory requestMatcherFactory) { WebEndpointProperties properties = context .getBean(WebEndpointProperties.class); String basePath = properties.getBasePath(); if (StringUtils.hasText(basePath)) { return new OrRequestMatcher(getLinksMatchers(requestMatcherFactory, getRequestMatcherProvider(context), basePath)); } return EMPTY_MATCHER; }
/** * Returns a matcher that matches only on the links endpoint. It can be used when * security configuration for the links endpoint is different from the other * {@link Endpoint actuator endpoints}. The * {@link EndpointRequestMatcher#excludingLinks() excludingLinks} method can be used * in combination with this to remove the links endpoint from * {@link EndpointRequest#toAnyEndpoint() toAnyEndpoint}. For example: * <pre class="code"> * EndpointRequest.toLinks() * </pre> * @return the configured {@link RequestMatcher} */ public static LinksRequestMatcher toLinks() { return new LinksRequestMatcher(); }