package com.malk.apigw.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ComWebConfig implements WebMvcConfigurer {

    @Autowired
    private CallerAuthInterceptor callerAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(callerAuthInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/actuator/**",
                        "/_admin/**",
                        "/assets/**",
                        "/templates/**",
                        "/static/**"
                );
    }
}
