Skip to content

Commit

Permalink
Revert "password decrypt"
Browse files Browse the repository at this point in the history
This reverts commit 72e5503.
  • Loading branch information
dzdx committed May 25, 2022
1 parent 4138898 commit 460f2ec
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
import com.alibaba.druid.filter.stat.StatFilter;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import com.alipay.sofa.registry.jdbc.decrypt.DecryptConstants;
import com.alipay.sofa.registry.jdbc.decrypt.Decryptor;
import com.alipay.sofa.registry.jdbc.decrypt.DecryptorManager;
import com.alipay.sofa.registry.jdbc.repository.impl.AppRevisionJdbcRepository;
import com.alipay.sofa.registry.jdbc.repository.impl.ClientManagerAddressJdbcRepository;
import com.alipay.sofa.registry.jdbc.repository.impl.DateNowJdbcRepository;
Expand All @@ -53,7 +50,6 @@
import com.alipay.sofa.registry.util.SystemUtils;
import com.google.common.collect.Lists;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import javax.sql.DataSource;
Expand All @@ -62,7 +58,6 @@
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -130,26 +125,14 @@ public StatFilter statFilter(JdbcDriverConfig jdbcDriverConfig) {
return filter;
}

@Bean
@ConditionalOnMissingBean
public Collection<Decryptor> decryptors() {
return Lists.newArrayList();
}

@Bean
public DecryptorManager decryptorManager() {
return new DecryptorManager();
}

/**
* create datasource
*
* @return
* @throws Exception
*/
@Bean
public DataSource dataSource(
DecryptorManager decryptorManager, JdbcDriverConfig jdbcDriverConfig) throws Exception {
public DataSource dataSource(JdbcDriverConfig jdbcDriverConfig) throws Exception {
Properties props = new Properties();
props.put(
PROP_DRIVERCLASSNAME,
Expand All @@ -166,11 +149,8 @@ public DataSource dataSource(
JdbcDriverConfigBean.PRE_FIX + "." + PROP_USERNAME, jdbcDriverConfig.getUsername()));
props.put(
PROP_PASSWORD,
decryptorManager.decrypt(
DecryptConstants.JDBC_PASSWORD,
SystemUtils.getSystem(
JdbcDriverConfigBean.PRE_FIX + "." + PROP_PASSWORD,
jdbcDriverConfig.getPassword())));
SystemUtils.getSystem(
JdbcDriverConfigBean.PRE_FIX + "." + PROP_PASSWORD, jdbcDriverConfig.getPassword()));

// todo connection pool config
props.put(PROP_MINIDLE, jdbcDriverConfig.getMinIdle() + "");
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 460f2ec

Please sign in to comment.