Browse Source

密码避免存明文

pull/12/head
richie 6 years ago
parent
commit
3ec3a4294c
  1. 6
      src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java

6
src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java

@ -4,6 +4,7 @@ import com.fr.config.ConfigContext;
import com.fr.config.DefaultConfiguration; import com.fr.config.DefaultConfiguration;
import com.fr.config.holder.Conf; import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders; import com.fr.config.holder.factory.Holders;
import com.fr.security.SecurityToolbox;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
/** /**
@ -68,11 +69,12 @@ public class RedisConnectionProxyConfig extends DefaultConfiguration {
} }
public String getPassword() { public String getPassword() {
return password.get(); String text = password.get();
return SecurityToolbox.decrypt(text);
} }
public void setPassword(String password) { public void setPassword(String password) {
this.password.set(password); this.password.set(SecurityToolbox.encrypt(password));
} }
public String getPrivateKeyPath() { public String getPrivateKeyPath() {

Loading…
Cancel
Save