Skip to content

Grails 3.0.12: interceptor with uri matcher does not intercept actuator endpoints #9622

@kpschuck

Description

@kpschuck

When attempting to apply a Grails interceptor with a URI matcher to the management endpoints provided by Spring Boot Actuator I've noticed that those requests are not being intercepted.

I have the management.context_path property set to /admin but the URI matcher '/**' does not match /admin/env. It does however match any mapping that I have defined inUrlMappings.groovy

Setup

In application.yml:

management:
  context_path: /admin

Here is my interceptor:

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 */ }
}

How do I go about creating a Grails 3 interceptor that intercepts all URI's regardless of how the routes are defined?

Please see this StackOverflow post for additional information.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions