Spring Boot Actuator によって提供される管理エンドポイントに、URI マッチャーを使用して Grails 3.0.12 インターセプターを適用しようとしています。アクチュエーターのmanagement.context_pathプロパティを/adminに設定しています。
UrlMappings.groovy にマップされたすべてのエンドポイントは傍受されていますが、Spring Boot Actuator によって管理されているエンドポイントは傍受されていません。代わりに、インターセプターがバイパスされていることを示す次のログが表示されます。
DEBUG: org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping - Looking up handler method for path /admin/metrics
DEBUG: org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping - Returning handler method [public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()]
これが私のインターセプターです:
class LoginInterceptor {
def securityService
int order = HIGHEST_PRECEDENCE
LoginInterceptor() {
match(uri: "/**")
}
boolean before() {
if (!request.exception) {
securityService.authenticateUser()
}
true
}
boolean after() { true }
void afterView() { /* no-op */ }
}
application.yml の管理構成は次のとおりです。
management:
context_path: /admin
アクチュエーターが提供するエンドポイントが確実に傍受されるようにするにはどうすればよいですか?