1、去掉冗余配置
This commit is contained in:
parent
c17cc727e7
commit
33f2205f8e
@ -3,6 +3,7 @@ package cn.zyjblogs.filter;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -14,5 +15,5 @@ import java.util.List;
|
||||
@ConfigurationProperties(prefix = "zyjblogs.whilelist")
|
||||
public class WhiteListProperties {
|
||||
|
||||
private List<String> allowPaths;
|
||||
private List<String> allowPaths = new LinkedList<>();
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ public class OauthUserAuthenticationConverter extends DefaultUserAuthenticationC
|
||||
@Override
|
||||
public Authentication extractAuthentication(Map<String, ?> map) {
|
||||
OauthUserDetails oauthUserDetails = new OauthUserDetails();
|
||||
Object user_name = map.get(ContextKeyConstant.USERNAME_KEY);
|
||||
if (user_name != null) {
|
||||
oauthUserDetails.setUsername(user_name.toString());
|
||||
Object userName = map.get(ContextKeyConstant.USERNAME_KEY);
|
||||
if (userName != null) {
|
||||
oauthUserDetails.setUsername(userName.toString());
|
||||
if (map.containsKey(ContextKeyConstant.USER_ID_KEY)) {
|
||||
oauthUserDetails.setId((String) map.get(ContextKeyConstant.USER_ID_KEY));
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author zhuyijun
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(RsaKeyProperties.class)
|
||||
public class OauthAutoConfiguration {
|
||||
@EnableConfigurationProperties({RsaKeyProperties.class})
|
||||
public class RsaAutoConfiguration {
|
||||
}
|
@ -17,7 +17,7 @@ public class RsaKeyProperties {
|
||||
/**
|
||||
* 启用rsa对token进行加密
|
||||
*/
|
||||
private Boolean enable;
|
||||
private Boolean enable = true;
|
||||
|
||||
/**
|
||||
* 公钥地址
|
||||
|
@ -1,2 +1,2 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
cn.zyjblogs.starter.common.autoconfigure.rsa.OauthAutoConfiguration
|
||||
cn.zyjblogs.starter.common.autoconfigure.rsa.RsaAutoConfiguration
|
@ -7,6 +7,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author zhuyijun
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({RsaKeyProperties.class, WhiteListProperties.class})
|
||||
@EnableConfigurationProperties({WhiteListProperties.class})
|
||||
public class OauthAutoConfiguration {
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
package cn.zyjblogs.starter.oauth.autoconfigure;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
|
||||
/**
|
||||
* rsa 路径配置文件
|
||||
*
|
||||
* @author zhuyijun
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties(prefix = "rsa.key")
|
||||
@RefreshScope
|
||||
public class RsaKeyProperties {
|
||||
/**
|
||||
* 启用rsa对token进行加密
|
||||
*/
|
||||
private Boolean enable = true;
|
||||
|
||||
/**
|
||||
* 公钥地址
|
||||
*/
|
||||
private String pubKeyPath;
|
||||
/**
|
||||
* 私钥地址
|
||||
*/
|
||||
private String priKeyPath;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user