All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.flood.cloud.gateway.props.FloodApiProperties Maven / Gradle / Ivy

There is a newer version: 2.7.14.0
Show newest version
package cn.flood.cloud.gateway.props;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 验证权限配置
 */
@Data
@RefreshScope
@ConfigurationProperties(prefix = "fpermission")
public class FloodApiProperties {

    /**
     * 监控中心和swagger需要访问的url
     */
    private static final String[] ENDPOINTS = {
            "/oauth/**",
            "/actuator/**",
            "/v2/api-docs/**",
            "/swagger/api-docs",
            "/swagger-ui.html",
            "/doc.html",
            "/swagger-resources/**",
            "/webjars/**",
            "/druid/**",
            "/error/**",
            "/assets/**",
            "/auth/logout",
            "/auth/code",
            "/auth/sms-code"
    };

    /**
     * 忽略URL,List列表形式
     */
    private List excludePath = new ArrayList<>();

    /**
     * 是否启用网关鉴权模式
     */
    private Boolean enable = false;

    /**
     * 首次加载合并ENDPOINTS
     */
    @PostConstruct
    public void initIgnoreUrl() {
        Collections.addAll(excludePath, ENDPOINTS);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy