风控中台-增加生产和测试环境参数开关

This commit is contained in:
zhanglei@ap-leasing.com.cn 2023-09-26 11:27:36 +08:00
parent cb0a64fbc8
commit d10903676d
4 changed files with 29 additions and 8 deletions

View File

@ -3,11 +3,19 @@ esb_url=http://47.93.34.101/baicfc/trans?
userid=TYJWBY7F userid=TYJWBY7F
AFS012_serviceid=N9LZG7J8OXSD90B4 AFS012_serviceid=N9LZG7J8OXSD90B4
AMP005_serviceid=24LITXVE9LKXANTD AMP005_serviceid=24LITXVE9LKXANTD
log_path=/data/esb/log/ log_path=/data/esb/log/
## キエニロユゥ ## afs config
afs_url=http://test-antifraud.baicfc.com/Instinct.UI.WebClient_5.3.1_2023/api/redirect? afs_url=http://afsapf.rms.baicfc.com/Instinct.UI.WebClient_5.3.1/api/redirect?
RSAPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmxe7GIws+1RwPtICBi+GKbNEYrqz+xkPZN8Cv3vnyK/cX87n2volMPV1LZBGLyFj2ckyLmIt+uC1SHDio+N9/e695UT2rvTJdP7rho0yA2sXmAqG4pjVA8dPHFgvUIaW/SIwPpqHnPrKTj6YHp5/6Amuvq7W5WujHsM1aq61p0RL6b6CQlwQtXK1MGE95eDJrhY0eO2RcoKBOJgQSa2MdqSSQ9jYuu/9lpoENxvHcHydxFqwzwJtP4Noct9ZplSjxA/OsincK4q6ELSDL3f9ckBXGmZrHDkYVyv0hD1QeC8Pgy3FAppgPPfMXPLUWgswV24/dEJP8qiCTacFfF9iwIDAQAB RSAPublicKey=/soft/apache-tomcat-7.0.90/webapps/apzl_leasing/WEB-INF/classes/rsa_public_key.pem
rc_score_result_url=http://10.91.122.11:8081/baicaplcredit/businessFlow/rzzlCreditResultForThirdParty.jsp is_prd=false
#test#
esb_url_test=http://47.93.34.101/baicfc/trans?
userid_test=TYJWBY7F
AFS012_serviceid_test=N9LZG7J8OXSD90B4
AMP005_serviceid_test=24LITXVE9LKXANTD
log_path_test=/data/esb/log/
afs_url_test=http://test-antifraud.baicfc.com/Instinct.UI.WebClient_5.3.1_2023/api/redirect?
RSAPublicKey_test=/soft/apache-tomcat-7.0.90/webapps/apzl_leasing/WEB-INF/classes/rsa_public_key.pem

10
config/rsa_public_key.pem Normal file
View File

@ -0,0 +1,10 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmxe7GIws+1RwPtICBi+
GKbNEYrqz+xkPZN8Cv3vnyK/cX87n2volMPV1LZBGLyFj2ckyLmIt+uC1SHDio+N
9/e695UT2rvTJdP7rho0yA2sXmAqG4pjVA8dPHFgvUIaW/SIwPpqHnPrKTj6YHp5
/6Amuvq7W5WujHsM1aq61p0RL6b6CQlwQtXK1MGE95eDJrhY0eO2RcoKBOJgQSa2
MdqSSQ9jYuu/9lpoENxvHcHydxFqwzwJtP4Noct9ZplSjxA/OsincK4q6ELSDL3f
9ckBXGmZrHDkYVyv0hD1QeC8Pgy3FAppgPPfMXPLUWgswV24/dEJP8qiCTacFfF9
iwIDAQAB
-----END PUBLIC KEY-----

View File

@ -33,8 +33,8 @@ public class AfsUrlController {
String rsaString = hashString.substring(hashString.indexOf("redirect?")+"redirect?".length())+"&hash="+hashValue; String rsaString = hashString.substring(hashString.indexOf("redirect?")+"redirect?".length())+"&hash="+hashValue;
System.out.println("进行RSA加密的内容"+rsaString); System.out.println("进行RSA加密的内容"+rsaString);
//todo 密钥文件地址 //todo 密钥文件地址
//PublicKey publicKey = encryptRsaByFile(""); PublicKey publicKey = encryptRsaByFile(RSAPublicKey);
PublicKey publicKey = encryptRsaByString(RSAPublicKey); //PublicKey publicKey = encryptRsaByString(RSAPublicKey);
Cipher cipher = Cipher.getInstance("RSA"); Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE,publicKey); cipher.init(Cipher.ENCRYPT_MODE,publicKey);
byte[] encryptBytes = cipher.doFinal(rsaString.getBytes(StandardCharsets.UTF_8)); byte[] encryptBytes = cipher.doFinal(rsaString.getBytes(StandardCharsets.UTF_8));

View File

@ -31,6 +31,9 @@ public class BaicPropertiesUtil {
public static String get(String propName) { public static String get(String propName) {
if(attributes == null) load(); if(attributes == null) load();
return attributes.get(propName); if("true".equals(attributes.get("is_prd"))){
return attributes.get(propName);
}
return attributes.get(propName+"_test");
} }
} }