package com.friday.tooldriver.config;


import com.friday.mystery.coresecurity.config.SecurityConfig;
import com.google.common.collect.Lists;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.*;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.util.matcher.*;
import org.springframework.security.web.util.matcher.*;

import java.util.List;

@Configuration
public class DriverSecurityConfig extends SecurityConfig {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        List<RequestMatcher> permitAllMatcher = Lists.newArrayList(
                new AntPathRequestMatcher("/driver/smart-rpa/admin/**", null),
                new AntPathRequestMatcher("/driver/machine/license/**", null),
                new AntPathRequestMatcher("/driver/smart-rpa/execute/**", null)
        );
        super.setPermitAllMatcher(permitAllMatcher);
        super.configure(http);
    }
}
