package com.sckw.remote.config;

import com.sckw.remote.constant.DubboAllow;
import jakarta.annotation.PostConstruct;
import org.apache.dubbo.common.utils.SerializeSecurityManager;
import org.apache.dubbo.rpc.model.FrameworkModel;
import org.springframework.stereotype.Component;

/**
 * dubbo接口放行处理
 *
 * @author xucaiqin
 */
@Component
public class AllowClassList {
    @PostConstruct
    public void init() {
        SerializeSecurityManager serializeSecurityManager = FrameworkModel.defaultModel().getBeanFactory().getBean(SerializeSecurityManager.class);
        for (String s : DubboAllow.getPacks()) {
            serializeSecurityManager.addToAllowed(s);
        }

    }

}
