yinjihuan / monkey-api-encrypt

monkey-api-encrypt是对基于Servlet的Web框架API请求进行统一加解密操作
Apache License 2.0
793 stars 346 forks source link

yml方式设置debug=true依然全部加密 #23

Closed echokk11 closed 5 years ago

echokk11 commented 5 years ago
spring:
  encrypt:
    key: ***
    debug: true
echokk11 commented 5 years ago

EncryptAutoConfiguration中漏了一行,我提一个PQ吧

@Bean
    public FilterRegistrationBean filterRegistration() {
        EncryptionConfig config = new EncryptionConfig();
        config.setKey(encryptionConfig.getKey());
        config.setRequestDecyptUriList(encryptionConfig.getRequestDecyptUriList());
        config.setResponseEncryptUriList(encryptionConfig.getResponseEncryptUriList());
        config.setDebug(encryptionConfig.isDebug());    // miss this line
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new EncryptionFilter(config));
        registration.addUrlPatterns(encryptionConfig.getUrlPatterns());
        registration.setName("EncryptionFilter");
        registration.setOrder(encryptionConfig.getOrder());
        return registration;
    }

BTW:没明白这里为啥要重新new一个对象

yinjihuan commented 5 years ago

这边是有点问题,我已经改了 1.1.5版本