Secure static resources

I have this piece of code to config static resource

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static-resource/**")
                .addResourceLocations("file:/path/to/static-resource/")
                .setCacheControl(CacheControl.noStore()
                                             .cachePrivate()
                                             .mustRevalidate());
    }

now I can access everything inside /static-resource without authentication

Then, I want to secure some specific endpoints inside static-resource, it can be any request matching with /static-resource/secured-docs/**.

How I can secure my static resource in A12?

Updated:
Versions I’m using:

  • Data Service: 35.0.0
  • UAA: 6.1.0

Please provide your version DS and UAA for more information to find the solution!

Yes, I updated to the description:

  • Data Service: 35.0.0
  • UAA: 6.1.0

in UAA 6.1.0: use can using the mgmtp.a12.uaa.authentication.secured-contexts, then add your secure specific path as this key value.